Can Vision-Language Models Synthesize Executable Game-Playing Programs?
Authors: Yao Tong, Jiaxin Qi, Dingyu Zhang, Jianqiang Huang
Organizations: Hangzhou Institute for Advanced Study University of Chinese Academy of Sciences · Computer Network Information Center Chinese Academy of Sciences
Recent advances in vision-language models (VLMs) have endowed multimodal agents with increasingly strong visual perception and long-horizon reasoning capabilities, making VLM-based autonomous game playing feasible. Existing game benchmarks primarily evaluate whether an agent can select appropriate actions from the current visual state across different scenarios and games. However, most of them adopt a step-by-step interaction paradigm where the current visual observation is sent to the agent before each action. In practical deployment, this paradigm introduces two fundamental limitations: the game loop must wait for model inference, making real-time interaction impractical, and repeated VLM calls incur substantial cost. Therefore, we propose PlayScriptBench, a script-based game benchmark that evaluates whether VLMs can synthesize an executable game-playing program from game states. This setting jointly evaluates visual grounding, understanding of game dynamics, long-horizon strategic reasoning, and executable program synthesis, providing a more comprehensive assessment of game-playing agents. To support more tractable evaluation for current general-purpose VLMs, we further introduce a four-stage pipeline --- Explore, Perception, API Construction, and Strategy Composition --- that decomposes controller synthesis into game exploration, state perception, interface construction, and strategic control, enabling agents to progressively construct an executable program. Experiments on 16 games spanning 4 genres show that even strong VLMs struggle on our benchmark, revealing a substantial gap between passive visual game understanding and executable closed-loop game control. These results establish script-based controller synthesis as a complementary direction for benchmarking VLM-based game-playing agents.
Figures & tables
Figure 1: Comparison of evaluation protocols. Left: Existing game-agent benchmarks invoke the VLM inside the observation–action loop: every frame, the model receives a screenshot and predicts an action. Right: PlayScriptBench inverts the protocol—the VLM is queried only once during a development phase to synthesize an executable controller, which then runs autonomously.
Figure 2: Overview of the PlayScriptBench: the four-stage pipeline and the 16 HTML5 games.
Figure 3: Stage 3 controller script and game sandbox interaction. Left: a 2048 controller generated by Claude Sonnet 4.6; right: a Snake controller generated by GPT-5.6 Luna.
Runner
Arcade
Puzzle
Platformer
Overall
Model
Obs.
Stra.
Obs.
Stra.
Obs.
Stra.
Obs.
Stra.
Obs.
Stra.
Joint
MiniMax-M3
0.65
0.148
0.54
0.334
0.40
0.493
0.48
0.231
0.52
0.302
0.157
Claude Sonnet 4.6
0.59
0.185
0.65
0.435
0.43
0.648
0.44
0.390
0.53
0.414
0.218
Claude Sonnet 5
0.48
0.093
0.56
0.139
0.33
0.282
0.45
0.394
0.46
0.227
0.103
Doubao Seed 2.1 Turbo
0.56
0.404
0.59
0.331
0.52
0.590
0.39
0.437
0.51
0.441
0.227
ERNIE 5.0
0.49
0.333
0.42
0.308
0.42
0.270
0.48
0.506
0.45
0.354
0.160
Table 1: Stage-3 evaluation results across the 16-game suite. Obs. (Observation): end-to-end state extraction quality, averaging perception and API accuracy. Stra. (Strategy): min-max normalized game score across 10 random seeds, using Oracle perception; bounds are the min and max raw game scores among all evaluated models on that game. Joint : a composite diagnostic score, G1∑gObsg×Strag , where Stra. is measured under Oracle perception. Bold indicates first place; underline indicates second place per column.
GPT-5.6 Luna
Qwen 3.6 Plus
Config
Per.
API.
Stra.
↓
→
↑
Per.
API.
Stra.
↓
→
↑
Full Pipeline
0.793
0.576
0.255
—
—
—
0.609
0.334
0.600
—
—
—
w/o Stage 0
0.463
0.327
—
6
9
1
0.458
0.231
—
8
7
1
w/o Stage 1
—
0.251
—
6
10
0
—
0.149
—
10
6
0
w/o Stage 2
—
—
0.036
7
9
0
—
—
0.120
9
6
1
w/o Oracle
—
—
0.013
13
3
0
—
—
0.052
14
2
0
Table 2: Pipeline ablation on GPT-5.6 Luna (best perception) and Qwen 3.6 Plus (best strategy), 16-game average. w/o Stage 0/1/2 : removes Explore/Perception/API Construction; w/o Oracle : replaces Oracle perception with the VLM’s own Stage 1/2 artifacts. Per. / API. / Stra. : perception accuracy (Stage 1), API correctness (Stage 2), and min-max normalized strategy score (Stage 3, Oracle perception). Per. and API. are averaged directly across 16 games, so they differ from the genre-averaged Overall Obs. in Table 1 . Arrows ( ↓ , → , ↑ ): among games with valid scores, the number where score decreases ( >10% )/stays ( ±10% )/increases ( >10% ) vs. Full Pipeline.
1 Seed
10 Seeds
Method
Calls
Tokens
Time
Calls
Tokens
Time
Stra.
(K)
(min)
(K)
(min)
Our Method
5.0
27.4
4.4
5.0
27.4
19.7
0.600
VLM in-loop
214.1
2270.6
4.2
2141.3
22706.3
42.1
0.357
Table 3: Resource consumption on Qwen 3.6 Plus (16-game average). For VLM in-loop, the 10-seed Tokens value is cumulative across all seeds. Stra.: min-max normalized strategy score (10-seed mode only).
Appendix figures & tables10 assets
Supplementary material from the paper’s appendix.
Appendix
Game
Genre
Engine
Input
Flappy Bird
Runner
Canvas
Keyboard
2048
Puzzle
DOM + CSS
Keyboard
Pac-Man
Arcade
DOM grid
Keyboard
Snake
Arcade
Canvas
Keyboard
Tetris
Puzzle
Canvas
Keyboard
Minesweeper
Puzzle
DOM grid
Mouse
Appendix
Table 4: PlayScriptBench game suite.
Model
Chrome_Dino
Color_Switch
Flappy_Bird
Geometry_Dash
MiniMax-M3
45.0
0.3 ( ± 0.5)
0
13.3 ( ± 2.4)
Claude Sonnet 4.6
47.7 ( ± 3.8)
0
0
10.0
Claude Sonnet 5
46.0
0
0
10.0
Doubao Seed 2.1 Turbo
45.0
0.7 ( ± 0.5)
0.6 ( ± 0.9)
15.0
ERNIE 5.0
50.3 ( ± 3.8)
1.3 ( ± 0.9)
0
10.0
Gemini 3.1 Flash Lite
44.7 ( ± 0.5)
0
0
11.7 ( ± 2.4)
Appendix
Table 5: Per-game Stage 3 strategy scores on Runner games (mean ± std over 10 screening seeds). Dashes indicate games with no completed run.
Model
Pac_Man
Snake
Knife_Hit
Space_Inv.
MiniMax-M3
20.0
0
12.0 ( ± 3.6)
20.0 ( ± 28.3)
Claude Sonnet 4.6
36.3 ( ± 5.2)
23.3 ( ± 26.2)
5.0 ( ± 1.4)
20.0 ( ± 28.3)
Claude Sonnet 5
—
—
3.3 ( ± 1.2)
—
Doubao Seed 2.1 Turbo
0
0
4.7 ( ± 1.2)
61.7 ( ± 49.4)
ERNIE 5.0
0
0
7.7 ( ± 0.5)
0
Gemini 3.1 Flash Lite
1.0
3.3 ( ± 4.7)
11.0
0
Appendix
Table 6: Per-game Stage 3 strategy scores on Arcade games (mean ± std over 10 screening seeds). Dashes indicate games with no completed run.
Model
Match_3
Minesweeper
Tetris
2048
MiniMax-M3
0
23.7 ( ± 15.0)
1950.0 ( ± 334.2)
1830.7 ( ± 768.7)
Claude Sonnet 4.6
0
25.7 ( ± 14.4)
1950.0 ( ± 334.2)
4222.7 ( ± 542.0)
Claude Sonnet 5
3613.3 ( ± 1237.8)
—
—
—
Doubao Seed 2.1 Turbo
12800.0 ( ± 2490.4)
25.0 ( ± 16.1)
0
2813.3 ( ± 117.9)
ERNIE 5.0
—
0
683.3 ( ± 458.9)
2118.7 ( ± 1351.3)
Gemini 3.1 Flash Lite
2746.7 ( ± 556.5)
15.3 ( ± 18.2)
0
797.3 ( ± 90.8)
Appendix
Table 7: Per-game Stage 3 strategy scores on Puzzle games (mean ± std over 10 screening seeds). Dashes indicate games with no completed run.
Model
Doodle_Jump
Helix_Jump
Stack2D
Stick_Hero
MiniMax-M3
47.3 ( ± 23.6)
2.0 ( ± 2.2)
5.3 ( ± 1.9)
0
Claude Sonnet 4.6
379.0 ( ± 479.9)
0.3 ( ± 0.5)
5.3 ( ± 2.5)
3.0 ( ± 2.9)
Claude Sonnet 5
269.7 ( ± 187.3)
1.7 ( ± 1.9)
—
—
Doubao Seed 2.1 Turbo
674.0 ( ± 686.8)
0.7 ( ± 1.2)
4.0 ( ± 0.8)
0
ERNIE 5.0
202.0 ( ± 88.7)
2.3 ( ± 3.3)
2.3 ( ± 0.5)
9.0 ( ± 9.2)
Gemini 3.1 Flash Lite
762.7 ( ± 841.0)
1.0 ( ± 1.4)
2.3 ( ± 0.9)
4.0 ( ± 3.7)
Appendix
Table 8: Per-game Stage 3 strategy scores on Platformer games (mean ± std over 10 screening seeds). Dashes indicate games with no completed run.
Table 10: Information flow between stages. Grader scores are deliberately withheld from VLM feedback in Stages 1 and 2 to force self-correction via visual inspection and error analysis.
Model
Obs.
Stra.
Rk Obs
Rk Stra
Δ
GPT-5.6 Luna
0.53
0.255
1
11
+10
Claude Sonnet 4.6
0.53
0.414
1
4
+3
MiniMax-M3
0.52
0.345
3
8
+5
Doubao Seed 2.1 Turbo
0.51
0.427
4
3
−1
GPT-5.4 Mini
0.51
0.343
4
9
+5
Kimi K2.5
0.51
0.459
4
2
−2
Appendix
Table 11: Per-model Observation and Strategy ranks (rank 1 = highest score). Δ=RkStra−RkObs ; positive values indicate overperformance in Strategy relative to Observation.
Game
Resolution
Game
Resolution
Flappy Bird
640×480
Geometry Dash
960×540
Chrome Dino
600×150
2048
500×650
Snake
420×460
Minesweeper
500×600
Pac-Man
560×600
Doodle Jump
422×552
Tetris
600×500
Helix Jump
400×600
Color Switch
500×700
Knife Hit
500×700
Appendix
Table 12: Per-game observation viewport (pixels). All screenshots are captured at these resolutions via Playwright with device_scale_factor=1 .
Match-3: do_nothing / click on 8×8 grid cell; Minesweeper: click / flag / chord (mouse-based)
Appendix
Table 13: Action space summary. ∣A∣ denotes the number of discrete actions. Mouse-based games (Match-3, Minesweeper, Stick Hero) use pixel-coordinate or duration mappings in addition to key bindings.
Training vision-language-action (VLA) models to follow gameplay instructions across diverse games is limited by the cost of collecting demonstrations. We introduce a framework that automatically generates game environments and expert demonstrations. An LLM-powered agent uses game-building tools to construct executable environments and tasks targeting specified skills. Programmatic experts then use privileged simulator state to generate aligned instructions, rendered observations, and keyboard and mouse actions. We train our game policy, Script2Play, by post-training a 4B vision-language model with behavior cloning on 150.3 hours of synthetic gameplay in Minecraft and Roblox, without human gameplay demonstrations or reinforcement learning. Evaluation on multiple public game benchmarks demonstrates that Script2Play follows gameplay instructions effectively and generalizes across game engines, highlighting the effectiveness of targeted synthetic supervision.
Human gameplay is a visually grounded interaction loop in which players act, reflect on failures, and watch tutorials to refine strategies. Can Vision-Language Models (VLMs) also learn from video-based reflection? We present GameVerse, a comprehensive video game benchmark that enables a reflective visual interaction loop. Moving beyond traditional fire-and-forget evaluations, it uses a novel reflect-and-retry paradigm to assess how VLMs internalize visual experience and improve policies. To facilitate systematic and scalable evaluation, we also introduce a cognitive hierarchical taxonomy spanning 15 globally popular games, dual action space for both semantic and GUI control, and milestone evaluation using advanced VLMs to quantify progress. Our experiments show that VLMs benefit from video-based reflection in varied settings, and perform best by combining failure trajectories and expert tutorials-a training-free analogue to reinforcement learning (RL) plus supervised fine-tuning (SFT).Our project page is available at https://gameverse-bench.github.io/ . Our code is available at https://github.com/THUSI-Lab/GameVerse .
Vision-Language Models (VLMs) have achieved strong performance on static visual understanding benchmarks, yet their ability to act in dynamic environments remains less well understood. We introduce AtariBench, a controlled benchmark that evaluates VLMs across 20 Atari 2600 games, requiring models to make sequential decisions from high-temporal-resolution gameplay streams. By decoupling fast in-game dynamics from wall-clock inference speed, AtariBench focuses on whether models can perceive rapid visual state changes, reason over spatiotemporal dynamics, and ground actions in the current observation. Our experiments reveal substantial limitations in state-of-the-art VLMs: models often fail to infer object motion and direction, exhibit brittle sequential decision-making, and over-rely on textual interaction history despite newly appended visual feedback. We further introduce a separability analysis to identify which in-game scores provide reliable signals of model competence, and use the benchmark to study how memory design and prompting strategies affect performance. Overall, AtariBench exposes a persistent gap between passive visual perception and active decision-making, providing a lightweight and rigorous testbed for developing VLMs that can reason and act in dynamic environments.
Mingjia Huo, Yao Fu, Bo Chang +8
University of California San Diego · Google DeepMind · Peking University +1