Third programming contest – Code

Starting the server

You can start the server in the folder engine via

$ ./engine -p 2 -m ../maps/board1.map

The value after -p is the number of clients that can join the game. After -m follows the name of the map that should be played on. (There are some maps in the folder maps.)

As soon as enough clients have connected to the server the game will start.

Example AI

The example bot is located in the folder ai and may be started without any parameters:

$ ./ai

Graphical interface

If you want to see the movement of each player, you can start the GUI in the folder gui:

$ ./gui

Via [Ctrl+S] resp. “File -> Connect to server” you can connect to the current running server (if it has been started before).

You will see the game map with all players (red and blue elements) and the toxic values (green fields, depending on the toxic intensity). The game statistics at the side or bottom of the map can be dragged to every side of the window or be hidden completely. Opaque players have already left the game.

Important note: It is not allowed to use the GUI port for connecting your bot to the server.

The GUI is not really fast, so do not start more than 20 bots at a time.

Automatic script

If you do not want to start 20 AIs by your own you can use a small start script in the main folder:

$ ./start.sh maps/board1.map 20 1

This will start a server that loads the map board1.map and waits for 20 clients to connect. Afterwards 20 example bots will be started. The last number (above: 1) is the number of iterations and is mostly for large test cases.

Using the existing code

The code for the engine, example AI and GUI is published under the GNU Lesser General Public License (LGPL) and may be used for your own work. If you want derive from the source code you must use the LGPL as license for your program. If you just want to use the compiled libraries you can use any license.

Note: It is possible that the source code will change during the contest but we will try to keep the interfaces untouched.

previous page next page