Controllable Level Blending between Games using Variational Autoencoders

Anurag Sarkar, Zhihan Yang, Seth CooperarXiv 2020

Introduction

In the field of Procedural Content Generation (PCG), a long-standing goal is to develop systems that understand the underlying "DNA" of game design rather than simply randomizing assets. This research by Anurag Sarkar, Zhihan Yang, and Seth Cooper explores the use of Variational Autoencoders (VAEs) to blend the distinct styles of Super Mario Bros. (SMB) and Kid Icarus (KI), two classic platformers with fundamentally different structural philosophies.

The Challenge of Game Blending

Traditional Procedural Content Generation via Machine Learning (PCGML) typically focuses on a single game. While previous attempts at blending games existed—such as using LSTMs to alternate between chunks of different games—they often resulted in "chunky" transitions. These methods struggled to mix elements within a single level segment, such as placing a Kid Icarus hazard within a Mario-style platform layout. Furthermore, popular generative models like Generative Adversarial Networks (GANs) are notoriously difficult to control, making it hard for designers to specify desired level properties like difficulty or density.

To address these issues, the researchers employed Variational Autoencoders (VAEs). A VAE consists of an Encoder, which compresses a 16x16 level segment into a low-dimensional (64-D) latent vector, and a Decoder, which reconstructs the level from that vector. Because VAEs learn a continuous, compressed representation, the "latent space" between a Mario segment and a Kid Icarus segment contains valid, blended levels.

To provide designers with control, the authors used CMA-ES (Covariance Matrix Adaptation Evolutionary Strategy). This evolutionary algorithm searches the VAE's latent space to find vectors that maximize specific "fitness" functions, such as target tile density or a specific mix of game styles. The study utilized the Video Game Level Corpus (VGLC), focusing on horizontal segments from Super Mario Bros. and vertical segments from Kid Icarus.

Key Insights: VAEs vs. GANs

A critical finding of the study is that VAEs are significantly better at capturing the "middle ground" between games. While GANs tend to polarize—generating segments that look almost entirely like one game or the other—VAEs capture the structural nuances of both. Approximately 18% of VAE-generated segments were identified as true blends, compared to only 8% for GANs.

GAN models exhibit significant polarization, predominantly generating segments that are almost exclusively one game or the other, as shown by the high counts at the extremes of the SMB proportion scale.

Furthermore, the VAE's encoder allows designers to feed an existing level into the system and perform "vector math" to tweak its properties, a feature not easily available in standard GANs. Interestingly, while GANs could hit extreme targets (like 100% tile density), they often did so by ignoring game structural rules. VAEs, by contrast, seemed to capture and respect underlying design constraints more effectively.

Results: Proportional Blending and Control

The researchers successfully evolved level segments that met specific targets for Density (solid tiles), Difficulty (enemies and hazards), and Non-Linearity (topological deviation). The VAE was uniquely capable of generating segments with precise "SMB Proportions," allowing for a smooth transition from 100% Mario to 100% Kid Icarus.

The VAE model successfully generates segments across the entire spectrum of game proportions while allowing for control over density, difficulty, and non-linearity.

Qualitative analysis showed that these blended segments maintained the visual fidelity and "feel" of the source games, successfully mixing elements like Mario's pipes with Kid Icarus's moving platforms.

Limitations and Future Work

The primary limitation is playability. The current model generates tiles based on visual patterns but does not guarantee that a level is beatable. Future work aims to integrate playability constraints into the evolutionary search, explore "vector math" for feature transfer (e.g., adding verticality to a horizontal level), and expand the system to blend different genres, such as platformers and action-adventure games.

Reference: Sarkar, A., Yang, Z., & Cooper, S. (2020). Controllable Level Blending between Games using Variational Autoencoders. arXiv preprint arXiv:2002.11869.

Summary updated

BibTeX
@misc{sarkar2020controllable,
  author = {Anurag Sarkar and Zhihan Yang and Seth Cooper},
  title = {{Controllable Level Blending between Games using Variational Autoencoders}},
  year = {2020},
  eprint = {2002.11869},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.11869},
}
Figure