Skip to content
Michael Murphey edited this page Jun 7, 2014 · 5 revisions

This tutorial will quickly show you how to write your own AI! To see the full rules of WotA go to Game Rules.

  1. You first need to download and install WotA. Read README.md here or [here] (https://github.com/wotateam/wota).

  2. Create at least two classes. One should extend wota.gameobjects.AntAI and the other wota.gameobjects.HillAI. These files will contain your AI. It is important that your files are located in a subfolder of src/wota/ai/. Correspondingly, your class should reside in a subpackage of wota.ai, write package wota.ai.my-ai-name; at the top of your files, where my-ai-name is the name of the subfolder you are using.

  3. Both classes have to override the method public void tick() this method gets called every tick of the game and for every ant separately.

  4. You have one hill which is able to produce new ants if enough food is available. Have a look at the sample AIs in wota.ai to see how you can create new ants. If you copied src/wota/ai/template/HillAI.java to get started, you can look at this hill AI's tick method.

  5. For the other ants use the methods and fields from AntAI to perceive the environment of the ant and to interact. You can find sample AIs in wota.ai. Game constants may be found in parameters, a member of AntAI, which is an instance of wota.gameobjects.Parameters. Do not hesitate to look at its source code and parameters.txt to see the actual parameter values.

  6. You can start the game by loading your AIs in wota.gamemaster.Wota and executing its main. Keep in mind that you have to specify the name of the folder containing your AI. Your hill will need to produce ants at the beginning of the game.

  7. If you have any questions do not hesitate to ask them, for example by emailing one of us, talking to us or creating an issue on: http://github.com/wotateam/wota/issues

  8. Please send us your AIs no matter how primitive you perceive them to be. This will help us a lot. Find more details here.

  9. Have fun!

Setting a Specific Seed

In order to set a specific seed you need to open the file src/wota/Wota.java and uncomment lines 49 and 50 (which will be // long specialSeed = 42; // GameWorldFactory gameWorldFactory = new GameWorldFactory(specialSeed, parameters, simulationParameters); ) and comment out line 54 (which will be GameWorldFactory gameWorldFactory = new GameWorldFactory((new Random()).nextLong(), parameters, simulationParameters);). After that you may set the local variable specialSeed to the value of your desired seed.

If you wish to go back to using a random seed you can simply comment out lines 49 and 50 and uncomment line 54.

Clone this wiki locally