Getting started

Let’s setup your Lia environment, run your first game and upload your bot to the leaderboard! You can also try out Lia without downloading anything via our Online editor.

1. Download

  • Download Lia-SDK for your operating system and unzip it into a folder of your liking. Lia-SDK is portable so you don’t need to install it.
  • Install Java on your system as Lia is written in Kotlin and it needs it in order to run.
  • Setup programming language that you will use for writing your bot. If you have used the language before, you most likely already have everything that you need.

2. Play a game

Open up a Cmd.exe or PowerShell.exe on Windows or a Terminal on Linux or macOS, move to the unzipped Lia-SDK directory and run the commands below. They will create a new starting bot John using programming language Java and will battle it against itself. To choose a different language for your bot simply replace the java part of the first command with python3 or kotlin. The first time you play a game with your bot it may take some time as a couple of libraries need to be downloaded, later runs will be much faster.

lia.exe bot java John
lia.exe play John John
.\lia.exe bot java John
.\lia.exe play John John
./lia bot java John
./lia play John John
Commands: bot, play

After running the commands above, wait until the game is generated and voila, the replay is opened for the generated game! Also a new directory named John is created inside the unzipped Lia-SDK folder. This folder contains all the code for your bot. We will dig into it in the next section.


Example gameplay

3. Understand your bot

With your favorite text editor open up your bot’s main file. If you have created Java bot then open up John/src/MyBot.java, if Python3 then John/my_bot.py and if Kotlin then John/src/MyBot.kt. You can also open the whole bot directory (eg. John) in an IDE. Check Using an IDE example to learn more.

Starting bot implementation is very simple. It keeps choosing random locations on the map and sending units there. Worker units collect resources if they see them while warrior units shoot when they see opponents.

Read through the code to see how it works!

Note that during the development you can structure your bot directory as you like, as long as the MyBot file acts as your “main” file. This means that you can create additional files which you then import into MyBot.

To delete a bot, simply delete it’s directory, in our case the directory named John.

4. Join the leaderboard

Now it is time to upload your bot to the leaderboard and see how it does against bots made by other programmers! You can do this in the following two steps.

  1. Create your Lia account on our website.
  2. Upload your bot to the leaderboard using the command below. If you are not logged in yet, the Lia-SDK will ask you for your Lia credentials.
lia.exe upload John
.\lia.exe upload John
./lia upload John
Commands: upload

Having issues when uploading your bot?

If you have any issues when uploading your bot you can get in touch with us on Discord chat, create a post on our Reddit forum or contact us over email or on any of our social media (Facebook, Github). We will gladly help you to start competing!

If everything went smoothly your bot should now be uploaded to the leaderboard and it will start playing games within a few minutes. Lia-SDK will also open up your profile page on our website where you will be able to follow your bot’s progress.

After you make some improvements to your bot, you can again run the upload command and you will replace the old bot on the leaderboard with a new one.

We wish you many victories on your Lia journey! 🏆🏆🏆

Next up

If you already feel comfortable you can start developing your bot on your own. Otherwise stay with us and we will show you how you can greatly improve your bot in a matter of minutes.

Next: Aiming at the opponent