Hugging Face Papers ↗ · 2026-11-24
Coding4Games: Can Modern Coding Agents Play Modern Video Games?
Media reports Hugging Face Papers Source language: Chinese
The paper introduces Coding4Games, a benchmark testing coding agents' ability to develop standalone game-playing programs for 15 modern AAA games, outperforming GUI…
Full text
1]Tencent ARC Lab 2]GVC Lab, Great Bay University \affiliationbreak3]Beijing Jiaotong University 4]Nanjing University \contribution[†]Corresponding author \adobedata[Project Page]https://coding4game.github.io
Coding4Games: Can Modern Coding Agents Play Modern Video Games?
Shifang Zhao Haoyu Wang Yuyang Yin Dong Chen Xingyilang Yin Yunkang Tao Honghao Chen Guangzhi Wang Yiran Wang Junfu Pu Cheng Cheng Xiaodong Cun Ying Shan Affiliation: [ Affiliation: [ Affiliation: [ Affiliation: [
Abstract
Games, especially modern AAA games, challenge language models to perceive complex scenes, control actions, and make decisions over long horizons. Existing game benchmarks primarily test language models as computer-use agents that query a language model throughout play, incurring repeated inference cost and, in real-time games, acting while the environment continues to evolve. We ask whether coding agents can learn from game interaction to develop standalone game-playing programs that run without language-model inference. We thus introduce Coding4Games, a benchmark for evaluating whether coding agents can develop standalone programs that play modern games through visual observations and standard game inputs. Coding4Games has three defining features: 1) Diverse Modern Games, covering 15 games with diverse visual, strategic, and control demands; 2) Development–Test Separation, in which a coding agent uses a sandbox and the standard player interface to iteratively develop a program, after which the selected program is frozen and independently tested without language-model inference; and 3) Outcome and Process Evaluation, which measures not only game performance and reliability but also how agents use feedback, revise programs, and resolve problems during development. Across 15 games, the best program per game outscores the strongest GUI baseline on 13 and ties it on one. The human player outscores all agents on 10 games. We additionally examine the effects of development budgets. Coding4Games evaluates whether coding agents can turn their understanding of complex interactive environments into programs that work reliably on their own.
Figure 1: From playing games directly to building standalone game-playing programs. (a) In prior computer-use benchmarks, agents play directly through the GUI, querying a language model to determine each action. (b) Coding4Games introduces a different paradigm: a coding agent interacts with the standard player interface to develop a game-playing program. Once finished, the program is frozen and plays autonomously without language-model inference. (c) Average normalized performance of twelve coding agents, compared with human and GUI-agent baselines across 15 games.
1 Introduction
Coding agents can autonomously tackle a wide range of software tasks (Jimenez et al., 2024; Yang et al., 2024; Merrill et al., 2026; OpenAI, 2025; Anthropic, 2025). Yet existing evaluations primarily focus on conventional software tasks, leaving their ability to develop programs for complex, dynamic environments less explored. Modern video games present such challenges: their rich visual interfaces, large state and action spaces, and real-time dynamics require programs that integrate perception, strategic decision-making, and precise control. Developing such programs requires agents to understand game rules and iteratively debug behavior through interaction, making modern games a demanding testbed for evaluating coding agents.
However, existing game benchmarks largely evaluate direct gameplay rather than the development of standalone game-playing programs. They typically adopt a computer-use setting,i.e., a GUI Agent, in which a language model repeatedly observes the game and selects the next action (Fig. 1(a)) (Paglieri et al., 2025; Zhang et al., 2025; Park et al., 2026; Ouyang et al., 2026; Zhang et al., 2026b). This requires repeated model inference during play; in real-time games, the environment may continue to evolve during model inferences (Zhang et al., 2025; Ouyang et al., 2026). A complementary line of work studies API-based game-playing programs, which receive structured game states and issue actions through programmatic interfaces. CodeClash (Yang et al., 2026) and ProxyWar (Peng et al., 2026) ask coding agents to write and iteratively revise bots that compete in game arenas, and related work optimizes game policies or world models represented as code (Kuang et al., 2025; Bachrach et al., 2025; Lehrach et al., 2026). However, game-specific APIs expose structured state and action abstractions that bypass the perception and low-level control required in real games, limiting applicability to and transfer across modern titles (Tab. 1).
Table 1: Comparison of game benchmarks. Coding4Games evaluates coding agents that develop standalone programs for modern video games, with low-level GUI inputs and stepped execution throughout development and evaluation. Target: evaluation target; Setting: game setting; NN: number of games; Exec.: gameplay executor; Vis.: visual input; Actions: action interface; Mode: execution mode; Reset: episode reset; Test: separate test.
Benchmark Target Setting NN Exec. Vis. Actions Mode Reset Test
BALROG (Paglieri et al., 2025) Online play Text / grid 6 LM ✓ Semantic Stepped ✓ ✗
VideoGameBench (Zhang et al., 2025) Online play Retro 10 LM ✓ GUI Both NR ✗
Orak (Park et al., 2026) Online play Mixed 12 LM ✓ Game API NR ✓ ✗
GameVerse (Zhang et al., 2026b) Video reflection Mixed 15 LM ✓ GUI / Sem. Subset NR ✗
GameWorld (Ouyang et al., 2026) Online play Web 34 LM ✓ GUI / Sem. Both ✓ ✗
CodeClash (Yang et al., 2026) Code evolution Arenas 6 Program ✗ Program API N/A ✓ ✗
ProxyWar (Peng et al., 2026) Code generation Arenas 9 Program ✗ Program API N/A ✓ ✓
Coding4Games (ours) Coding agents Modern 15 Program ✓ GUI Live ✓ ✓
We bring these two lines of work together and ask: Can a general coding agent understand a modern game through visual interaction and write a program that plays it using only standard game controls, without access to game-specific APIs? We define a game-playing program as an executable program built with general-purpose libraries, whose logic maps visual observations to control actions without language-model inference during play, as shown in Fig. 1 (b). Once developed, such a program runs without further language-model calls, while its behavior can be inspected, rerun, and systematically tested. This setting evaluates whether coding agents can translate game understanding into reliable executable behavior.
To answer this question, we introduce Coding4Games, a benchmark with three defining features. 1) Diverse Modern Games. Coding4Games evaluates 15 games spanning diverse visual, strategic, and control demands, rather than restricting evaluation to classic games with comparatively simple visual interfaces and control schemes. It covers games across five categories: Combat & Action Timing, 3D Sports & Precision Control, Movement & Timing, Strategy & Resource Planning, and Multi-step Task Execution. 2) Development–Test Separation. During the Development stage, coding agents explore games, develop programs, and self-test in a persistent sandbox, interacting with games through a gym-like interface provided by the game server. During the Test stage, the selected program is frozen and evaluated in a fresh environment without language-model inference, testing whether it can play reliably on its own. 3) Outcome and Process Evaluation. Beyond game performance, we assess how coding agents use execution feedback, revise programs, and test whether revisions resolve targeted problems. We further examine the correlation between the scores achieved in the coding agent and GUI agent settings using the same model.
Our experiments with 12 coding agents demonstrate the potential to turn game interaction into standalone programs. The best program per game outscores the strongest GUI baseline on 13 of 15 games and ties it on one. The human player outscores all agents in 10 games, while the best program per game beats the human in three and ties in two. Process analysis further reveals that self-testing often fails to translate feedback into effective strategy revisions. Together, these findings highlight the promise of code as a reusable representation of interactive behavior, while identifying strategy discovery and reliable improvement through interaction as central challenges for coding agents.
In summary, our contributions are as follows:
•
We formulate game playing by coding agents as the development of standalone programs through the standard player interface, with a protocol that separates development from independent testing without language-model inference.
•
We build Coding4Games, an extensible, gym-like environment that brings 15 modern games with diverse perception, control, and planning demands under a standard interface, with standardized task initialization and game-specific scoring.
•
We evaluate 12 coding agents through game performance and process measures of program grounding, modification depth, and problem resolution, revealing a persistent gap between identifying failures through self-testing and translating feedback into effective strategy.
2 Related work
Game Agents. Deep reinforcement learning and self-play have enabled strong game-playing policies in Atari, board games, and real-time strategy (Mnih et al., 2013; Silver et al., 2018; Vinyals et al., 2019), while learning from gameplay demonstrations supports instruction-conditioned and generalist policies (Baker et al., 2022; SIMA Team et al., 2024; Magne et al., 2026). Language-model agents interleave reasoning and action, revise plans after execution failures, and retain experience in memory (Yao et al., 2023; Wang et al., 2023; Wang et al., 2025). Systems such as Cradle and Voyager further organize behavior into executable skills that agents can compose and reuse (Tan et al., 2025; Wang et al., 2024). The approaches closest to our setting use language models to revise Atari policies from execution traces, generate best-response programs against Checkers bots, or synthesize executable simulators for classical planning (Kuang et al., 2025; Bachrach et al., 2025; Lehrach et al., 2026). These approaches separate program construction from execution, allowing the resulting programs to run without per-action language-model inference. Building on this separation, Coding4Games independently tests the standalone game-playing programs produced by general coding agents.
Benchmarks for Coding and Game Agents. Coding benchmarks differ in the scope of the artifact and the environment in which it is evaluated: programs satisfying input–output requirements (Chen et al., 2021; Austin et al., 2021; Hendrycks et al., 2021; Liu et al., 2023; Jain et al., 2025), repository-level issue resolution and the interfaces through which agents edit and execute code (Jimenez et al., 2024; Yang et al., 2024; Merrill et al., 2026), and interaction in heterogeneous environments, websites, desktops, and embodied control (Liu et al., 2024; Zhou et al., 2024; Xie et al., 2024; Fu et al., 2026). For games, From Code to Play, ProxyWar, and CodeClash are the closest precedents, evaluating program search, testing and repair, and repeated codebase editing under competition (Eberhardinger et al., 2025; Peng et al., 2026; Yang et al., 2026). Coding agents also develop the games themselves, with methods for generation from specifications (Jiang et al., 2026; Zhou et al., 2026b) and refinement through playtesting (Huang et al., 2026; Chen et al., 2026; Wu et al., 2026), benchmarks for development (Chi et al., 2026; Luo et al., 2026; Zhang et al., 2026d; Lee et al., 2026; Dong et al., 2026) and replication (Qiao et al., 2026), and generated environments for evaluating and training game agents (Aggarwal and Welleck, 2026; Liu et al., 2026). Game agent evaluation instead builds on established platforms (Bellemare et al., 2013; Kempka et al., 2016; Guss et al., 2019; Côté et al., 2019; Hausknecht et al., 2020) and recent language-model suites (Paglieri et al., 2025; Hu et al., 2026; Park et al., 2026), whose conditions are essential to interpreting reported performance: real-time versus paused execution (Zhang et al., 2025), state-based verification (Ouyang et al., 2026; Zhang et al., 2026c) versus model-judged milestones (Zhang et al., 2026b), and improvement across attempts versus transfer to held-out variants (Lin et al., 2026). Coding4Games combines autonomous program development with independent testing of frozen programs, measuring performance, reliability, and cost under matched action and timing conditions.
Self-Improving Agents. Self-improvement methods differ in what changes and what persists across tasks: program libraries learned together with a search-guiding model (Ellis et al., 2023), parameters updated from accepted self-generated rationales (Zelikman et al., 2022), outputs or verbal feedback refined in context (Madaan et al., 2023; Shinn et al., 2023), and reusable tools and skills accumulated with fixed language-model weights (Schick et al., 2023; Cai et al., 2024; Zhou et al., 2026a). Closer to our setting, one line searches over executable policies and agent implementations (Kumar et al., 2026; Hu et al., 2025), and recursive variants additionally modify the improvement machinery itself (Zelikman et al., 2024; Yin et al., 2025; Zhang et al., 2026a)—program-level modification that should be distinguished from changing the underlying model. Coding4Games evaluates the reliability and cost of the resulting game-playing programs without prescribing a self-improvement algorithm.
Table 2: Game categories. The working suite groups 15 games by their principal interaction demands. Task objectives and scoring criteria appear in the Game Tasks and Scoring section of the supplementary material.
Category Games
Combat & Action Timing Black Myth: Wukong (BMW); Sekiro: Shadows Die Twice (SEK); The King of Fighters ’98 (KOF98)
Strategy & Resource Planning Balatro (BAL); Slay the Spire (StS); Kingdom Rush 5: Alliance (KR5)
3D Sports & Precision Control Forza Horizon 5 (FH5); Riders Republic (RR); NBA 2K25 (NBA25)
Movement & Timing TrackMania Nations Forever (TM); Brotato (BRO); BattleBlock Theater (BBT)
Multi-step Task Execution Overcooked! 2 (OC2); Aimlab (AIM); Palworld (PAL)
3 Coding4Games Benchmark
Coding4Games investigates whether modern coding agents can play video games by developing standalone executable programs. For each evaluation task, we specify a game, an objective, a starting scenario, and an interaction budget. Evaluating this capability requires both an environment for developing programs through game interaction and a protocol for testing the resulting programs independently. We therefore introduce a framework that connects a sandboxed development environment to a gym-like game server across a diverse set of games while keeping program development separate from program evaluation. Below, we present the evaluation framework (Sec. 3.1), the games and their tasks (Sec. 3.2), and the measures used to score them (Sec. 3.3).
3.1 Evaluation framework
As shown in Fig. 2, the framework makes heterogeneous games accessible to coding agents and evaluates the programs they produce under independent, consistent conditions. Given the input prompt of task description, API documentation, and setting description, the coding agent combines a game server for standardized interaction, a Development stage that supports autonomous software development, and an isolated Test stage for evaluating frozen programs. Below, we introduce the main components of the evaluation framework.
Game Server.
Games differ in how they start, expose observations, and accept inputs, making them difficult to access consistently from a coding environment. The game server wraps each task with a shared, gym-like interface for starting episodes, returning game screenshots, and applying gameplay inputs. It also tracks elapsed game tics and computes task-specific scores from gameplay evidence independently of the coding agent. Keeping initialization, game-tic accounting, and scoring under host control separates gameplay from measurement and supports fair, consistent evaluation across submitted programs.

