PlayScriptBench: New Benchmark Tests If Vision AIs Can Write Code to Play Games Autonomously

A new benchmark called PlayScriptBench, published on arXiv on November 20, 2026, tests whether vision-language models can write complete Python programs that play games by themselves. Instead of the traditional method where the AI analyzes each frame and decides the next action, the system asks the model to synthesize an executable controller that runs autonomously at the game's native frame rate.

How the four-stage pipeline works

Researchers from the University of Chinese Academy of Sciences and the Computer Network Information Center structured the test into four phases: Explore, Perception, API Construction, and Strategy Composition. In the first, the model explores the rules and a screenshot to summarize the mechanics. Then it writes a computer-vision routine that extracts the game state from pixels. Next it builds an API with strategic methods, such as locating the nearest obstacle. Finally it composes the control loop that executes the game alone.

The benchmark uses 16 HTML5 games across four genres (runner, arcade, puzzle, and platformer) and tested 13 frontier models. Agents receive only RGB frames and a keyboard/mouse interface, with no access to the game's code or memory.

Results: describing is easy, controlling is hard

Models can describe screenshots fluently, but frequently fail to produce reliable controllers during live execution. The average joint score was around 0.155. Common failures include hallucinated color thresholds, error propagation from perception to the API, and flawed strategic logic even with correct perception.

On the other hand, the approach brings efficiency gains. In the test with Qwen 3.6 Plus, the script-based pipeline reduced the number of model calls by more than 40 times and token consumption by more than 80 times compared to the frame-by-frame method for a single seed.

Why this matters

PlayScriptBench is complementary to benchmarks that use per-frame inference. It evaluates the ability to compress visual understanding into persistent code, especially useful in deterministic and bounded-state games. The higher efficiency can make game-agent evaluations cheaper and open the way for reusable controllers.

The full paper is available on arXiv (2611.27741).

Sources:

This content was produced with the assistance of artificial intelligence.

Por Grok