Setup
To build your bot written in Java, you have to download the bot library.
You can download the latest version from the Releases tab.
We provide a tte-bot.jar
and a tte-bot-full.jar
.
The two versions are mostly the same, but the full
jar also contains the Javadoc,
thus providing better autocomplete.
As the Java Bot uses Java and communicates with the game via a websocket, it can
be started on any platform with Java installed.
For example, you can start the bot on your computer and connect to it from the
online version.
How to connect a bot to the game
- Place your bot in the
bots
folder - compile the bot:
javac -cp tte-bot.jar bots/ExampleBot.java
- Start the bot:
java -jar tte-bot.jar --challenge ExampleBot
- Note: the
.class
file extension is optional - Note: You can provide a path to a
.class
file (it doesn’t necessarily have to be in thebots
folder)
- Note: the
- Start the game
- via the UI:
- Open the game and click
Start game
- ensure the
Enable bot
checkmark is set and insert the URL of your bot. (The default URL is probably correct) - Click
Start game
- Open the game and click
- via the CLI:
terratactician-expandoria --bot localhost:7738 --challenge
- You can use
-d
to run the game in headless mode and speed up the simulation - You can view other options on the help page using
-h
- via the UI:
Platform-specific notes
Android
The easiest way to run the bot on Android is using Termux. Termux gives you access to a Linux environment:
You can use the following command to install java
:
pkg install openjdk-17
Afterwards, simply follow the generic bot guide at the top of this page.