Figure 2: Evaluation framework. The game server provides a common interface to heterogeneous games. Coding agents develop and select programs in a sandbox; the frozen programs are then evaluated through independent rollouts with host-controlled initialization, budgets, and scoring.
Development Stage.
The Development stage gives a coding agent one persistent sandbox for each development run, in which it can use a real coding CLI to write, execute, and debug programs (OpenAI, 2025; Anthropic, 2025). Keeping this sandbox across iterations preserves the agent’s tools and intermediate work and reduces variation from changes in the development environment. The sandbox is configured to block direct access to game implementation files and the host-side scorer; game observation and control instead pass through the game server’s MCP interface (Anthropic, 2024). The agent can repeatedly interact with the game, test and revise candidates, and select a program artifact, PselP_{\mathrm{sel}}; it may influence game outcomes through normal gameplay inputs, not by editing game files or scores. The host separately records model-token use and game tics, enforcing a token budget, a cumulative game-tic budget, and a per-rollout game-tic limit that bound further interaction and determine when development must stop. Agent and game interactions, candidate tests, and resource use are logged as an auditable development trajectory. Together, the stable sandbox and recorded trajectory support a reproducible experimental procedure without requiring identical gameplay outcomes.
Test Stage.
The Test stage evaluates the selected frozen program in a fresh environment, separate from development (Jimenez et al., 2024; Peng et al., 2026). The program runs without model inference or public network access; its code stays fixed, although its internal state can change during play. Each test rollout follows the same per-rollout game-tic limit as development. Before each rollout, the host prepares the designated scenario using recorded initialization actions. After the rollout, the host-side scorer computes a task-specific score from gameplay evidence. Repeated rollouts estimate the program’s performance and variability under the same task conditions.
3.2 Games and Tasks
Table 2 lists the games and their associated capability requirements for game-play program. We select games to examine whether coding agents can use interaction to develop standalone game-playing programs under diverse control and planning demands. Our proposed suite comprises 15 tasks, one per game, across five categories: Combat & Action Timing, Strategy & Resource Planning, 3D Sports & Precision Control, Movement & Timing, and Multi-step Task Execution.
These tasks require different combinations of responding to game feedback, timing precise inputs, tracking resources and persistent state, and coordinating actions across stages. Each task defines a starting scenario, an objective, and an interaction budget to support repeated evaluation under consistent conditions. Each task also defines a quantitative episode score that the host computes from recorded gameplay evidence, independently of the agent’s self-assessment. Following prior work (Ouyang et al., 2026; Zhang et al., 2026b), these task-specific scores capture partial progress beyond binary success or failure. Depending on the objective, they measure boss-health depletion, waves or floors reached, distance traveled, or orders completed, with bonuses and penalties for outcomes such as victory or wasted resources. During development, the host returns the score after each episode to guide program comparison and revision. During Test, the same scoring rule measures the performance of the selected frozen program across repeated episodes.
Table 3: Main results on Coding4Games. We compare coding agents, GUI agents, and a human player using mean game scores, normalized to 0–100 within each game across all available entries. Avg. is the arithmetic mean of the 15 normalized game scores. The top 3 rows report each game’s cumulative game-tic budget, per-rollout game-tic limit, and token budget. Game names follow Tab. 2; CC and GC denote Claude Code and Gemini CLI.
Model Harness BAL FH5 StS BMW BRO NBA25 RR KOF98 TM KR5 OC2 SEK AIM PAL BBT Avg. ↑\uparrow Rank
Budget (all) 10k 10k 10k 10k 10k 10k 10k 10k 10k 20k 10k 10k 1k 10k 10k
Budget (rollout) 1k 1k 1k 1k 1k 1k 1k 1k 1k 10k 1k 5k 320 1.2k 3k
Budget (token) 20M 20M 20M 20M 20M 20M 20M 10M 1M 10M 10M 50M 5M 10M 10M
Human Player — 100.0 99.5 100.0 100.0 100.0 100.0 77.7 100.0 100.0 100.0 100.0 100.0 80.2 100.0 100.0 97.2 —
GUI Agent
GPT-5.6-Sol Codex 4.8 70.7 8.3 29.5 13.7 80.7 5.4 32.8 16.3 1.6 0.0 11.2 22.0 85.1 14.0 26.4 —
Claude-Sonnet-5 CC 4.0 100.0 66.8 12.3 93.3 38.7 18.6 8.2 0.0 1.8 0.0 0.0 24.9 30.0 3.7 26.8 —
Coding Agent
Closed
GPT-6-Astra Codex 100.0 100.0 100.0 37.8 96.0 45.2 26.2 80.9 51.6 27.3 0.0 1.9 64.4 50.4 7.0 52.6
GPT-5.6-Sol Codex 14.8 10.0 0.0 39.6 5.3 58.1 47.3 60.1 0.9 74.2 3.0 13.7 41.1 15.0 7.0 26.0 6
GPT-5.6-Terra Codex 15.4 49.1 0.0 73.2 37.1 0.0 53.1 54.6 1.9 28.9 0.0 7.2 52.4 6.5 7.0 25.8 7
Claude-Opus-5.5 CC 50.8 84.0 42.1 16.6 84.3 77.4 22.5 37.0 39.8 25.8 1.5 10.3 100.0 53.9 14.1 44.0
Claude-Opus-5 CC 29.4 32.4 57.9 38.1 89.1 58.1 11.1 16.4 0.8 28.3 0.0 2.9 94.7 68.0 37.7 37.7
Claude-Sonnet-5 CC 9.0 35.9 0.0 12.1 0.7 38.7 0.0 62.8 13.5 15.4 0.0 2.7 45.3 24.3 7.0 17.8 8
Gemini-3.8-Flash GC 18.8 34.2 42.2 3.7 30.3 22.6 17.9 98.4 18.1 27.3 1.5 10.0 41.6 89.0 7.0 30.8 5
Qwen3.8-Flash Codex 0.0 20.8 0.0 65.4 95.1 32.3 100.0 19.1 20.6 19.6 0.0 5.5 51.3 41.1 3.7 31.6 4
Open
Qwen3.8-27B Codex 16.7 10.0 21.0 0.0 1.2 58.1 14.1 5.5 4.6 28.9 0.0 0.0 22.6 5.1 0.0 12.5 11
GLM-5.3-Flash Codex 14.5 19.0 0.0 5.1 1.3 71.0 1.3 0.0 34.0 0.0 7.4 1.6 40.6 0.0 0.0 13.1 10
DeepSeek-V4.1-Flash Codex 0.0 0.0 36.8 10.3 28.5 6.4 16.7 10.9 33.9 30.4 1.5 0.7 32.3 40.1 7.0 17.0 9
Kimi-K3 Codex 0.0 15.0 0.0 47.2 0.0 54.8 32.4 16.4 1.2 1.8 1.5 9.7 0.0 0.8 0.0 12.1 12
3.3 Evaluation measures
We design these measures to understand what coding agents produce from game interaction, how they develop it, and at what cost. Independent game scores show how well the selected program plays; the other measures examine whether it uses game state, how deeply the agent revises it, whether revisions address observed problems, and the resources required for development and deployment. Together, they distinguish programs with similar game scores but different decision mechanisms, development trajectories, and costs.
Game performance.
For each model–game pair, we evaluate the program selected during development in NN independent test episodes and use the mean episode score as its game performance:
s¯=1N∑k=1Nsk,\bar{s}=\frac{1}{N}\sum_{k=1}^{N}s_{k}, (1)
where sks_{k} is the score in test episode kk. Repeated testing reduces sensitivity to randomness in the game and variation in the program’s behavior, either of which can change the outcome of a single episode. We also report variation across episodes.
Dependence on game state.
We propose Final Grounding Level (FGL) to describe how the selected program uses game information to choose actions: G0, fixed actions; G1, actions based on time or counters; G2, reactions to simple observed signals; G3, decisions based on task-relevant game state; and G4, state-based decisions with memory, planning, and failure recovery. We use these levels to study how the agent encodes its understanding of the game in the program and turns that understanding into gameplay control.
Modification depth.
We propose Iterative Modification Score (IMS) to measure the depth of changes between successive self-tested program versions. Each change receives a rating did_{i} from 0 to 4: no change, parameter adjustment, local patch, component change, or strategy shift. For NN changes, IMS is the average rating scaled to 0–100:
IMS=1004N∑i=1Ndi.\mathrm{IMS}=\frac{100}{4N}\sum_{i=1}^{N}d_{i}. (2)
A higher value means deeper changes, not necessarily better results. We compare each tested score and resource use to see how performance evolves during development (Lin et al., 2026).
Problem resolution.
For each problem identified before a modification, we check whether the next self-test reaches a situation where that problem can be assessed. Across MM problem–modification pairs, let ej=1e_{j}=1 if pair jj receives such a test and 0 otherwise. Let rjr_{j} be 0 if the problem remains, 0.5 if partly resolved, and 1 if resolved. We measure how often modifications can be assessed (NER) and how fully the assessed problems are resolved (RS):
NER=∑j=1MejM,RS=∑j=1Mejrj∑j=1Mej.\mathrm{NER}=\frac{\sum_{j=1}^{M}e_{j}}{M},\qquad\mathrm{RS}=\frac{\sum_{j=1}^{M}e_{j}r_{j}}{\sum_{j=1}^{M}e_{j}}. (3)
NER is undefined when M=0M=0; RS is undefined if no pair receives a relevant test. Together they distinguish untested changes from observed problem resolution.
4 Experiments
Table 4: Process evaluation of coding agents. G0–G4 show the percentage of final programs at each grounding level. IMS, NER, and RS summarize the development process on a 0–100 scale. See Sec. 3.3 for metric definitions.
Table 5: GUI agents vs. programs. Per-model score gaps (programs minus GUI). Blue favors GUI agents, and orange favors programs. Categories follow Tab. 2.
Model G0 G1 G2 G3 G4 IMS NER RS Closed GPT-6-Astra 13.3 0.0 26.7 60.0 0.0 44.5 87.0 62.5 GPT-5.6-Sol 9.1 63.6 27.3 0.0 0.0 64.3 100.0 41.7 GPT-5.6-Terra 18.2 63.6 9.1 9.1 0.0 62.5 100.0 62.5 Claude-Opus-5.5 20.0 0.0 13.3 46.7 20.0 54.3 93.3 71.4 Claude-Opus-5 0.0 10.0 20.0 20.0 50.0 53.6 93.0 42.5 Claude-Sonnet-5 0.0 18.2 36.4 27.3 18.2 50.0 100.0 83.3 Gemini-3.8-flash 9.1 18.2 18.2 36.4 18.2 67.5 94.4 58.8 Qwen3.8-flash 20.0 0.0 10.0 20.0 50.0 56.4 85.3 44.8 Open Qwen3.8-27B 0.0 0.0 20.0 50.0 30.0 50.7 82.9 50.0 GLM-5.3-Flash 30.0 30.0 10.0 30.0 0.0 56.8 100.0 35.7 deepseek-v4.1-flash 0.0 0.0 10.0 50.0 30.0 67.0 80.0 56.2 Kimi-K3 9.1 9.1 27.3 18.2 36.4 57.6 95.0 42.1
Game Category GPT-5.6- Sol Claude- Sonnet-5 Balatro Strategy +10.0+10.0 +5.0+5.0 Forza Horizon 5 Sports −60.7-60.7 −64.1-64.1 Slay the Spire Strategy −8.3-8.3 −66.8-66.8 Black Myth: Wukong Combat +10.1+10.1 −0.2-0.2 Brotato Movement −8.4-8.4 −92.6-92.6 NBA 2K25 Sports −22.6-22.6 0.00.0 Riders Republic Sports +41.9+41.9 −18.6-18.6 The King of Fighters ’98 Combat +27.3+27.3 +54.6+54.6 TrackMania Nations Forever Movement −15.4-15.4 +13.5+13.5 Kingdom Rush 5: Alliance Strategy +72.6+72.6 +13.6+13.6 Overcooked! 2 Multi-step +3.0+3.0 0.00.0 Sekiro: Shadows Die Twice Combat +2.5+2.5 +2.7+2.7 Aimlab Multi-step +19.1+19.1 +20.4+20.4 Palworld Multi-step −70.1-70.1 −5.7-5.7 BattleBlock Theater Movement −7.0-7.0 +3.3+3.3
Our evaluation includes 12 coding-agent models. The closed-model group comprises GPT-6-Astra (OpenAI, 2026b), GPT-5.6-Sol and GPT-5.6-Terra (OpenAI, 2026a), Claude-Opus-5.5 (Anthropic, 2026b) and Claude-Opus-5 (Anthropic, 2026a), Claude-Sonnet-5 (Anthropic, 2026c), Gemini-3.8-flash (Google DeepMind, 2026), and Qwen3.8-flash (Alibaba Cloud, 2026). The open-model group comprises Qwen3.8-27B (Qwen Team, 2026), GLM-5.3-Flash (AutoClaw Team, 2026), deepseek-v4.1-flash (DeepSeek-AI, 2026), and Kimi-K3 (Kimi Team, 2026). We use each model’s associated coding harness where available and Codex as a common harness for the remaining open models. The human reference consists of a single player who is briefed on the basic rules and controls of each game but has not previously developed proficiency in playing it. The GUI baselines use GPT-5.6-Sol and Claude-Sonnet-5, with the game paused during agent inference. We set token and game-tic budgets tailored to each game, with the specific values reported in Table 3. We run three test episodes per method and game and average the valid scores.


