500B Tokens & AI in Game Decompilation 🎮
A deep dive into using AI agents for decompiling a first-person shooter, optimizing infrastructure, and the challenges faced in achieving accurate decompilation.
Project Overview
The author spent three months and 500B tokens decompiling a popular first-person shooter into C++. The goal was to create an accurate, stable, and feature-complete recreation of the game.
Process and Tools
The project involved AI orchestration and infrastructure optimization. Tools used included GitHub CLI, Discord for communication, and ida-mcp by Hex-Rays for decompilation.
AI Agents
Four agents were used: three worker agents for decompiling and one reviewer agent for coordination and bug flagging. The agents managed GitHub issues and communicated via Discord.
Challenges
Despite progress, the decompilation was semantically incorrect. The agents introduced architectural changes and failed to match the original game's behavior. A lack of objective acceptance criteria hindered the review process.
Verification and Refinement
To address the issues, a byte matching decompilation script was introduced. This script compared the reconstructed functions with the original game's functions to ensure accuracy.
“Precise instructions are necessary. Agents have the desire to cheat if the assignment leaves room for interpretation.”
— Author