Search-Based Exploration and Diagnosis of TOAD-GAN

Maria Edwards, Ming Jiang, Julian Togelius

Abstract

Generative Adversarial Networks (GANs) have revolutionized procedural content generation, yet "one-shot" models like TOAD-GAN often suffer from a lack of control and functional reliability. This study introduces Latent Space Evolution (LSE) to systematically explore and diagnose TOAD-GAN. By employing the CMA-ES evolutionary algorithm and a random network projection to navigate the high-dimensional latent space, the researchers demonstrate the ability to generate 100% playable levels, maximize specific gameplay features, and identify visual artifacts.

Introduction

Procedural Content Generation (PCG) in video games traditionally relies on hand-crafted rules or large datasets for machine learning. TOAD-GAN (Token-based One-shot Arbitrary Dimension GAN) represents a significant shift, learning to generate novel levels from a single training image. However, as a "black box" model, TOAD-GAN frequently produces unplayable content—such as gaps that cannot be jumped or floating pipes. This research addresses the need for diagnosis and control, seeking methods to steer the generator toward specific functional requirements without retraining the underlying model.

Methods: Latent Space Evolution

The core methodology involves Latent Space Evolution (LSE). Rather than sampling the GAN's latent space randomly, the authors use CMA-ES (Covariance Matrix Adaptation Evolution Strategy) to search for noise vectors that optimize specific fitness functions.

The LSE pipeline uses a randomly initialized neural network to project a 100-dimensional feature vector into the high-dimensional noise space required by TOAD-GAN.

A primary technical challenge is the dimensionality of TOAD-GAN’s latent space, which can exceed 99,000 dimensions. To make the search feasible for CMA-ES, the authors implemented a Random Network Projection. A manageable 100-dimensional input vector is passed through a randomly initialized, non-trained neural network to expand it into the high-dimensional space required by the generator.

Fitness is evaluated based on:

  • Playability: Assessed via an automated A* pathfinding agent.
  • Similarity: Measured through Hamming Distance and Tile-Pattern KL Divergence to ensure the output remains recognizable.
  • Visual Features: Targeted counts of specific tiles or enemies.

Datasets and Training

The experiments primarily utilized levels from Super Mario Bros. as training inputs. The most prominent example is Mario Level 1, which serves as the baseline for testing playability and enemy density.

The original Mario Level 1 used as the primary training sample for the one-shot GAN.

Additionally, Mario Level 3 was used to evaluate the method's performance on levels with distinct structural characteristics, such as verticality and tree-based platforms.

Key Insights and Results

The research yielded several critical insights into the behavior of one-shot GANs:

The Standardization Effect

The authors discovered that standardizing the noise vector (setting a mean of 0 and standard deviation of 1) before it reaches the GAN significantly improves the similarity of the output to the training data. Without this constraint, the generator tends to "drift," producing more unique but often structurally unsound levels.

Playability and Variety

Surprisingly, the search algorithm found it easier to locate 100% playable levels than highly unplayable ones. This suggests that TOAD-GAN inherently captures the "flow" of the training level effectively. Furthermore, the search successfully pushed the GAN to its limits, generating levels with up to 88 enemies—a nearly six-fold increase over the original training sample.

Diagnosis and Correction

By optimizing for "broken" features, such as pipes floating in midair, the researchers could diagnose specific failure modes in the GAN's logic. By combining these diagnostic metrics with playability constraints, they could "fix" the generator's output, ensuring levels were both functional and visually coherent without the need for expensive retraining.

Conclusion

This work demonstrates that evolutionary search is a powerful tool for controlling and understanding "black box" generative models. While the current A* agent has limitations in simulating human-like movement, and the search process is computationally intensive, the ability to enforce functional constraints on one-shot generators opens new doors for reliable PCG. Future research will focus on integrating these constraints directly into the training phase and expanding the approach to other game genres.

Summary updated

BibTeX
@inproceedings{edwards2021search,
  author = {Maria Edwards and Ming Jiang and Julian Togelius},
  title = {{Search-Based Exploration and Diagnosis of TOAD-GAN}},
  booktitle = {AIIDE},
  year = {2021},
}
Figure