Abstract
This research introduces a framework for video game level design that leverages the latent spaces of Generative Adversarial Networks (GANs). By integrating Interactive Latent Variable Evolution (LVE) with direct manual exploration, the system enables users to "breed" and "sculpt" levels for Super Mario Bros. and The Legend of Zelda. This approach addresses the quality-diversity trade-off in procedural content generation, allowing for the discovery of aesthetically pleasing and functional levels that automated systems often overlook.
Introduction
Procedural Content Generation (PCG) frequently faces a conflict between quality and diversity. While GANs can learn the stylistic nuances of existing game levels, they lack an inherent understanding of game mechanics, often producing visually consistent but unplayable results. Furthermore, defining "creativity" or "fun" mathematically is difficult. This paper proposes a "human-in-the-loop" system where users guide the AI through the latent space of a pre-trained GAN to find levels that are both playable and creatively satisfying.
Methods: Interactive Latent Variable Evolution
The core of the system is Interactive Latent Variable Evolution (LVE). Rather than evolving raw tile grids—which often results in incoherent noise—the system evolves the latent vectors of a pre-trained Wasserstein GAN (WGAN). These vectors act as a compressed "DNA" for level segments.
The system provides three primary modes of interaction:
- Selective Breeding: Users view a population of 20 level sketches and select favorites to produce the next generation via crossover and mutation.
- Manual Exploration: A slider-based interface allows users to directly modify numerical values in the latent vector, observing real-time changes in the level layout.
- Interpolation: Users can select two distinct levels and "blend" them by traversing the linear path between their vectors in latent space.
To ensure the GAN understands the game world, levels are represented as a multi-dimensional array of tile types, mapping game elements to specific symbols and numerical values.
Datasets and Implementation
The models were trained using the Video Game Level Corpus (VGLC):
- Super Mario Bros.: 12 overworld levels were processed into 28x14 tile segments.
- The Legend of Zelda: 18 dungeon files were used, focusing on 38 unique room layouts. For Zelda, a graph grammar was employed to stitch GAN-generated rooms into cohesive dungeons.
The generated content is rendered and tested using the Mario AI Framework and a custom rogue-like engine.
Key Insights
- GANs as a "Safety Net": Because the GAN is trained on human-designed levels, most points in the latent space correspond to "valid-looking" levels. This reduces the frustration typical of interactive evolution, where random mutations often produce unplayable "garbage."
- Serendipitous Discovery: Human intuition allows for the discovery of unique gameplay scenarios. For example, one user found a Mario level only beatable if the player intentionally took damage to become "small" to fit through a narrow gap—a nuance an automated fitness function might miss.
- The Challenge of Latent Space: Users noted that latent dimensions are often not intuitive; moving a slider might change a staircase into a pipe rather than simply adding more enemies. This highlights the need for more "disentangled" representations in future work.
Results and User Study
A study involving 22 participants revealed strong preferences for the hybrid system:
- 61.9% of users preferred direct latent exploration (sliders/interpolation) over pure selective breeding.
- 63.64% of participants found that the combination of evolution and manual exploration yielded the "coolest" levels.
- Efficiency: High-quality, playable levels were typically discovered within five-minute sessions, demonstrating the tool's utility for rapid prototyping.
Conclusion
While the GAN-based approach significantly improves the quality of generated levels, challenges remain regarding perfect playability (e.g., isolated walls or floating items). Future research will focus on "constrained" GANs to map latent sliders to specific semantic features like difficulty or density, and hybrid encoding methods that allow for direct tile-level editing.
Summary updated