Abstract
This survey explores Procedural Content Generation via Machine Learning (PCGML), defined as the generation of game content using machine learning models trained on existing content. As the importance of PCG for game development increases, researchers explore new avenues for generating high-quality content with or without human involvement; this paper addresses the relatively new paradigm of using machine learning (in contrast with search-based, solver-based, and constructive methods). We focus on what is most often considered functional game content such as platformer levels, game maps, interactive fiction stories, and cards in collectible card games, as opposed to cosmetic content such as sprites and sound effects. In addition to using PCG for autonomous generation, co-creativity, mixed-initiative design, and compression, PCGML is suited for repair, critique, and content analysis because of its focus on modeling existing content. We discuss various data sources and representations that affect the resulting generated content. Multiple PCGML methods are covered, including neural networks, long short-term memory (LSTM) networks, autoencoders, and deep convolutional networks; Markov models, $n$-grams, and multi-dimensional Markov chains; clustering; and matrix factorization. Finally, we discuss open problems in the application of PCGML, including learning from small datasets, lack of training data, multi-layered learning, style-transfer, parameter tuning, and PCG as a game mechanic.
Introduction
Traditional Procedural Content Generation (PCG) has historically relied on "constructive" methods, such as grammars, or "search-based" methods, such as evolutionary algorithms. While these approaches are effective, they require designers to manually codify every rule, constraint, and objective—a labor-intensive process that is difficult to scale.
Procedural Content Generation via Machine Learning (PCGML) addresses this by automating the design process. By leveraging the recent explosion in machine learning, researchers aim to create systems that can analyze existing game levels or stories and "learn" the underlying patterns to produce new, authentic content. A unique challenge in this domain is functionality: unlike generated images, game content must be playable and structurally sound (e.g., a platformer level must be beatable).
A Taxonomy of PCGML Methods
The field of PCGML can be organized across two primary dimensions: data representation and training methodology.
Data Representation
- Sequences: Content like levels or cards are treated as strings of text, often processed by LSTMs.
- Grids: Levels are represented as 2D or 3D arrays, suitable for Markov Random Fields or Convolutional Neural Networks (CNNs).
- Graphs: These represent high-level topology, such as the flow of a dungeon or branching narrative paths.
Training Methods
- Frequency Counting: Utilizing n-grams and Markov Chains to predict the next "tile" or element based on local context.
- Backpropagation: Employing Deep Learning architectures (LSTMs, Autoencoders, CNNs) to capture complex, long-range dependencies.
- Evolution: Using NeuroEvolution (e.g., NEAT) to evolve functional scaffolding for content placement.
- Matrix Factorization: Applying techniques like Non-negative Matrix Factorization (NNMF) to extract and recombine latent stylistic patterns.
Datasets and Data Scarcity
A significant hurdle in PCGML is the scarcity of data compared to other ML fields. Key resources include:
- The Video Game Level Corpus (VGLC): A collection of levels from 12 classic games (e.g., Super Mario Bros., The Legend of Zelda) converted into parseable formats.
- Magic: The Gathering: Large corpora of card text used for sequence-to-sequence learning.
- Crowdsourced Narratives: Datasets like Scheherazade that collect simple stories via platforms like Amazon Mechanical Turk.
- Gameplay Video: Extracting level data directly from YouTube playthroughs using computer vision techniques.
Key Insights and Applications
PCGML offers capabilities beyond simple autonomous generation:
- Direct Generation: Models can generate content directly from a learned distribution, often making them faster at runtime than search-based methods.
- Content Repair: Denoising Autoencoders can "fix" unplayable level segments by projecting them back onto the space of valid levels seen during training.
- Style Interpolation: By using matrix factorization or latent variable models, researchers can blend different game styles, such as creating a level that is a hybrid of Mario and Kid Icarus.
- The Ergodic Challenge: Games are "ergodic" media, requiring non-trivial effort to traverse. A statistically likely level may still fail if a single-pixel gap makes it unbeatable, highlighting the need for functional awareness in models.
Results and Performance
Research has shown that even simple models can yield impressive results. For instance, n-grams (with $n=2$ or $3$) are surprisingly effective at generating well-shaped Mario levels with minimal computational overhead.
Furthermore, combining LSTMs with player path data allows models to learn the "flow" of a level, ensuring the generated geometry supports human play patterns. In dungeon generation, Bayesian Networks have successfully learned high-level topologies, ensuring logical consistency such as placing keys before the doors they unlock.
Challenges and Future Directions
Despite its promise, PCGML faces several open problems:
- Small Data Problem: Most games have only a few dozen levels, whereas ML typically requires thousands. "One-shot learning" is a critical frontier.
- Playability Constraints: Most current models still require hand-crafted checkers to ensure beatability. Integrating playability directly into loss functions (e.g., via GANs) remains a challenge.
- Style Transfer for Mechanics: While visual style transfer is mature, transferring the "style" of gameplay mechanics—how a character moves or jumps—is significantly more difficult.
- PCG as a Mechanic: Future applications may see ML models as live participants, adapting levels to a player's skill in real-time.
Summary updated