archived / shipped / access: artifacts
CodinGame
A collection of competitive game AIs where the real fun was reading the evolving metagame and finding weaknesses in other bots.
topics
tech
Context
This was one of the competitive avenues I participated in over the years. I stumbled upon CodinGame in 2015 and was fascinated by how it managed to gamify the oftentimes boring and dull coding exercises. The site provided nice graphics for the algorithm puzzles, with the execution animation suddenly turning textbook breadth-first search into something tangible. I worked through several of the exercises swiftly thanks to my CompSci education.
What caught my interest and awakened my competitive spirit was that competitions were held several times a year, allowing me to directly compare my code and its efficiency with those of other programmers. So I took part in several of them just to try to achieve high ranks.
What I Built
I built several real-time game AIs under strict execution and submission constraints for various competitions. The solutions were implemented in Java since that was my usual language at that time.
I applied various concepts I mostly already knew to solve the competition problems. To score high, I needed to add a quirk, custom optimization, or smart heuristic to try to get ahead of the pack. To name some of the approaches, there were genetic algorithms (with manual object pooling for improved compute efficiency); sophisticated multi-agent racing tactics with role-based behavior, collision prediction, shield logic, and checkpoint guarding; random genome search for the highest-scoring combo pattern; BFS pathfinding with custom game simulation and a state machine; and multi-agent scouting and unit movement interception.
I scored several top-100 finishes (usually ~2,500 ranked entries) โ Code of the Rings (Brainfuck-like pattern optimization), Code vs Zombies (maximizing combo kills vs moving enemies), Coders Strike Back (multiplayer multi-agent racing game), and Smash the Code (multiplayer Tetris-like game with colored bricks).
Interesting Problems
Improving the game AI logic beyond the basic solution
Most of the puzzles and contests had a pretty straightforward baseline solution for people with an IT background. The magic happened in multiplayer game contests where I had to start putting smart heuristics and strategies into the agents to actually win against other solutions. This felt really similar to what I liked about playing RTS games, as there was always a layer of metagaming and adjusting to the other players.
The CodinGame multiplayer contests usually spanned a whole week, and I was quite keen to regularly check the replays of my agents and those of others to try to identify the logic patterns and how they worked against other patterns. I especially liked trying to see the metagame, or commonly applied patterns in other solutions, and trying to abuse them. As with my StarCraft II semi-pro career, I wasn't interested in seeking some sort of globally optimal play. I very much wanted to take the route of identifying exact weaknesses of the player cohort I frequently faced and adjusting the logic based on these local findings.
This meant I usually submitted several slightly improved or adjusted solutions each day and proceeded to monitor whether they improved my overall rank and what new weaknesses emerged.
Related blog posts
AI contest notes - Coders Strike Back โ daily short journal for my competition run