Codename Berlin

April 10th 2011 by Guillaume Malette

Berlin is ThirdSide's latest project. The best way to describe it is: a turn-based multiplayer artificial intelligence strategy board game.

The Story

The story behind Berlin started at the CSGames 2011. In the Artificial Intelligence challenge we had to write a program that would compete against the other schools in a game similar to Risk on a map with nodes and cities, where the AI could control it's soldiers. After each turn, a city would yield the AI one soldier. The winner was the AI that could conquer all the cities.

Apparently, Chris and I both liked the idea a lot. As soon as we came home from the CSGames, we started working on our version of the game, without knowing the other also did. The next day, we both had a working prototype for the user interface and when we showed it to each other, we realized that we both different opinions on how the game should work.

Problems

The version offered at the CSGames was not extensible. The maps were line-separated instructions to create nodes and links to other nodes. The program had to be executed by a master and output to stdout. The rules were fixed.

Building from there

We both wanted to use JSON for every communication protocol. Maps, turns and whatnot are all represented in JSON. As such, we are no longer limited to two types of nodes, and the map is a lot easier to read (for humans).

There was also the problem of security. There is no way we can trust a third party application running on our server, no matter how sandboxed it is. To prevent this, each artificial intelligence will be run by the user, as a server responding to different POST calls. We figure that anybody interested in playing this kind of game is knowledgeable enough to open a port on his router.

Coming in to help

With this rapid evolution we were overwhelmed by work and our trusty friend over at Ephemere Games volunteered to give us a hand. With his help we should have something to show very soon.

Finally Ruby

As I stated in the CSGames post, Ruby was completely absent from the competition. This time around, the solution is built on Ruby. Yay! We used Rails for the main application and Sinatra for the game's master server. We're currently implementing a random AI to be used as a starter by anyone who will be willing to play the game. This far we have one version in Ruby (with Sinatra) and one in JavaScript (with NodeJS). We also have plans for versions in Python, Lua and PHP.

blog comments powered by Disqus