New AI Benchmark Tests Whether Vision Models Can Write Their Own Video Game Code
Researchers found that advanced multimodal models can describe screenshots easily, but writing executable control scripts for live gameplay remains a major hurdle.
When artificial intelligence models try to play video games, they usually take a sluggish, frame-by-frame approach that requires thousands of individual image analyses and drives up computational costs. A new benchmarking framework called PlayScriptBench changes this dynamic by asking multimodal AI systems to write a complete, standalone Python program that can play games autonomously at native frame rates. The study, available as a preprint on the arXiv preprint server, tested 13 frontier vision-language models across 16 different HTML5 video games to see if they could successfully synthesize executable code for real-time control.
How Does the Four-Stage Pipeline Turn Screenshots Into Code?
Writing a game-playing script from visual pixels alone is a complex challenge because the AI cannot peek at the underlying game code or internal memory. To tackle this, Yao Tong and colleagues at the University of Chinese Academy of Sciences and the Computer Network Information Center structured the benchmark around a four-stage process known as the Explore, Perception, API Construction, and Strategy Composition pipeline.
In the first stage, the model explores the game rules and a representative screenshot to generate a structured markdown summary of the gameplay mechanics. The second stage requires the AI to write a computer-vision routine that extracts structured state attributes from raw RGB frames. The third stage builds an interface class that translates those raw visual detections into strategy-facing methods, such as locating the nearest obstacle or checking if a jump is safe. Finally, the fourth stage compiles everything into a control loop that executes the game autonomously.

Why Do Advanced AI Models Struggle With Live Gameplay?
The evaluation results across 16 games spanning runner, arcade, puzzle, and platformer genres revealed a surprising disconnect between visual description and active control. While several advanced models could fluently describe what was happening in a static screenshot, they frequently failed to produce controllers that played reliably during live action. For instance, top-performing vision models often achieved high scores in visual perception yet stumbled during the strategy phase, resulting in an average joint score of only about 0.155 across all tested systems.
The authors identified several recurring failure modes during their ablation studies. One major hurdle was hallucinated visual grounding, where models guessed color thresholds and pixel ranges rather than relying on structured interfaces. Another issue was the perception-api cascade, where minor errors in early visual detection got amplified by the API layer and resulted in total control failures. Even when perception was correct, models often generated syntactically valid code with flawed decision logic, such as pathfinding algorithms that ignored character growth or board rotations.

What Are the Efficiency Gains Over Traditional In-Loop Agents?
Despite these performance hurdles, the script-based approach offers massive efficiency advantages over traditional per-frame methods. When tested on the Qwen 3.6 Plus model across 16 games, the script-based pipeline reduced the number of model calls by more than fortyfold and cut token consumption by more than eightyfold for a single screening seed compared to traditional in-loop execution. Because the generated controller is reusable, running multiple seeds does not require repeated model inference, leading to a faster and much cheaper evaluation protocol.
The researchers note that while script synthesis excels in deterministic environments where a static controller can plan ahead, per-frame inference remains better suited for open-world or highly stochastic environments. Future developments for the benchmark will likely involve introducing online AI feedback to refine scripts during runtime and expanding the game suite to cover additional genres.
The study was posted to the arXiv preprint server on November 20, 2026.
This article has been fact checked for accuracy, with information verified against reputable sources. Learn more about us and our editorial process.
Last reviewed on .
Article history
- Latest version
Reference(s)
- Tong, Yao. “Can Vision-Language Models Synthesize Executable Game-Playing Programs?.” arXiv.org <http://arxiv.org/abs/2611.27741v1>.
Cite this page:
- Posted by James Whitmore