The Manhattan Project is free and open source!

Around early 2013, I started work on the official computer adaptation of the hit boardgame, The Manhattan Project. The final game shipped on iOS, Android, and PC later that year. Over a decade old now, the game is no longer available on mobile platforms, however, I have since made the game freely available on PC, and also released the source code. You can read more about the game itself and download everything at its main site.


Some technical details

Although outwardly the game is somewhat modest by today’s standards, what’s going under the hood is fairly sophisticated. I had never adapted a board game before, and doing so required a pretty different approach than I was used to with other games. In the end everything came together quite nicely, and I’m proud of many of the solutions I landed on. Here are some of the things I’m particularly happy with:

  • I implemented the AI using Monte Carlo Tree Search. Which was somewhat new at the time, and had recently made breakthroughs in computer Go. MCTS is still used today in unsupervised learning neural nets such as those created at Deep Mind. So beyond this game, it’s just a good algorithm to know.

  • I went with a MVC (model-view-controller) architecture, which is pretty much an ideal match for board games, with their rigid, discrete, and clearly defined state.

  • I used message passing for move inputs and anything that could alter the game state. This paired nicely with MVC, and it greatly simplified some important features (see below).

  • I implemented multiplayer over http using libcurl. Because of the message passing architecture, a networked game and a local game functioned identically, except for the isolated bit of code responsible for sending/receiving messages. Which is really quite satisfying from an software engineering perspective - a whole game was networked with only a few isolated function changes.

  • The Undo implementation is simple and clean. I actually feared implementing this, but it ended up being quite simple due to the message passing (just remove the last message from the message stack) and the MVC architecture (just let the game render the adjusted game state as it normally would).

  • The game Save and Restore functionality is similarly clean and simple for the same reasons as the Undo feature. To save the game, I just save the message stack. And to restore a game, I just replay the whole game internally from the message stack, message by message until reaching the most recent turn (which completes in milliseconds). Then I let the MVC “View” show the game state.



Screen shots