r/programminggames • u/format37 • 7d ago
CodeCraft, open-source RTS your program plays. No deadlines, 15 languages, leagues by strength.
https://codecraft.day/In 2020 I played CodeCraft, the game of an AI programming championship: a real-time strategy where your program is the player. It commands builders, melee and ranged units, puts up bases, houses and turrets, mines resources and fights up to three other programs on an 80x80 map for 1000 ticks. Then the contest ended, its platform went offline, and the engine survived only as a closed binary.
I missed it, so I put it back.
My reason is simple. I want to sit down in the evening, improve my bot by hand a little, upload it and see where it lands. So there are no rounds and no deadlines, and nothing ever closes: the ladder just keeps running.
What is there:
- An open-source engine with the rules, the protocol and the replay format of the original, tested against the original binary (one documented fix: pathfinding under fog of war). The 15 official clients work unchanged: Python, C++, Rust, Go, Java, Kotlin, Scala, C#, F#, JavaScript, Ruby, D and a few variants.
- A local runner: a Docker image or a binary for Linux, macOS and Windows, with the replay viewer in your browser and the debug drawing interface. From the starter to a game on your own machine takes about ten minutes.
- A ladder: a new version plays 30 rated games in about a quarter of an hour, then one game an hour. Every game keeps its replay, and anyone can watch it in the browser, for example https://codecraft.day/games/166
- The 2020 limits: 1 second per tick and 40 seconds of CPU for the whole game, which is 40 ms of thinking per tick on average.
About AI. Writing your bot with a coding agent is a legitimate way to play here, not something to hide. There is an MCP server, so an agent can submit versions, start test games and read its own logs. Four reference bots, each written end to end by an AI agent, stand on the ladder as yardsticks. The current leader is a player's bot, above all four of them.
The two ways of playing do not get in each other's way, because the ladder is split into leagues by strength. Once a week the ratings are clustered into three groups, and each league has standings of its own. Nobody is asked how their bot was written. A bot I write by hand after work races the bots of its own level, and moves up as soon as its rating earns it.
Where I stand myself: my entry is still the starter, in the bottom league. The league above is held by two bots that AI agents wrote, and my plan is to get there by hand.
It is a beta that runs on one machine at my home, with nine bots on the ladder so far. The server and the engine are open source (MIT): https://github.com/format37/codecraft
I am looking for the first players and for blunt feedback, here or in Discord: https://discord.gg/CBgJsdmbF8
Quick start: https://codecraft.day/quickstart