The Challenge
Find out the details of your mission!
Download SDK
Getting started by downloading the Java SDK.
Read the Tutorial
The tutorial will give you an overview on all SDK tools. Try to implement and run your first AI.
Upload your AI
Happy about your first version? Get into the game by uploading it.
Lookup your Rank
Now it's time to compare your AI against the others.

Welcome on the CodeBattle Platform!

Stage 1 of Code-IT 2018

The Challenge

You are the ruler of a small village and your goal is to become the wealthiest ruler in the area. On the way to achieving this goal you can count on the support of your subjects. Your warriors and archers are powerful weapons against your competitors and your workers will help you to collect the necessary resources to persist in such a war.

The goal of one battle is to produce as many coins as possible. At the end of a battle the player with the most coins in their base wins. To produce coins you need to upgrade your base with resources which you can collect.

The Map

Each map is a square map. A map can have the following types of fields: Each map is surrounded by walls so you cannot move outside the map. The CodeBattle SDK contains some maps with which you can test your AI.

The Units

Three types of units exist: Units can walk only one field north, east, south or west per round. Units cannot walk diagonally. Only one unit can be on a map field at a time. You cannot move a unit onto a field where one of your own units already is.

Collect Resources

All units can collect resources, but collectors are much better in collecting resources than the other units. To collect a resource walk on a field that contains resources. The unit will collect as much resources as possible. All maps have some predefined resource locations. At the beginning of a battle, all possible resources locations are filled completely. When too many resource fields have been emptied, new resources will respawn on a random resource location. One field contains only a limited amount of resources. The resources on a field have a certain lifetime measured in rounds. When the lifetime expires, the (remaining) resources on that field will disappear. When not enough resource fields are present on the map another field will be chosen randomly and spawn fresh resources.

Unit Health and Fighting

Each unit has a specific amount of health points. Different unit types have different amounts of health points. When the health points of a unit reach zero, the unit is removed from the game and all resources the unit was carrying will be dropped.

You can fight against a unit of another player by either moving your unit aggressively on the map field of the other unit, or by specifically requesting an attack. You cannot fight against your own units. You cannot attack other players' bases but units from inside a base can attack enemies nearby according to the rules of their type.

When one unit attacks another, it deals a specific amount of damage to its target. The damage is then subtracted from the attacked unit, possibly killing it in the process. The damage of an archer depends on the distance. The distance between units is measured in Manhattan distance. In addition the archer needs a line of sight to shoot the arrow.

You can heal a unit completely when it is currently in your base. However the healing will cost half the resources required to build it. When a unit is healed, it cannot do any other actions in that round.

Produce Coins to win the battle

The player with the most coins at the end will win the battle. To produce coins you need to upgrade your base and it will start building coins. Each upgrade is more expensive but the production increases. TrueSkill is used to determine the overall rank. You can find the overall rank here. After the 17th of November 2017 (23:59:59) the overall rank will be reset and the final game play will start. The competitors with the best AIs will be invited to the final in Tübingen at the 24th of November 2017.

AI Development

The AI has to be developed with Java (JDK 8). You develop your AI locally with the CodeBattle SDK which you can download from here.
Take a look at the SDK tutorial page how to develop your AI. Don't worry if you have no clue how to start, the SDK contains a very basic example implementation. When you want to test your AI against the other competitors upload your client on our CodeBattle Server using your API key. Check this page for how to upload your CodeBattle client. You can upload your client until 17th of November 2017 (23:59:59). Afterwards the final battle will be played on our server in order to determine the best AIs.
You are allowed to use third party libraries and to copy code from other sources (if you have permission and/or license to do so) but you have to implement your own tactics and strategies.

The 5 Steps to get your AI working

Competing against your enemies is really simple. After downloading the SDK you can start implementing your own AI and after uploading your AI it will automatically fight your enemies.

For more details about the steps just click on the image.

Support

If you need any support contact the Code-IT team via Reddit or email (code-it@itdesign.de).