Conditional Level Generation and Game Blending

Anurag Sarkar, Zhihan Yang, Seth Cooper

Abstract

This research explores the application of Conditional Variational Autoencoders (CVAEs) to enhance controllability in Procedural Content Generation via Machine Learning (PCGML). By conditioning the generation process on specific labels representing game elements, design patterns, and game identity, the authors demonstrate a method for designers to specify desired features directly. Results show high fidelity in generating single-game segments and the ability to perform "zero-shot" game blending by interpolating between labels across classic NES titles.

Introduction

Procedural Content Generation via Machine Learning (PCGML) has traditionally relied on models like GANs or standard VAEs to learn the latent representations of game levels. While these models create a continuous space of possible levels, navigating that space to find a specific type of level (e.g., a segment with three pipes and a hidden coin) usually requires complex post-hoc optimization, such as evolutionary search. This paper addresses the lack of direct controllability by moving from "searching" the latent space to "specifying" the output through conditional modeling.

Methodology

The researchers utilized Conditional Variational Autoencoders (CVAEs) to provide designers with label-based control. Unlike a standard VAE, which compresses a level into a latent vector for reconstruction, a CVAE provides both the encoder and decoder with an additional "label" (a binary vector) during training. This forces the model to learn the relationship between the level structure and its specific attributes.

Figure 3: Examples of generated segments for Super Mario Bros (SMB), Kid Icarus (KI), and Mega Man (MM) with their corresponding binary labels.

Datasets and Conditioning

The study utilized the Video Game Level Corpus (VGLC), focusing on three classic NES titles: Super Mario Bros. (SMB), Kid Icarus (KI), and Mega Man (MM). Levels were processed into 16x16 tile segments using a sliding window approach. Three conditioning strategies were tested:

  1. Game Elements: Presence of specific objects like pipes, ladders, or enemies.
  2. Design Patterns: Higher-level architectural concepts such as "Enemy Horde" or "Staircase."
  3. Game Blending: Labels indicating game identity, allowing for "hybrid" labels that mix styles.

Key Insights and Results

One of the most compelling findings is the "Edit" affordance: an existing level segment can be encoded into the latent space and then decoded using a different label. This allows for "semantic editing," such as taking a Mario segment and "Mega Man-ifying" it while preserving the underlying structural layout.

Controllability and Reliability

The model's performance was evaluated based on "Exact Matches," where the generated segment contains precisely the elements requested. For Kid Icarus, the model achieved an Exact Match rate of 50.7%. Performance was notably higher for labels that appeared frequently in the training data, while rare combinations proved more challenging for the model to synthesize accurately.

Figure 5: Match percentage across different class labels, comparing exact matches to cases where no requested elements were generated.

Zero-Shot Blending

By using labels like $\langle 110 \rangle$ (indicating a mix of Mario and Kid Icarus), the model can generate blended content even if it never encountered a "hybrid" level during training. The CVAE treats the label as a set of continuous features, effectively interpolating between game styles. A separate classifier confirmed this blending, identifying hybrid segments as containing visual and structural elements from multiple source games.

Limitations and Future Work

While successful, the approach faces a manual labeling bottleneck for complex "Design Patterns." Additionally, while 16x16 segments are generated with high fidelity, they do not yet guarantee cohesive "flow" when stitched into full-length levels. Future work aims to combine this CVAE approach with sequential models to generate full, playable levels that maintain structural consistency across segments.

Summary updated

BibTeX
@inproceedings{sarkar2020conditional,
  author = {Anurag Sarkar and Zhihan Yang and Seth Cooper},
  title = {{Conditional Level Generation and Game Blending}},
  booktitle = {AIIDE Workshops},
  year = {2020},
  url = {https://openreview.net/forum?id=t4nmOjFH1G},
}
Figure