An AI agent can do more than press buttons in a game while a language model suggests its next move. It can also write a program that keeps playing on its own. The Coding4Games benchmark tests whether today’s coding agents can turn what they observe in a game into a working strategy. The results show that they do better than conventional game-playing AI agents, but still fall well short of human performance.
The big idea
Coding4Games evaluates the finished program an agent creates after exploring a game, not the language model’s individual moves. The agent learns the rules through the regular game interface, writes and tests code, and then its program faces independent trials with no language model involved.
🎮 Games require agents to interpret images, choose a strategy, and control a character precisely—all at once.
🧪 Development and final testing are separate, so agents can’t tune their programs to the test scenarios.
📊 The benchmark measures both in-game scores and how agents use feedback to correct failed attempts.
⚠️ The main challenge isn’t spotting a mistake. It’s changing the program in a way that actually improves its play.
How the benchmark works
Coding4Games brings together 15 modern games behind a shared interface and evaluates programs that agents write to control them with a keyboard and mouse. First, the agent develops its program in a sandbox. Then the program is frozen and run in a separate game environment.
Coding4Games setup: a shared interface connects the games to a development sandbox and an independent test environment for frozen programs.
The system has three main components.
🕹️ The game server runs episodes, sends screenshots, and receives in-game actions. It also tracks game time and calculates scores, so agents can’t alter the test rules or scoring.
🧰 The development sandbox lets agents write, run, and revise code while interacting with the game over and over. They can’t access the game’s internal files or scoring system.
🧊 Independent testing runs the chosen program in a fresh environment. The code can no longer be changed, and there are no language-model calls. Repeated runs show how much the result depends on randomness.
The games fall into five categories: combat, strategy, sports, movement and precision, and tasks involving several actions in sequence. Each task specifies a starting situation, a goal, and an interaction budget. The score depends on the game: it might measure damage dealt to a boss, distance traveled, levels reached, or orders completed.
How it works: an agent prepares a program for a racing game
Suppose an agent needs to complete a section of track in Forza Horizon 5. It sees the game through the shared interface and must build a program that can later drive the car on its own.
👀 First, the agent explores the game. It starts an episode and receives screenshots. From these, it must figure out where the road is, how the car responds to turns, and what causes it to leave the track. One risk is mistaking a visual cue for a reliable rule.
💻 Then, the agent writes a program. It might follow the visible route or adjust steering based on the car’s position. A simple approach may fail to account for changes in the track; a more complex one may be poorly tuned.
🔁 The program makes a trial run. The server carries out its inputs and returns a score. The agent compares the result with its goal and decides what to change. But the test might show that the car left the road without explaining why.
🧊 The agent chooses a version for final testing. That version is frozen and run several times in a new environment. If it relied on a coincidental visual cue or a lucky starting position, its performance may drop sharply.
The paper gives a telling example: a program with more complex controls in Forza Horizon 5 scored an average of 443.7, while another agent’s simple route-following algorithm scored 645.7. More complex code doesn’t automatically mean better tuning or better results.
How it’s evaluated
The authors compare 12 coding agents with two game-playing AI agents that control games through the interface, as well as with a human player. To keep the comparison fair, the server controls the tasks and conditions. When interface-based agents are tested, the game is paused while the model performs its computations. Frozen programs run without language-model calls.
The main metric is the average score across repeated test episodes. Scores are normalized from 0 to 100 within each game so results across different games can be compared. This gives an overall picture, though the average doesn’t mean the games are equally difficult.
The benchmark also tracks how agents develop their programs:
🔎 Game-state awareness measures whether a program relies only on fixed actions and counters or uses game signals, state, memory, and recovery from errors.
🛠️ Edit depth distinguishes between minor parameter tuning, local fixes, and a change in strategy.
🧩 Problem-fixing score checks whether an agent can reproduce a problem in the next test and resolve it. This helps distinguish between noticing an error and actually fixing it.
Each model-game combination is tested in three independent episodes. This reduces the influence of a single random outcome, but doesn’t eliminate it entirely.
The numbers
The best programs for individual games look strong compared with game-playing AI agents, but that doesn’t mean any one agent can play every game equally well. Humans remain ahead in most games, and program quality depends on the particular combination of model and game.
What it means
Coding4Games tests whether an agent can leave behind an executable result: a program that can be run again, inspected, and evaluated without a language model. In some games, this approach already outperforms control through a graphical interface. And during testing, the program doesn’t need to spend model compute on every move.
Agents often spot a failure but don’t turn it into a lasting improvement. A program might react to a simple cue—for example, detect a crash—but still choose actions on a fixed schedule without accounting for what’s happening on the track. A strategy that worked in a trial run may not transfer to a new situation.
The results are also limited by the set of 15 games, a single human benchmark, and three test episodes per game and model. The next step is to teach agents to diagnose why their programs failed and change their strategies so they work across different game situations, not just familiar scenarios.
In practice
Teams building game bots, testing game controls, or evaluating coding AI can use Coding4Games as a testbed. An agent explores a game through ordinary screenshots and button presses, writes a program, and then has it tested separately, with no language-model calls during play. This helps teams assess whether a bot can operate autonomously and see how it corrects errors based on test results. The paper describes 15 games and a shared interface for launching, observing, and controlling them. It mentions a project page, but the provided text doesn’t confirm that code or data are available. It’s still too early to use this approach in commercial games: humans outperformed agents in most games, and results varied widely across games and models.
Related work
Coding4Games explores how coding agents can turn experience interacting with a game into an autonomous program—one that plays using images and standard controls, without language-model calls at runtime. GameAnything has a similar development-and-testing loop, but it generates new game worlds from multimodal inspirations rather than programs for completing existing modern games. Recursive Game Creator takes a different approach: its agent improves a prototype by acting as a designer, builder, player, and reviewer to create an engaging experience. Coding4Games evaluates its approach across 15 games, with a separate test of each frozen program. The best program for each game beat the strongest GUI-based approach in 13 games and tied in one. For a related direction, see GameCraft-Bench, which also evaluates the creation of executable games and interaction with them, but uses a real game engine.
Read next
WeVisForensics: How an AI Agent Finds Generated Videos
Game2Player: How AI Agents Train in Games
How to teach an AI agent to develop an app from scratch
InclusionMed: Which AI should I choose for medical tasks?
Why Is It Difficult for an AI Agent to Act in the Real World?
WorldFoundry: How can you distinguish video generation from world
How AI Can Enhance an Individual’s Intelligence
FrontierPhysics: Let’s see whether AI agents can make discoveries
How AI Chooses the Right Model for Each Task
CaPtain: How to control a robot using a small AI model
WorkFactory: Hundreds of thousands of professional tasks helped train
How AI Agents Learn General Skills Across Different Tasks
AI reviews in simple way
Every day we read fresh AI papers and retell the essentials in plain human language — no hype, no fluff. If you want to see where AI agents are heading before everyone else, subscribe.
New reviews — every day
Follow on X