Skip to content

About

Scaling Gameplay Experience for Visual Agents through Environment-Player Co-Development

Resources

Stars

31 stars

Watchers

2 watching

Forks

Repository files navigation

Game2Player: 568 games, 15.7K trajectories, 1.56M steps, 307 hours of gameplay, with animated gameplay

Game2Player: Scaling Gameplay Experience for Visual
Agents through Environment–Player Co-Development

Xirui Jiang1,*, Yuxi Chen1,*, Rui Yang1,*,†, Feng Luo2,*, Pengcheng Wang1, Bingxuan Li1, Zihao Zhao3,
Yushan Li1, Han Wang1, Manling Li4, Yang Zhang5, Shiyu Chang2, Tong Zhang1, Huan Zhang1

1 UIUC   2 UCSB   3 Georgia Tech   4 Northwestern   5 IBM

* Equal contribution   † Project lead

Paper on arXiv Project Page Leaderboard Dataset: coming soon Models

Updates

Overview

Game2Player co-develops verifiable game environments with a Coding Player and a VLM Player, and turns their gameplay into training data for visual agents. This repository holds the framework: the agents that build environments from web games, the players, the browser runtime, rollouts, data export and training.

The Game2Player loop: Scout, Builder, Environments, Coding Player and VLM Player, Reports, then Verified Environments and Data

  • Scout selects games by their source, engine and access to game state.
  • Builder adapts each game for offline play, exposes its state through game_api.js, and defines verifiable tasks, with engine skills for Unity, Flash, Godot and PICO-8.
  • Coding Player writes code policies that read the game state. VLM Player plays from screenshots.
  • Reports return problems to the Builder, such as a key press with no effect or a state variable a policy needs. The Builder repairs the environment and the players retry.
  • The loop produces Verified Environments and Data: trajectories that record observations, actions and task progress.

Image
Environment–player co-development
Co-develop verifiable game environments and code policies through gameplay feedback, with game-state-based tasks, progress measures and success checks.
Image
Scalable collection and visual policy distillation
Fast code policy rollouts and VLM demonstrations train Game2Player-4B and Game2Player-9B with progress-weighted SFT.
Image
PlayerBench
50 held-out games and 287 tasks, harder than GameWorld: Game2Player-4B with thinking on reaches 31.1 progress on PlayerBench and 49.5 on GameWorld.

Results

We fine-tune Qwen3.5-4B and Qwen3.5-9B on gameplay collected with Game2Player and test them on PlayerBench (50 held-out games, 287 tasks) and GameWorld (34 games, 170 tasks). Each model plays each task once, with at most 100 steps per task. Progress is averaged over a game's tasks and then over games. Success is the share of tasks completed.

ModelThinkingPlayerBenchGameWorld
ProgressSuccessProgressSuccess
Qwen3.5-4Boff12.74.927.39.4
Game2Player-4Boff23.410.534.913.5
Qwen3.5-9Boff16.26.628.79.4
Game2Player-9Boff28.614.633.914.1
Qwen3.5-4Bon15.95.626.98.2
Game2Player-4Bon31.114.649.527.6
Qwen3.5-9Bon14.35.230.013.5
Game2Player-9Bon31.215.053.129.4

The leaderboard compares these models with recent API models on PlayerBench and with the published GameWorld results.

Getting started

Install

Run these commands from a Game2Player checkout. To install all of PlayerBench, use Linux x86-64.

conda create -n game2player -c conda-forge python=3.12 pip ffmpeg nodejs patch
conda activate game2player
python -m pip install -r requirements.txt
python -m playwright install chromium

Install PlayerBench

python benchmark/playerbench/install.py

Try Give Up's first task and guide the runner through five floors.

python play.py run --game 457_give-up --task 457_01

To run a model on the benchmark, follow the evaluation instructions.

Configure models

To generate new environments, install Codex CLI or Claude Code. To run the agents with Claude Code, save the token printed by claude setup-token to ~/.config/game2player/claude.token and make the file private with chmod 600 ~/.config/game2player/claude.token. Codex uses its own login. Unity and Flash games need .NET or Java for their engine tools.

Role Codex Claude
Scout, Builder and Coding Player catalog/agents/codex.yaml catalog/agents/claude.yaml
VLM Player catalog/models/codex-player.yaml catalog/models/claude-player.yaml

Set model in a profile to choose the model. To play with an OpenAI-compatible vision service, set model and endpoint in catalog/models/http-player.yaml, and api_key_env: [GAME2PLAYER_API_KEY] if the service needs a key. Its codec sets the action format: qwen for text tool calls with 0–1000 coordinates, canonical_tool for function calls with pixel coordinates.

