Hierarchically Composing Level Generators for the Creation of Complex Structures

Michael Beukman, Manuel Fokam, Marcel Kruger, Guy Axelrod, Muhammad Umair Nasir, Branden Ingram, Benjamin Rosman, Steven James

TL;DR

MCHAMR (Multi-level Composition of Hierarchical and Adaptive Models via Recursion) is a new framework that builds complex game levels by recursively nesting simple, independently trained generators. By breaking down a massive task—like building a functional city—into manageable sub-tasks like "build a house" or "layout a garden," the system creates large-scale, coherent structures that far outperform traditional, monolithic generation methods.

What Problem Does This Paper Address?

Procedural Content Generation (PCG) is a "holy grail" for game development, promising infinite content at a fraction of the cost. However, most current PCG excels only at simple 2D tilemaps (think Super Mario Bros. or Zelda). When applied to complex 3D environments like Minecraft, traditional methods struggle.

The core issue is the objective function. It is incredibly difficult to write a single mathematical formula that defines what makes a "good" city. If you try to evolve a city all at once, the search space is too vast, often resulting in "unplayable" messiness. Furthermore, training a single model to handle everything from the placement of a single flower to the layout of a highway is computationally expensive and lacks flexibility; if you want to change the house style, you usually have to retrain the entire system.

Methods

The authors introduce MCHAMR, which treats level generation as a recursive tree structure.

  1. Hierarchical Composition: Instead of one giant generator, MCHAMR uses a hierarchy. A top-level generator creates an abstract "town map." Each tile in that map (e.g., "House," "Road") acts as a pointer to a lower-level generator specialized for that specific component.
  2. Recursive Generation: This process can repeat indefinitely. A "Town" tile might point to a "Neighborhood" generator, which points to a "House" generator, which finally points to a "Room" generator.
  3. Coalescing: To avoid a repetitive "grid-like" look, the system identifies adjacent tiles of the same type and merges them into larger "logical" rectangles. This allows the sub-generators to create structures of varying scales (e.g., a long rectangular garden vs. a small square one).
  4. Base Generator (PCGNN): While MCHAMR is generator-agnostic, the authors use PCGNN (Procedural Content Generation via Neural Networks). This method uses NeuroEvolution of Augmenting Topologies (NEAT) and novelty search to evolve neural networks that can generate diverse, functional tiles based on their neighbors.

Datasets

The paper doesn't use a standard static dataset. Instead, it operates in generative environments:

  • 2D Tilemap Town-builder: A custom environment used for quantitative benchmarking of fitness and complexity.
  • Minecraft (via Evocraft): A 3D voxel environment used to demonstrate the system's ability to create complex, multi-component settlements (houses with walls/roofs, roads, and ponds).

Key Insights and Ideas

  • Factorization is King: By breaking the problem into independent components, the authors turn an $O(n^2)$ training problem into an $O(n)$ one. Training two small generators is significantly faster and more effective than training one massive one.
  • Designer Interpretability: This approach gives designers "knobs" to turn. A designer can swap out the "House" generator for a "Castle" generator without touching the "City Layout" generator.
  • Abstraction Simplifies Optimization: The high-level generator doesn't need to know how to build a roof; it only needs to know that "House" tiles should be near "Road" tiles. This makes the fitness functions much easier to write and optimize.
  • Functional Coherence: By using specialized fitness functions for sub-components (e.g., "a house must have an empty interior"), the final composed structure inherits these functional properties, ensuring playability at scale.

Key Results

  • Superior Fitness: In head-to-head tests, MCHAMR achieved significantly higher fitness scores than "flat" (non-compositional) baselines. As the complexity of the task increased, the gap between MCHAMR and the baseline widened.
  • Massive Scale: The system successfully generated coherent settlements in Minecraft exceeding 100,000 blocks ($200 \times 5 \times 200$), featuring distinct houses, gardens, and interconnected road networks.
  • Diversity via Novelty Search: By incorporating KL-Divergence and Hamming distance metrics into the evolution process, the system generated multiple distinct town layouts (e.g., some with central gardens, others with perimeter housing) from the same underlying rules.

Limitations and Future Work

  • The "Blocky" Aesthetic: Because the system relies on a rectangular grid and coalescing, the resulting structures can still look somewhat "boxy" or discretized.
  • Verticality: The current implementation primarily uses 2D generators as the "root," meaning it lacks true 3D verticality (like multi-story skyscrapers or mountain-side villages).
  • Neighbor Blindness: Sub-generators are currently oblivious to what their neighbors are doing. This can lead to "incoherent boundaries" where a house and a garden don't blend naturally. The authors suggest "context-aware" generators as a future fix.
  • Manual Hierarchy: A human still needs to define the hierarchy and the fitness functions for each level. Automating the discovery of these sub-tasks remains an open challenge.

Summary updated

BibTeX
@article{beukman2024hierarchically,
  author = {Michael Beukman and Manuel Fokam and Marcel Kruger and Guy Axelrod and Muhammad Umair Nasir and Branden Ingram and Benjamin Rosman and Steven James},
  title = {{Hierarchically Composing Level Generators for the Creation of Complex Structures}},
  journal = {IEEE Trans. Games},
  year = {2024},
  doi = {10.1109/tg.2023.3297619},
}
Figure