Emergent Mind

GAVEL: Generating Games Via Evolution and Language Models

(2407.09388)
Published Jul 12, 2024 in cs.AI

Abstract

Automatically generating novel and interesting games is a complex task. Challenges include representing game rules in a computationally workable form, searching through the large space of potential games under most such representations, and accurately evaluating the originality and quality of previously unseen games. Prior work in automated game generation has largely focused on relatively restricted rule representations and relied on domain-specific heuristics. In this work, we explore the generation of novel games in the comparatively expansive Ludii game description language, which encodes the rules of over 1000 board games in a variety of styles and modes of play. We draw inspiration from recent advances in LLMs and evolutionary computation in order to train a model that intelligently mutates and recombines games and mechanics expressed as code. We demonstrate both quantitatively and qualitatively that our approach is capable of generating new and interesting games, including in regions of the potential rules space not covered by existing games in the Ludii dataset. A sample of the generated games are available to play online through the Ludii portal.

Fitness progression of GAVEL-generated games, yielding 130 playable variations, with 62 new unique cells.

Overview

  • The GAVEL system combines LLMs and evolutionary computation to automatically generate novel board games, implementing the Ludii game description language (L-GDL) for game representation.

  • GAVEL uses a fine-tuned CodeLlama-13b model for targeted mutation in evolutionary search, and evaluates games based on multiple heuristics like balance, decisiveness, and agency.

  • Experiments reveal that GAVEL can produce a wide variety of unique and playable games, with some games standing out for their originality and engagement, suggesting potential for aiding human designers in game creation.

Generating Games Via Evolution and Language Models

The paper, "GAVEL: Generating Games Via Evolution and Language Models," addresses the challenge of automatic game generation, leveraging recent advances in LLMs and evolutionary computation. The proposed system, GAVEL, is designed to generate novel and interesting board games described in the Ludii game description language (L-GDL). GAVEL employs evolutionary techniques coupled with a fine-tuned LLM to intelligently mutate and recombine game mechanics expressed as code.

Methodology

The core contributions of the paper can be summarized through its three key components:

  1. Game Representation: The paper employs the L-GDL, a robust and compact language capable of encoding the rules for a wide range of board games. L-GDL's abstraction through "ludemes" allows it to efficiently represent game rules within the context lengths of modern LLMs. Additionally, the Ludii system defines numerous "concepts," which are high-level properties of games like asymmetry or specific capture mechanics.
  2. Language Model Training: The authors use CodeLlama-13b for the task but fine-tune it specifically for L-GDL, addressing the challenge of FITM training. This approach can benefit automated mutation in evolutionary algorithms. By training on a dataset derived from over 1000 board games, the model captures the structure and logic inherent to board game rules, ensuring the generation of syntactically valid and meaningful game variations.
  3. Evolutionary Search: The GAVEL system employs the MAP-Elites algorithm, which maintains an archive of diverse and high-quality samples. The use of Ludii concepts, reduced via PCA to two dimensions, enables the system to distinguish meaningfully between different games. The archive is initialized with a set of 14 held-out games not seen during training to prevent memorization and bias. Mutation operations are carried out by sampling from the trained LLM, targeting specific regions of game code.

Evaluation and Results

The fitness function used in GAVEL comprises multiple heuristics that aim to approximate general qualities of interesting games:

  • Balance: Differences in win rates between players.
  • Decisiveness: Proportion of non-draw games.
  • Completion: Proportion of games that reach an end state.
  • Agency: Proportion of turns with more than one legal move.
  • Coverage: Proportion of board sites occupied at least once during playouts.

These metrics are aggregated via the harmonic mean to form a composite fitness score, ensuring that games must perform well across multiple dimensions to be deemed high-quality.

In the conducted experiments, the system generated a wide variety of novel games over multiple runs. Quantitative metrics like the quality-diversity (QD) score and the number of unique, playable games in the archive affirmed GAVEL's efficacy. The UCB variant of GAVEL, which uses Upper Confidence Bound to select mutation points, performed slightly less effectively, indicating that random mutation locations might better capture game diversity.

Qualitative Analysis

Among the high-fitness games generated by GAVEL, a few stood out during qualitative expert evaluation:

  • Havabu: A variant of Havannah with modified placement and win conditions.
  • YavaGo: Combines elements from Yavalath and Go, creating a game with unique strategic depth.
  • HopThrough: A variant of Breakthrough, emphasizing movement mechanics.

These games exhibit novel combinations of mechanics that introduce fresh and engaging gameplay dynamics, some of which might be of interest to human players.

Discussion and Implications

The paper identifies several areas for future improvements:

  • Detection of Unused Game Components: Enhancing the mutation process to better utilize added components could improve the diversity and quality of generated games.
  • Archive Initialization: Future work might explore methods to diversify the initial set of games from which mutations begin.
  • Evaluation Metrics: Incorporating more nuanced or learning-based metrics could bring the evaluation process closer to human preferences.

Conclusion

GAVEL demonstrates that combining evolutionary computation with LLMs in the domain of automated game generation is a promising direction. By intelligently recombining game mechanics and ensuring comprehensive evaluation, GAVEL manages to produce a variety of novel games, some of which show potential for being both strategically deep and engaging to human players. The paper highlights the utility of automated systems like GAVEL as co-creators, potentially revolutionizing the field of game design by providing human designers with a robust tool for generating and iterating on new ideas. Further research could refine these approaches, bringing greater sophistication and utility to the automated game design process.

Create an account to read this summary for free:

Newsletter

Get summaries of trending comp sci papers delivered straight to your inbox:

Unsubscribe anytime.