Automatic Game Design via Mechanic Generation

Alexander Zook, Mark O. Riedl · OpenReview

Abstract

While procedural content generation (PCG) has successfully automated the creation of game levels and assets, the underlying rules—the mechanics—remain largely hand-coded. This paper presents a framework for the de novo synthesis of game mechanics by representing them as AI planning operators. Using a "generate-and-test" loop driven by Answer Set Programming (ASP) and AI planning, the system can automatically generate functional, playable mechanics for RPGs, platformers, and hybrid genres while ensuring the resulting games meet specific design and playability requirements.

Introduction: The Challenge of Mechanic Synthesis

In the field of Procedural Content Generation, creating infinite forests or dungeons is a solved problem. However, the mechanics—the logic governing state changes—are brittle. A minor change in jump height or mana cost can render a game impossible or trivial. Previous attempts at automated game design often relied on selecting from pre-defined templates. This research tackles the "holy grail" of game design: synthesizing the logic of mechanics from low-level primitives (e.g., variable updates) to ensure the resulting game is both functional and winnable.

Methodology

The authors treat game design as a search problem over the space of possible logic rules, utilizing three primary pillars:

  1. Mechanic Representation: Mechanics are modeled as planning operators, similar to the Planning Domain Description Language (PDDL). This is extended with time-indexing for delayed effects (like poison damage) and coordinate frames to distinguish between absolute positions and relative movement.
  2. Constraint Solving (The "Generate" Phase): Using Answer Set Programming (ASP), the system searches for sets of mechanics that satisfy "Design Requirements," such as ensuring every spell has a cost or preventing redundant mechanics.
  3. AI Planning (The "Test" Phase): Once mechanics are generated, an AI planner attempts to "play" the game to verify "Playability Requirements." If the planner cannot reach the goal state, the mechanics are rejected.
An AI planner validating generated mechanics by finding a path from 'init' to 'goal' while navigating obstacles and enemies.

Evaluation and Key Insights

The system was evaluated across three domains: RPG Battle (health/mana management), Platformer (spatial navigation and gravity), and a Combined Platformer-RPG hybrid.

Key insights from the synthesis process include:

  • Mechanics as Logic: By breaking actions like "Jump" or "Fireball" into preconditions and effects, game design becomes a solvable logic puzzle.
  • Relative vs. Absolute Frames: Distinguishing between moving relative to an avatar and checking absolute goal tiles allows the system to bridge disparate genres.
  • Modularity and Recombination: The domain-agnostic representation allows the system to "concatenate" rules from different genres, naturally synthesizing hybrid mechanics like a "Magic Missile" that accounts for spatial positioning.

Results and Adaptation

The system successfully synthesized classic mechanics, such as "DamageAll" spells that balance higher mana costs with increased utility. In the platformer domain, it generated movement and gravity-defying mechanics that allowed navigation through complex levels. Furthermore, the system demonstrated adaptability: it could take an existing mechanic set and minimally modify it (e.g., adding a "Double Jump") to make a previously impossible level reachable.

Limitations and Future Work

Despite its success, the approach faces computational challenges due to the combinatorial explosion of searching logic rules, currently limiting it to small, grid-based domains. Additionally, while the system masters the logic of mechanics, it does not yet account for "juice"—the aesthetic feel of a mechanic. Future work aims to incorporate adversarial modeling for balanced multi-agent play and explore mixed-initiative tools where AI suggests underlying math to fulfill a human designer's high-level goals.

Summary updated

BibTeX
@inproceedings{zook2014automatic,
  author = {Alexander Zook and Mark O. Riedl},
  title = {{Automatic Game Design via Mechanic Generation}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2014},
  doi = {10.1609/aaai.v28i1.8788},
}
Figure