Figure 3: Game-category performance and development interaction modes (left). (a) For each game, scores are min–max normalized to 0–1 across the 12 coding models, then averaged across games in each category. (b) Direct and Program game tics as fractions of their sum within one illustrative development run per model. Development progress vs. test performance (right). With development capped at 15k game tics and 25M tokens, nonuniformly sampled programs are independently tested for each game. Each row shows the mean test score against game tics and tokens for one game. Axes are rescaled from 0 to 100% per curve, and stars mark final selected programs.
4.1 Main results
Overall performance. Table 3 shows substantial variation across models and games. Eight coding models achieve the highest coding score on at least one game: GPT-6-Astra leads on five, while Claude-Opus-5.5 leads on NBA 2K25 and Aimlab. Panel (a) on the left of Figure 3 also shows different category profiles, with GPT-5.6-Sol strongest in Combat & Action Timing and Claude-Opus-5.5 in 3D Sports & Precision Control. Even within a category, no model consistently leads: GPT-6-Astra scores highest among coding agents on Balatro and Slay the Spire, whereas GPT-5.6-Sol leads on Kingdom Rush 5. The human player outperforms all agents on 10 of 15 games; GUI agents exceed this reference on Forza Horizon 5, and coding agents do so on Balatro, Forza Horizon 5, Slay the Spire, Riders Republic, and Aimlab. In the Computer Use Comparison, GPT-5.6-Sol’s frozen programs outperform its GUI baseline on eight games and underperform on seven; Claude-Sonnet-5’s programs win on seven, lose on six, and tie on two. Together, these results show that strong performance remains specific to particular models and games, and that frozen programs offer an alternative to online GUI control whose relative effectiveness varies across tasks.
4.2 Understanding the performance
1. What strategies do agents implement? Models differ in how they use game information to control actions. Table 5 shows that GPT-5.6-Sol mainly produces G1 controllers, which select actions according to timing or counters. In contrast, GPT-6-Astra more often produces G3 programs that use game state to guide decisions, while G4 is the most common level for Claude Opus 5 and Qwen3.8-flash, indicating the use of memory, planning, and recovery alongside game state. These distributions distinguish programs that largely follow predefined schedules from those that adjust decisions using feedback and accumulated information. Coding agents therefore differ in the control logic they encode, although greater reliance on game state does not by itself establish better performance.
2. Do more complex strategies perform better? Greater strategy complexity does not necessarily yield higher game performance. In Forza Horizon 5, Qwen3.8-flash’s PID controller achieves a mean score of 443.7, compared with 645.7 for Claude-Sonnet-5’s simpler local route follower. Qwen3.8-flash’s development traces record road departures and false recovery triggers, pointing to unresolved calibration issues, although their exact contribution to the score gap cannot be isolated. This gap between writing complex control code and calibrating it at runtime helps explain why stronger conventional programming performance may not transfer to standalone gameplay.
3. Do agents resolve failures through self-testing? Agents can identify problems during self-testing without reliably repairing them. Table 5 reports NER values ranging from 80.0% to 100%, but RS values spanning a wider range from 35.7% to 83.3% for identified problems targeted by modifications. GPT-5.6-Sol and Gemini-3.8-flash achieve NER values of 100.0% and 94.4%, respectively, yet their RS values are 41.7% and 58.8%, respectively. Obtaining relevant test feedback therefore does not ensure successful repair. Moreover, local problem resolution still requires independent testing to establish improved game performance.
4. How do agents interact during debugging? Most models rely primarily on script execution to obtain feedback during development and debugging. Panel (b) on the left of Figure 3 shows that in the illustrated development runs, program execution accounts for most game tics for 10 of 12 models, reaching 98.5% for GPT-5.6-Sol. Direct interaction accounts for most game tics for Gemini-3.8-Flash (56.3%) and Kimi-K3 (65.3%). These shares characterize development interaction, but do not distinguish exploration from targeted debugging or measure log-inspection time. Unequal run counts and budgets also limit their interpretation as stable model preferences.
5. Where do frozen programs fail? Partial state representations limit how frozen programs adapt to feedback. In Riders Republic, GPT-5.6-Sol’s selected program detects crashes using a red-screen threshold but executes tricks on a fixed counter-based schedule. Feedback thus supports recovery without adapting trick selection or timing to the gameplay state: detecting failures alone is insufficient to guide the actions that precede them.
6. How do frozen programs compare with GUI agents? Frozen programs can match or exceed the same model’s GUI agent on some games without model inference during testing. Table 5 compares paired results for GPT-5.6-Sol and Claude-Sonnet-5. GPT-5.6-Sol’s programs score higher on eight of 15 paired games and lower on seven; Claude-Sonnet-5’s programs score higher on seven, lower on six, and tie on two. Both models’ programs outperform their GUI agents on Balatro, Kingdom Rush 5, and KOF98, spanning strategy and combat tasks. However, both GUI agents score higher on Forza Horizon 5, Slay the Spire, Brotato, and Palworld. These results show that programs produced during development can support comparable or better gameplay on a subset of tasks without continued model involvement, but they do not yet provide a general replacement for online GUI-agent decision-making.
7. How do development budgets affect frozen-program performance? Both token and game-tic budgets influence performance, but their benefits vary across games. We examine how game-tic and token budgets affect test performance for Claude Opus 5 and GPT-5.6-Sol on Balatro, Black Myth: Wukong, and Forza Horizon 5 in the right panel of Fig. 3. We vary the cumulative game-tic budget from 5k to 15k in increments of 2k while fixing the token budget at 10 million, and vary the token budget from 5 to 25 million in increments of 3 million while fixing the game-tic budget at 10k.
5 Conclusion
We introduced Coding4Games, a benchmark that asks coding agents to develop standalone programs that play 15 modern games from visual observations through keyboard-and-mouse inputs, separating autonomous development in a sandbox from independent, model-free testing of a frozen program, and evaluating the development process alongside game performance and cost. Across 12 coding agents, the best program per game outscores the strongest GUI baseline on 13 of 15 games and ties it on one. The human player outscores all agents on 10 games. Our process measures reveal a gap between self-testing and problem resolution: agents expose modifications to self-testing but often fail to resolve the failures they target, leaving programs that cover part of the gameplay conditions or rest on visual assumptions that do not hold outside the observed scenario. Turning execution feedback into revisions that generalize is, on this evidence, the central open problem for coding agents in dynamic environments.
LLM Usage Statement
The research questions, hypotheses, and conceptual framework were developed by the authors without generative AI assistance. We used generative AI tools, primarily OpenAI Codex, to discuss and refine the methodology and to carry out most of the code implementation. AI tools also assisted with recording and analyzing experimental logs, analyzing and interpreting experimental results, conducting the literature survey, polishing the manuscript and generating visual materials, including background illustrations. The authors reviewed the entire manuscript and the outputs produced by the code, and rigorously tested the implementation against the intended requirements. The authors take responsibility for the final text, claims, results, and research artifacts, including those produced with AI assistance.
References
Aggarwal and Welleck (2026) Pranjal Aggarwal and Sean Welleck. Gym-Anything-RT: Scaling Real-Time Environments for Vision-Language Agents, 2026. https://arxiv.org/abs/2610.37567v1. arXiv preprint, version v1.
Alibaba Cloud (2026) Alibaba Cloud. qwen3.8-flash, 2026. https://help.aliyun.com/en/model-studio/qwen3-8-flash. Accessed: 2026-09-22.
Anthropic (2024) Anthropic. Introducing the Model Context Protocol, 2024. https://www.anthropic.com/news/model-context-protocol. Accessed: 2026-09-14.
Anthropic (2025) Anthropic. Claude 3.7 Sonnet and Claude Code, 2025. https://www.anthropic.com/news/claude-3-7-sonnet. Accessed: 2026-09-14.
Anthropic (2026a) Anthropic. System Card: Claude Opus 5, 2026a. https://anthropic.com/claude-opus-5-system-card. Accessed: 2026-09-22.
Anthropic (2026b) Anthropic. System Card: Claude Opus 5.5, 2026b. https://anthropic.com/claude-opus-5-5-system-card. Accessed: 2026-11-11.
Anthropic (2026c) Anthropic. System Card: Claude Sonnet 5, 2026c. https://anthropic.com/claude-sonnet-5-system-card. Accessed: 2026-09-22.
Austin et al. (2021) Jacob Austin, Augustus Odena, Maxwell Nye, Maarten Bosma, Henryk Michalewski, David Dohan, Ellen Jiang, Carrie Cai, Michael Terry, Quoc Le, and Charles Sutton. Program Synthesis with Large Language Models. arXiv preprint arXiv:2108.07732, 2021. https://arxiv.org/abs/2108.07732v1.
AutoClaw Team (2026) AutoClaw Team. GLM-5.3-Flash: More Intelligence with Less Compute, 2026. https://autoclaw.z.ai/en/blog/model/glm-5.3-flash/. Published: 2026-08-27. Accessed: 2026-09-26.
Bachrach et al. (2025) Yoram Bachrach, Edan Toledo, Karen Hambardzumyan, Despoina Magka, Martin Josifoski, Minqi Jiang, Jakob Foerster, Roberta Raileanu, Tatiana Shavrina, Nicola Cancedda, Avraham Ruderman, Katie Millican, Andrei Lupu, and Rishi Hazra. Combining Code Generating Large Language Models and Self-Play to Iteratively Refine Strategies in Games. In International Joint Conference on Artificial Intelligence (IJCAI), Demonstrations Track, pages 10999–11003, 2025. 10.24963/ijcai.2025/1249.
Baker et al. (2022) Bowen Baker, Ilge Akkaya, Peter Zhokhov, Joost Huizinga, Jie Tang, Adrien Ecoffet, Brandon Houghton, Raul Sampedro, and Jeff Clune. Video PreTraining (VPT): Learning to Act by Watching Unlabeled Online Videos. In Advances in Neural Information Processing Systems (NeurIPS), volume 35, pages 24639–24654, 2022. 10.52202/068431-1789.
Bellemare et al. (2013) Marc G. Bellemare, Yavar Naddaf, Joel Veness, and Michael Bowling. The Arcade Learning Environment: An Evaluation Platform for General Agents. Journal of Artificial Intelligence Research, 47:253–279, 2013. 10.1613/jair.3912.
Cai et al. (2024) Tianle Cai, Xuezhi Wang, Tengyu Ma, Xinyun Chen, and Denny Zhou. Large Language Models as Tool Makers. In International Conference on Learning Representations (ICLR), 2024. https://iclr.cc/virtual/2024/poster/17729.
Chen et al. (2026) Jiajun Chen, Haoyu Wu, Mingda Jia, and Xihui Liu. Recursive Game Creator: An Agentic Product-Level Experience-Oriented Game Harness, 2026. https://arxiv.org/abs/2610.08621v2. arXiv preprint, version v2.
Chen et al. (2021) Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Ponde de Oliveira Pinto, Jared Kaplan, Harri Edwards, Yuri Burda, Nicholas Joseph, Greg Brockman, Alex Ray, Raul Puri, Gretchen Krueger, Michael Petrov, Heidy Khlaaf, Girish Sas