Abstract
Generative Adversarial Networks (GANs) for procedural content generation in games often struggle with data scarcity and functional constraints. This paper introduces CESAGAN (Conditional Embedding Self-Attention GAN), which utilizes self-attention to capture long-range dependencies and a bootstrapping process to iteratively expand training data with playable generated levels. Experiments on the game Zelda demonstrate that this approach significantly improves playability and diversity, even when starting with as few as five human-designed levels.
Introduction
Procedural Content Generation via Machine Learning (PCGML) faces unique challenges compared to standard image generation. First, high-quality training data is often scarce; classic games like Super Mario Bros. contain only a handful of levels. Second, game levels must satisfy strict functional constraints—such as reachability of goals—to be considered valid. A "smudged" pixel in a face is acceptable, but a missing key in a level renders it unplayable. Game levels are more like program code than images; they must function to be valuable.
Methodology
The proposed system, CESAGAN, addresses these hurdles through two primary architectural and procedural innovations.
CESAGAN Architecture
The model incorporates Self-Attention to manage long-range dependencies, such as the spatial relationship between a key and its corresponding door. Unlike standard convolutions that focus on local neighborhoods, self-attention allows the network to coordinate distant tiles simultaneously. Additionally, Conditional Embeddings allow designers to specify desired level features (e.g., enemy counts) via feature vectors.
Bootstrapping Training
To overcome data scarcity, the authors employ a bootstrapping loop. Starting with a small initial set of human-made levels, the generator produces new candidates. These are passed through a playability filter (using A* search and simple heuristics). Levels that are both playable and unique are added back into the training corpus, creating a virtuous cycle where the GAN effectively teaches itself using its own best successes.
Experimental Setup
The framework was tested using the game Zelda from the General Video Game AI (GVGAI) suite. Two datasets were used to evaluate the model's robustness:
- Dataset A: 45 human-designed levels.
- Dataset B: A "stress test" consisting of only 5 human-designed levels to test if bootstrapping can overcome extreme data scarcity.
Results and Discussion
CESAGAN demonstrated superior performance over baseline GANs across multiple metrics, particularly in low-data scenarios.
Playability and Diversity
In the 5-level stress test, standard GANs produced playable levels only 24.6% of the time, with 98% being duplicates (mode collapse). In contrast, CESAGAN with bootstrapping achieved 47% playability and reduced duplicates to 60.3%. With the larger 45-level dataset, playability reached 58%, nearly tripling the baseline's 19.4%.
Structural Integrity
Analysis using Hamming distance confirmed that the model explores a wider design space rather than merely memorizing training data. The self-attention mechanism proved mathematically superior at maintaining the "Avatar-Key-Door" structural logic required for Zelda levels, resulting in higher visual diversity and more varied wall and enemy placements.
Conclusion
By treating playability as a verifiable constraint and using it to bootstrap training data, CESAGAN effectively mitigates the "small data" problem in game design. While currently dependent on game-specific heuristics for playability filtering, future work aims to use more sophisticated AI agents to handle complex games where playability is harder to define algorithmically.
Summary updated