Playable Game Generation

Mingyu Yang, Junyou Li, Zhongbin Fang, Sheng Chen, Yangbin Yu, Qiang Fu, Wei Yang, Deheng YearXiv 2024

Abstract

In recent years, Artificial Intelligence Generated Content (AIGC) has advanced from text-to-image generation to text-to-video and multimodal video synthesis. However, generating playable games presents significant challenges due to the stringent requirements for real-time interaction, high visual quality, and accurate simulation of game mechanics. Existing approaches often fall short, either lacking real-time capabilities or failing to accurately simulate interactive mechanics. To tackle the playability issue, we propose a novel method called PlayGen, which encompasses game data generation, an autoregressive DiT-based diffusion model, and a comprehensive playability-based evaluation framework. Validated on well-known 2D and 3D games, PlayGen achieves real-time interaction, ensures sufficient visual quality, and provides accurate interactive mechanics simulation. Notably, these results are sustained even after over 1000 frames of gameplay on an NVIDIA RTX 2060 GPU.

Introduction

While AI has mastered generating static images and short videos, creating a playable game represents a significantly higher technical hurdle. A generated game must satisfy three core "playability" pillars: real-time interaction, visual fidelity, and accurate mechanics. The engine must respond to user inputs (e.g., jump, fire, move) instantly, and the generated frames must maintain the visual identity of the game while adhering to complex rules. For instance, if a player presses "jump" in a platformer, the character must move upward; if a character consumes a power-up, the game state must reflect that change consistently.

Overview of PlayGen's interactive capabilities and mechanical accuracy in 2D and 3D environments.

Existing models often struggle with "memory," forgetting the world state after a few seconds, or failing to simulate rare but critical game rules because training data is typically dominated by common, repetitive actions. PlayGen addresses these issues by moving away from computationally expensive Large Language Models (LLMs) in favor of a more efficient diffusion-based approach.

Methodology

The PlayGen framework consists of three main components: a data generation pipeline, a generative model, and a playability-based evaluation system.

Generative Architecture

PlayGen utilizes a Variational Autoencoder (VAE) to compress game frames into a latent space, followed by a Latent Diffusion Model (LDM) with a Diffusion Transformer (DiT) backbone. To prevent the model from losing track of the game state over time, the researchers implemented a structure inspired by Recurrent Neural Networks (RNNs) called Diffusion Forcing. This allows the model to condition the next frame on a hidden state that summarizes the entire session history, theoretically enabling infinite gameplay without the memory explosion common in standard transformers.

The PlayGen framework architecture, including data generation, the generative model, and playability evaluation.

Data Strategy

To overcome the "imbalance trap"—where models fail to learn rare events like character death or secret discovery because they are underrepresented in raw data—PlayGen employs Balanced Data Sampling. By clustering gameplay data, the model is exposed to a wider variety of transitions. Furthermore, Self-Supervised Long-Tailed Learning uses a priority queue to force the model to train more intensively on "high-loss" transitions where it is most likely to misunderstand game rules.

Datasets and Evaluation

The framework was validated on two iconic benchmarks:

  • Super Mario Bros (2D): Trained on 50 million balanced transitions sampled from 236 million frames.
  • Doom (3D): Trained on 200 million balanced transitions sampled from 900 million frames.

Standard computer vision metrics like PSNR or FID are insufficient for measuring playability. Consequently, the authors introduced ActAcc (Action Accuracy) and ProbDiff. These metrics utilize a separate "Valid Action Model" to verify if the generated video sequences accurately reflect the player's specific inputs.

Key Results

PlayGen demonstrates significant advancements in both performance and stability:

  • Real-Time Performance: The model achieves 20 FPS on an NVIDIA RTX 2060, making AI-generated gameplay accessible on consumer-grade hardware.
  • Long-Term Stability: Unlike previous models that hallucinate or crash after 64 frames, PlayGen maintains consistent mechanics and visuals for over 1,000 frames.
  • Mechanical Fidelity: In Super Mario Bros, the model achieved an Action Accuracy (ActAcc) of over 0.8, indicating it correctly executes player intent in the vast majority of scenarios.

Conclusion

PlayGen represents a step forward in real-time AIGC for gaming, proving that diffusion-based models can simulate complex interactive environments with high mechanical accuracy. Future work will focus on scaling these techniques to high-definition AAA graphics, enabling text-based prompt customization of game worlds, and simulating more intricate narrative and inventory logic.

Summary updated

BibTeX
@misc{yang2024playable,
  author = {Mingyu Yang and Junyou Li and Zhongbin Fang and Sheng Chen and Yangbin Yu and Qiang Fu and Wei Yang and Deheng Ye},
  title = {{Playable Game Generation}},
  year = {2024},
  eprint = {2412.00887},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2412.00887},
}
Figure