Quality Diversity in the Amorphous Fortress (QD-AF): Evolving for Complexity in 0-Player Games

Sam Earle, Megan Charity, Dipika Rajesh, Mayu Wilson, Julian TogeliusarXiv 2023 · DOI

Introduction

Training robust Reinforcement Learning (RL) agents requires environments that are both diverse and sufficiently challenging. While procedural content generation (PCG) offers a path toward infinite variety, it often struggles to produce meaningful complexity, frequently generating "noise" rather than structured, interactive dynamics. This research introduces QD-AF, a system that leverages Quality Diversity (QD) algorithms to evolve complex, self-sustaining ecosystems within a grid-world simulation called Amorphous Fortress (AF).

The authors focus on 0-player games—simulations like Conway’s Game of Life where the rules and initial state entirely dictate the outcome. The goal is to find the "Goldilocks zone" of simulation rules: settings that avoid both immediate extinction and infinite population explosions, instead fostering stable, emergent ecological dynamics such as competition and cooperation.

The Amorphous Fortress Framework

The Amorphous Fortress (AF) framework is a grid-world environment where different species of agents interact based on Finite State Machines (FSMs). In this setup, each node in an FSM represents a specific action (e.g., move, take, transform), and edges represent conditional transitions based on environmental stimuli (e.g., "if adjacent to species X, transition to 'take'"). These FSMs serve as the "brains" of the entity classes, determining how they react to their surroundings and to each other.

Evolutionary Methodology: MAP-Elites

To discover interesting and stable simulations, the researchers employ MAP-Elites, a prominent Quality Diversity algorithm. Unlike standard optimization, which seeks a single global optimum, QD algorithms aim to populate an archive with the highest-performing versions of many different types of solutions.

The MAP-Elites evolutionary loop selects for high-fitness fortresses across diverse behavior combinations through mutation and selection.

Behavior Characteristics and Fitness

The search space is mapped across two primary Behavior Characteristics (BCs):

  1. Structural Complexity (X-Axis): The total number of nodes across all species' FSMs.
  2. Population Dynamics (Y-Axis): The total number of entity instances alive at the end of the simulation.
Behavior Characteristics (BCs) are calculated by summing FSM nodes for complexity and counting final entity instances for population dynamics.

A fortress's fitness is determined by how much of its "brain" is actually utilized. A fortress is considered fit if a high proportion of its FSM nodes and edges are triggered during the simulation, which encourages the evolution of functional behaviors rather than redundant "dead code."

Key Insights and Results

The QD-AF approach successfully filled nearly the entire MAP-Elites archive, demonstrating its ability to generate a vast spectrum of environments, from barren deserts to overpopulated scenarios. Several key findings emerged from the evolutionary runs:

  • The Harmony of the Middle: The most stable ecosystems—those reaching a true ecological equilibrium—were typically found in the center of the archive. These environments featured species that co-existed in a balance, avoiding the total dominance or collapse seen at the extremes.
  • Complexity and Diversity: High-entropy FSM distributions, where some species were simple and others complex, were more likely to result in thorough behavioral exploration. This suggests that healthy ecosystems benefit from a mix of "specialists" and "generalists."
  • Emergent Life Blocks: By rewarding FSM exploration, the process naturally discovered fundamental survival strategies like hunting, reproduction, and transformation without explicit human programming.
  • Efficiency vs. Complexity: Interestingly, fortresses with fewer total FSM nodes often achieved higher fitness scores. Within the 100-step simulation limit, it is easier for the environment to fully utilize a smaller, streamlined FSM than a highly complex one.

Limitations and Future Work

While QD-AF effectively generates diverse 0-player games, several challenges remain. The current simulations are limited to 100 steps on a small 15x8 grid due to computational costs. Larger maps and longer durations would likely reveal even more sophisticated behaviors but require GPU acceleration.

The ultimate goal of this work is to "close the loop" by injecting RL agents into these evolved fortresses. These 0-player games can serve as an automated curriculum, challenging agents to survive or manipulate existing, stable ecosystems that were discovered through evolution rather than manual design.

Summary updated

BibTeX
@misc{earle2023quality,
  author = {Sam Earle and Megan Charity and Dipika Rajesh and Mayu Wilson and Julian Togelius},
  title = {{Quality Diversity in the Amorphous Fortress (QD-AF): Evolving for Complexity in 0-Player Games}},
  year = {2023},
  eprint = {2312.02231},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2312.02231},
}
Figure