Engine & online play
Topoi
An abstract strategy board game, played online against friends or against a computer opponent built on a custom C++ engine.
- Type
- Game engine & web app
- Built with
- C++, Python, Flask, Socket.IO
- Features
- Bots, online matches, rematches
- Live at
- bwian.org/games/topoi
The brief
An original abstract strategy game needed a home online: a fast, correct rules engine, opponents worth playing against, and a way to send a friend a link and start a match.
What we built
The rules engine is written in C++ and exposed to Python through native bindings, so the web server calls straight into compiled code. Two kinds of computer opponent sit on top of it: an alpha-beta minimax search with a positional evaluation, and a Monte Carlo tree search bot. Search depth scales with the chosen difficulty.
A Flask web app handles anonymous sessions, game records and rematches, with live moves sent over WebSockets.
Under the hood
- CMake build of the engine with Python bindings, packaged into the app’s container.
- SQLite for players, games and rematch offers, with migrations.
- Deployed as a separate service behind the main web server.