Write AIs to play football
This project is maintained by richard shepherd nick pollard
Each AI runs as a separate process from the main game engine. The game engine communicates with the AIs by sending them JSON messages through stdin, and by receiving replies from the AI via stdout. This means that AIs can be written in any language. When a game starts, the AI process for each team is spawned by the game engine, and is killed when the game ends.
AIs live in the AIs folder. Each one should be in its own sub-folder, which should be named 'AI_[name]'. The folder should contain:
The first element of 'CommandLine.txt' should be an executable either in the AI's folder or on the path. Any other elemtns are passed to the executable as command-line parameters.
For example, the BootAndShoot sample is a C# executable with no command-line parameters. So its CommandLine.txt is just:
BootAndShoot.exe
The RandomMovement sample needs to be run using node.js, so its CommandLine.txt looks like:
node RandomMovement.js
Note: At the moment the game engine is rather fussy about the command-line, and it must not have any whitespace (including a newline) after the text.
The main loop in your AI should be:
There are two message types that your AI will receive: events and requests. Events provide updated information and do not need a response. Requests need a response (though you can in some cases provide a basic 'empty' response). See the API reference for more details of the different messages and response formats.
The file 'app.js' in the root-folder of the game-engine controls which AIs will be playing. Edit these lines to choose which AIs are playing:
var ai1 = aiManager.getAIWrapperFromName('RandomMovement');
var ai2 = aiManager.getAIWrapperFromName('BootAndShoot');
The AI name should be the name of its folder without the 'AI_' prefix.
To submit your API, please send a zipped copy of your AI folder along with the source code, to richard.s.shepherd@gmail.com. Any executable files should be compiled for Windows. Please also indicate any frameworks (such as Java or Python) that are required, and the versions needed.