Each player profile lists its thinking levels, and the first is the default. Pass --thinking to a rollout to choose another.

The released models have ready-to-use profiles: game2player-4b and game2player-9b. Both use the Qwen action format and allow 512 output tokens with --thinking off or 32,768 with --thinking on. See the PlayerBench instructions to run them locally or through an existing model server.

Generate an environment

To find games from a description, run the discovery example:

python -m tools.game_pipeline examples/discover.yaml --jobs 2 --until policy

Edit scout_prompt in that YAML to choose a platform, genre and number of games.

To build a specific game, run the 2048 example:

python -m tools.game_pipeline examples/campaign.yaml --jobs 1 --until policy

To use another game, copy this YAML and edit its entry under games. For each game, only source_url is required. You can also provide title and game_id, or let them be generated automatically. Use game_id in later play commands, for example 1_2048. Use a new campaign name to start a separate run.

To use Claude, set agent: claude, and model: claude-player under both vlm_check and vlm_collect.

--until builder stops after generating the environment and tasks. --until policy also runs playtesting and repairs, then creates a code policy. Omit --until to continue through trajectory collection. Running the same command again resumes its work.

--jobs sets how many games run at once. --workers sets how many VLM episodes run at once within each game and overrides options.vlm_workers in the YAML. vlm_workers defaults to 2. The examples use 1. For example, --jobs 4 --workers 1 processes up to four games with one VLM episode per game. To use both coding agents, pass --agents codex=2,claude=2 instead of --jobs. target_per_task in the collection plans sets how many episodes each task records.

Play a generated game

Use the game and task IDs from your generated catalog, for example:

python play.py run --game 1_2048 --task 1_01                  # play it yourself
python play.py run --game 1_2048 --task 1_01 \
  --actor vlm --model codex-player --headless --max-steps 100    # let the VLM Player play

The VLM Player sees the current screenshot, the six before it, and its last 50 actions with their notes. To change this, pass a YAML file with --actor-config:

history_steps: 50
images_max: 6

On Linux with an NVIDIA GPU, set GAMEENV_WEBGL_GPU=any, or a PCI bus ID, to render WebGL on the GPU instead of the CPU.

Collect or evaluate

Collect trajectories from your games with the example plans:

python -m tools.rollout run examples/plans/policy_collect.yaml \
  --model policy --out data/trajs/policy --workers 4
python -m tools.rollout run examples/plans/vlm_collect.yaml \
  --model codex-player --out data/trajs/vlm --workers 2

To evaluate your games, copy the evaluation plan and edit games to select them. Use all to evaluate every game in your local catalog, or a named group such as {test: [1_my-game, 2_other-game]}.

cp benchmark/playerbench/evaluation.yaml evaluation.yaml
python -m tools.rollout run evaluation.yaml \
  --model codex-player --out data/trajs/evaluation --workers 2

Running a rollout again resumes it. --dry-run lists its tasks without running them.

Find outputs

Output Location
Game runtime games/benchmark/GAME_ID/
Game and task definitions catalog/games/, catalog/tasks/
Code policies and their state probes harnesses/policy/policies/, harnesses/policy/probes/
Campaign progress and logs .cache/game-pipeline/CAMPAIGN/
Campaign recordings data/trajs/collect/CAMPAIGN/
Rollout recordings the --out folder

Export training data from the recordings, then train. The recording format and catalog fields are described in docs/.

Citation

@misc{game2player2026,
  author       = {Jiang, Xirui and Chen, Yuxi and Yang, Rui and Luo, Feng and
                  Wang, Pengcheng and Li, Bingxuan and Zhao, Zihao and
                  Li, Yushan and Wang, Han and Li, Manling and Zhang, Yang and
                  Chang, Shiyu and Zhang, Tong and Zhang, Huan},
  title        = {Game2Player: Scaling Gameplay Experience for Visual Agents
                  through Environment--Player Co-Development},
  year         = {2026},
  eprint       = {2611.24154},
  archivePrefix = {arXiv},
  primaryClass = {cs.CV},
  url          = {https://arxiv.org/abs/2611.24154}
}

License

Game2Player is an academic research project. Our original code, released model weights and benchmark task specifications are licensed under Apache-2.0. Memory Match and Simon Sequence are included under the same license. Third-party components retain their original licenses, listed in third-party notices. Game2Player models are fine-tuned from Qwen3.5.

We do not distribute third-party game builds or assets. All rights in third-party games, names, trademarks, artwork and footage remain with their respective owners. Our license grants no additional rights to that content. Illustrative game screenshots are not covered by our code license.

About

Scaling Gameplay Experience for Visual Agents through Environment-Player Co-Development

Resources

Stars

31 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages