TerraTactician Expandoria Logo

TerraTactician Expandoria

Quest 2

Last updated: April 16, 2025

The goal of this level is to set up a bot and learn the basic interactions.

You can find a guide on our website that covers the basics of how to set up the bot. The game installation guide can be found on our website. If you don’t want to start at zero, you can use our bot template. (The template is also available on the Algorithms and Data structures website.)

Part 1

We have placed 3 Wheat Tiles on the map. As you can see, one of them hasn’t been placed optimally and can be picked up.
Your task is picking up the tile and placing it between the other two Wheat Tiles.

You can place your code in the executeTurn method:

public void executeTurn(World world, Controller controller) {

You can access data about the current game state using World.
It also allows access to the Map, which allows you to iterate over Tiles in the world.

World world = world.getMap();
for (Tile tile : world) {
  // iterates over all tiles
}

You can check if a Tile can be picked up using tile.reclaimable.

The Controller allows you to select the action to execute in the current turn. Once you find the Tile that can be picked up, you can pick it up using controller.takeTile.

After picking up the tile, you have to place it between the other two tiles. You could do this by searching for a position without a tile that has two neighbours.
Or, you can determine the coordinates of the two remaining Tiles and calculate the position between them using the operations we defined for CubeCoordinates (i.e., div and sub).
Once you have determined the position, you can use controller.placeTile to place the tile.

// pick up a Tile
controller.takeTile(tile.getCoordinate());
// place a Tile
controller.placeTile(TileType.Wheat, new CubeCoordinate(0, 0, 0));

Part 2

After some time, you will notice that Rewards spawn above some Tiles. Your task is to pick them up to collect a resource reward.
You can use the World to access Rewards and iterate over them.
You can use the Controller to collect a Reward at a given position.