General Video Game Rule Generation

Ahmed Khalifa, Michael Cerny Green, Diego Pérez-Liébana, Julian Togelius

TL;DR

This paper introduces the General Video Game Rule Generation (GVG-RG) framework, a new benchmark for AI designed to tackle the "inverse problem" of game design: given a fixed level layout, can an algorithm generate a set of playable and engaging rules? By isolating rule generation from level generation, the authors provide a modular path toward the ultimate goal of fully automated game design.

What Problem Does This Paper Address?

While Procedural Content Generation (PCG) has seen massive success in creating textures, landscapes, and levels (think No Man's Sky or Minecraft), rule generation remains a significant hurdle. Most existing AI competitions focus on playing games or generating levels for existing games.

The authors argue that generating a complete game (rules + levels + assets) all at once is currently too complex for AI. To make progress, they propose modularizing the problem. The GVG-RG framework specifically challenges researchers to generate the Interaction Set (what happens when objects collide) and the Termination Set (how you win or lose) for a pre-defined level and sprite set.

Methods

The framework is built on the Video Game Description Language (VGDL) and the General Video Game AI (GVGAI) ecosystem. The authors implemented and compared three distinct approaches to rule generation:

  1. Random Rule Generator: A baseline that picks a random number of interactions and termination conditions. It serves as a sanity check for the framework.
  2. Constructive Rule Generator: This uses "common sense" heuristics based on game design patterns. For example, if an NPC is chasing the player, the generator assumes the NPC should kill the player on collision. It uses a LevelAnalyzer to categorize sprites (e.g., walls, collectibles, avatars) based on their density and position in the level.
  3. Search-Based Rule Generator: This is the most complex approach, utilizing the Feasible-Infeasible 2 Population (FI2Pop) genetic algorithm.
  4. It maintains two populations: one striving to meet basic constraints (feasibility) and another optimizing for "fun" (fitness).
  5. Fitness is measured via Relative Algorithm Performance: the generator runs three different AI agents (Smart, Baseline, and Random) through the game. A "good" game is one where the smart agent outperforms the others, suggesting the rules reward skillful play.

Datasets

The authors evaluated their generators using levels from three classic-style games ported to VGDL, which vary significantly in their mechanics and layouts:

  • Aliens (a Space Invaders clone)
  • Boulderdash (a puzzle-action game)
  • Solarfox (a high-speed collection game)
Fig. 1: The VGDL experimental levels in order from top to bottom right: Aliens, Boulderdash, and Solarfox.

Key Insights and Ideas

  • The Inverse Problem: Framing rule generation as the inverse of level generation allows for a cleaner separation of concerns in AI research.
  • The "Bad Frames" Constraint: To prevent the genetic algorithm from generating broken games where sprites fly off-screen, the authors introduced a feasibility check that penalizes rules resulting in "bad frames."
  • Expressive Range vs. Quality: There is a clear trade-off between the two. The constructive generator is reliable but predictable, while the search-based generator explores a much wider space of possibilities but often produces "unstable" results.
  • Similarity Metrics: By comparing the distance between generated rulesets, the authors visualized how different algorithms cover the "design space." As seen in Figure 2, the search-based (Genetic) approach covers a much broader area than the highly clustered Constructive approach.
Probability density of the similarity metric between generated games.

Key Results

A user study with 161 comparisons yielded several interesting findings:

  • Constructive Wins on "Sanity": In most cases, users preferred games from the Constructive generator. It consistently produced playable games because it relied on proven design patterns.
  • The "Frozen" Exploit: The search-based generator occasionally "cheated" the feasibility constraints. For instance, in Aliens, it discovered that using an undoAll interaction (which freezes all sprites) was the easiest way to satisfy the "survive for 40 steps" and "no bad frames" constraints. This resulted in boring, static games that users disliked.
  • Diversity: The search-based generator produced remarkably diverse rulesets, even if their quality was uneven.

Limitations and Future Work

The primary limitation is that the current fitness function for the search-based generator does not yet capture "interestingness" or "fun" effectively, leading to the "frozen" game exploit mentioned above.

Future work includes:

  • Developing more sophisticated fitness functions that better model human-like play and engagement.
  • Gradually easing restrictions, such as allowing the generator to modify the sprite set or the level layout in tandem with the rules.
  • Sequencing generators (e.g., using a rule generator's output as the input for a level generator).

Summary updated

BibTeX
@inproceedings{khalifa2017general,
  author = {Ahmed Khalifa and Michael Cerny Green and Diego Pérez-Liébana and Julian Togelius},
  title = {{General Video Game Rule Generation}},
  booktitle = {CIG},
  year = {2017},
  doi = {10.1109/cig.2017.8080431},
}
Figure