RainBowLuoCS/Gamer

Official Implementation of Gamer: A Generalist Vision-Language-Action Foundation Model for Long-Horizon Real-Time Game Agents

What it solves

Gamer is an AI agent that plays video games the way a human would: it looks at the screen and controls the keyboard and mouse. It is built for long-horizon tasks — objectives that require many steps over a long stretch of play, like completing a multi-stage quest in a 3D open-world game. The same approach works across both conventional 2D games and complex 3D simulated worlds, using one unified interface for all of them.

How it works

Gamer is trained in three stages, all using the same screen-observation and keyboard/mouse-action interface:

  1. Continued pre-training (CPT): The model is trained on tens of thousands of hours of recorded keyboard and mouse gameplay spanning simulated games and embodied environments, so it learns how different worlds behave.
  2. Sparse-reasoning instruction tuning (SFT): The model learns to act on task instructions, to reason only at key decision points (rather than every step), and to write memory summaries that preserve progress across context windows.
  3. Online reinforcement learning (TA-GRPO): A method called Temporal-Aware GRPO trains the policy on trajectory segments linked by memory summaries, using verifiable in-game outcomes as rewards and temporal credit assignment.

During play, the policy receives the game's control rules, the task instruction, recent observations and actions, and persistent memory. At routine moments it acts directly; when the situation changes or a new objective appears, it first generates reasoning or updates its memory. Each decision covers about 200 ms of interaction, divided into six 33 ms steps, and is emitted in a strict text format (mouse displacement plus up to six groups of held keys).

For real-time play, a serving engine called Streaming-vLLM (coming soon) reuses cached context, verifies predicted output tokens, and dispatches the first verified action block early so execution can start while the rest is still being generated. It can serve many game environments concurrently.

Who it's for

Researchers and engineers working on game-playing AI, embodied agents, and vision-language-action foundation models. It is also relevant to anyone exploring generalist agents that could eventually operate across both digital and physical worlds, since the same training pipeline handles 2D interfaces and 3D simulated environments.

Highlights

  • Unified visual control: observes screen images and acts through native keyboard and mouse inputs, using the same interface across games.
  • Sparse reasoning & persistent memory: reasons only at key decision points and uses memory summaries to retain task progress across context windows.
  • Long-horizon reinforcement learning: TA-GRPO trains on trajectory segments linked by memory summaries, using verifiable environment feedback and temporal credit assignment.
  • Real-time streaming inference: Streaming-vLLM combines persistent context reuse, verified speculative decoding, and early action dispatch for online play, evaluation, and deployment.
  • Strong measured results: on held-out tasks in Honkai: Star Rail, scores improved from 34.4% to 80.0% on one side quest and from 47.9% to 83.6% on another after RL, with the minigame macro-average reaching 49.7%.
  • Inference speedup: cumulative optimizations cut end-to-end request latency from 1306.00 ms to 65.12 ms (a 20.1× speedup) on an NVIDIA H200 with a Qwen3.5-35B-A3B MoE backbone.

Related

  • Project
  • Project
  • Project
  • Project