The Athena Crisis AI is a more conventional video game AI - based on math, algorithms and heuristics - instead of neural networks (LLMs are currently extremely slow and poor players of most turn-based strategy games). I never built a video game AI before, and I also didn’t have any idea on how to actually build such an AI at first! I looked at a few tutorials but I’m a learning by doing kind of guy, and concluded I had to just write the code.
I based the Athena Crisis AI on three main algorithms: The existing pathfinding algorithms used in the game, k-means clustering, and greedy action selection. I modeled the heuristics roughly after how I would play Athena Crisis, and picked a completely stateless model for the AI: The AI completely rethinks everything after taking a single deterministic action. A deterministic AI is generally easier to test, and players preferred it too as they could optimize their strategies in games against the AI. The only downside is that it makes the gameplay slightly more boring, so while the goal is for the AI to be mostly deterministic, it does make a few intentionally limited random decisions.
The initial version of the AI took about 2-3 seconds to calculate all the actions for a single turn. The animations for such a turn would take 10-20 seconds, so it would have been completely acceptable to generate the first few actions, animate them, and continue computing the AI’s actions in parallel with the animations. Instead, I optimized the AI to be at least 10x faster – calculating all actions for the entire turn on the server while the user is still seeing the turn-transition animation.
I kept optimizing the AI based on player feedback for months. When Athena Crisis launched the player base, much to my surprise, concluded it was the best AI in its genre – even though I never built an AI before!