Open Sourcing “Space Battle 2” – an RTS Game Ready for Your AI Player

With over 50 college juniors and seniors taking part, Atomic Games 2017 was a great success. This year’s participants built AIs to play a custom RTS written in-house here at AO. Since we had so much fun building and playing the game, we decided to open-source it: Space Battle 2: Resource Collectors.

The Game

SB2RC is a one-on-one game where each team tries to gather more resources than the other team before time runs out. Of course, you can also win by destroying the enemy base and ridding yourself of any competition.

Each team starts with a handful of workers at their base. They must explore to find resources and bring them back to their base. Players spend their precious resources to build additional workers, scouts, or tanks. An effective AI needs to keep track of the map, the resources, enemies, and an overall strategy to be successful.

How to Play

Each AI communicates to the game UI/server via a TCP socket and a custom JSON protocol. Although the genre is called real-time strategy, most RTS games are actually turn-based (with very short turns). On each turn, an AI decides what, if any, commands to issue and receives a diff of the game state. Each turn lasts 200 ms.

The project README documents the full protocol, but the command set is very simple: CREATE, MOVE, GATHER, MELEE, SHOOT, IDENTIFY.

Potential Uses

I’m sure we’ll use a fork of this game again for an Atomic Games in the future, but we also wanted to open it up to everyone. SB2RC would make a great project for college students or computing clubs. Check it out, and leave a comment or GitHub issue if you’d like additional help getting set up.