Write AIs to play football
This project is maintained by richard shepherd nick pollard
The coding-world-cup framework is written in node.js, but AIs can be written in any language. AIs are run as separate processes and the framework communicates with them by sending JSON messages to the AI's stdin, and receives replies via the AI's stdout.
There are two sample AIs in the 'AIs' folder.
'AI_RandomMovement' is written in node.js / JavaScript and just moves the players randomly, without really trying to play football.
'AI_BootAndShoot' is written in C# and plays a simple game, attempting to pass the ball between players and shoot at the goal.
Some of the code in this sample could be reused as an "API" for your own C# AIs. The specific code for this AI is in the file 'BootAndShoot.cs'. All the other code could be reused for other AIs. You could create your own AI class derived from 'CodingWorldCupAPI' and implement its virtual functions to play the game. The base class reads the JSON messages from the game-engine and parses out some useful data, and converts the received messages into virtual-function 'events'.
Please note, though, that this is not a complete API for the coding-world-cup. It is just a sample. The real coding-world-cup API is the message-based API as described here.