Skip to main content
QUICK REVIEW

[Paper Review] Diffusion Models Are Real-Time Game Engines

Dani Valevski, Yaniv Leviathan|arXiv (Cornell University)|Aug 27, 2024
Distributed and Parallel Computing SystemsComputer Science3 citations
TL;DR

This paper introduces GameNGen, a neural game engine that uses a diffusion model to simulate the classic game DOOM in real time at over 20 FPS on a single TPU, achieving PSNR of 29.4 and human-level indistinguishability in video clips. It trains an RL agent to collect gameplay data, then fine-tunes a diffusion model to predict the next frame conditioned on past frames and actions, using noise-augmented conditioning to stabilize long-horizon autoregressive generation.

ABSTRACT

We present GameNGen, the first game engine powered entirely by a neural model that also enables real-time interaction with a complex environment over long trajectories at high quality. When trained on the classic game DOOM, GameNGen extracts gameplay and uses it to generate a playable environment that can interactively simulate new trajectories. GameNGen runs at 20 frames per second on a single TPU and remains stable over extended multi-minute play sessions. Next frame prediction achieves a PSNR of 29.4, comparable to lossy JPEG compression. Human raters are only slightly better than random chance at distinguishing short clips of the game from clips of the simulation, even after 5 minutes of auto-regressive generation. GameNGen is trained in two phases: (1) an RL-agent learns to play the game and the training sessions are recorded, and (2) a diffusion model is trained to produce the next frame, conditioned on the sequence of past frames and actions. Conditioning augmentations help ensure stable auto-regressive generation over long trajectories, and decoder fine-tuning improves the fidelity of visual details and text.

Motivation & Objective

  • To explore whether a neural generative model can simulate a complex, interactive game environment in real time with high visual quality.
  • To address the challenge of stable autoregressive video generation conditioned on streaming action inputs, a key limitation in existing diffusion models.
  • To demonstrate that a single neural model can replace traditional game engine logic by learning to simulate game state updates and rendering from demonstration data.
  • To establish a new paradigm for game engines based on learned neural models rather than hand-coded rules.

Proposed method

  • Train a reinforcement learning agent to play DOOM and record its gameplay sessions, including states, actions, and observations.
  • Use the recorded gameplay data to pre-train a latent diffusion model on frame prediction, conditioned on past frames and actions.
  • Apply noise-augmented conditioning to stabilize long-horizon autoregressive generation and prevent sampling divergence.
  • Fine-tune the autoencoder and distill the model to improve reconstruction quality and inference speed.
  • Use teacher forcing during training to ensure accurate frame prediction, then switch to auto-regressive inference for real-time simulation.
  • Leverage the model’s ability to infer game state from visual cues (e.g., health, ammo, location) even with limited context memory.
Figure 1: A human player is playing DOOM on GameNGen at 20 FPS. See https://gamengen.github.io for demo videos.
Figure 1: A human player is playing DOOM on GameNGen at 20 FPS. See https://gamengen.github.io for demo videos.

Experimental results

Research questions

  • RQ1Can a diffusion model generate high-quality, long-horizon video sequences of a complex game in real time, conditioned on a stream of actions?
  • RQ2How can autoregressive video generation be stabilized over long trajectories when conditioned on sequential actions?
  • RQ3To what extent can a neural model learn and persist game state (e.g., health, ammo, level progress) without explicit state representation?
  • RQ4Can a neural model simulate a full game engine’s behavior—including state transitions and rendering—without hard-coded logic?

Key findings

  • GameNGen achieves real-time simulation of DOOM at over 20 FPS on a single TPU, demonstrating feasibility of neural game engines.
  • The model reaches a PSNR of 29.4 on next-frame prediction, comparable to lossy JPEG compression, indicating high visual fidelity.
  • Human raters are only slightly better than random chance at distinguishing real gameplay clips from GameNGen-generated clips, indicating strong perceptual realism.
  • The model maintains game state persistence over long trajectories despite a context length of only ~3 seconds, suggesting effective learning of game mechanics from visual cues.
  • Noise-augmented conditioning significantly improves stability during autoregressive generation, reducing sampling divergence.
  • The model generalizes to unseen game areas and interactions, though some behaviors (e.g., exploration) remain imperfect due to limited memory and training coverage.
Figure 2: GameNGen compared to prior state-of-the-art simulations of DOOM.
Figure 2: GameNGen compared to prior state-of-the-art simulations of DOOM.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.