Abstract: The prototyping of computer games, particularly card games, requires extensive human effort in creative ideation and gameplay evaluation. Recent advances in Large Language Models (LLMs) offer opportunities to automate and streamline these processes. However, it remains challenging for LLMs to design novel game mechanics beyond existing databases, generate consistent gameplay environments, and develop scalable gameplay AI for large-scale evaluations. This paper addresses these challenges by introducing a comprehensive automated card game prototyping framework. The approach highlights a graph-based indexing method for generating novel game variations, an LLM-driven system for consistent game code generation validated by gameplay records, and a gameplay AI constructing method that uses an ensemble of LLM-generated heuristic functions optimized through self-play. These contributions aim to accelerate card game prototyping, reduce human labor, and lower barriers to entry for game developers.
Introduction
Prototyping a new game is a classic "cold start" problem. Designers must navigate the complex space of creative ideation, implement consistent code for multi-turn logic, and then find competent players to evaluate balance and fun. Cardiverse is an end-to-end framework designed to bridge these gaps using Large Language Models (LLMs). By integrating graph-based mechanic indexing, iterative code validation, and self-play optimized AI agents, Cardiverse generates novel, playable game variants and evaluates them at scale with minimal human intervention.
The Prototyping Challenge
While LLMs excel at text generation, they face three significant hurdles in game design:
- Lack of Intentional Novelty: Models often default to "remixing" well-known titles like Poker or Uno rather than inventing distinct mechanics.
- Rule-Code Mismatch: Ensuring that complex game logic in code perfectly mirrors natural language descriptions is notoriously difficult.
- Evaluation Bottlenecks: Using LLMs to play thousands of testing rounds is prohibitively expensive, while simple random agents fail to provide meaningful feedback on game balance.
The Cardiverse Framework
The authors decompose the prototyping pipeline into three distinct, LLM-powered modules designed to address the aforementioned challenges.
Mechanic Extraction & Design
To move beyond simple text remixing, the system represents games as mechanic graphs. In these graphs, nodes represent actions (e.g., "draw a card") and edges represent control flow. By clustering these graphs, the system identifies common patterns and instructs the LLM to design "new" mechanics within specific clusters. To ensure novelty, it explicitly suggests replacing frequently occurring mechanics with these newly designed variations.
Consistent Code Generation
Cardiverse avoids the pitfalls of "one-shot" prompting by using an iterative validation-and-refine loop. The system runs generated code to produce simulation logs, which an LLM then reviews against the original rules to identify inconsistencies. If a violation is found, the system retrieves relevant code snippets to help the LLM fix specific logical bugs.
Scalable Gameplay AI
To enable cost-effective testing, Cardiverse prompts the LLM to write heuristic functions (Python code that scores potential moves) rather than acting as a live agent. The system generates a large pool of these functions and uses a "step-wise inclusion" tournament strategy to select an ensemble of the best-performing heuristics based on win rates in self-play. This approach is significantly faster and cheaper than calling an LLM for every move.
Datasets and Novelty
The framework was initialized using a curated dataset of 106 common card games sourced from Bicycle Playing Cards, including casino games, trick-taking games, and rummy variants. To demonstrate the system's creative potential, the researchers introduced Hearts of Time and Hollywood Eights, two novel variants generated by the framework that offer complex, playable derivatives of classic games.
Key Results
- Novelty: Using "Quantiled Max Similarity" (QMS), the authors demonstrated that their graph-based method produced game variations significantly more distinct from the source database than standard LLM prompts.
- Code Robustness: The iterative validation process achieved 100% executability on common games and significantly improved "Play Record Consistency," ensuring code followed the written rules.
- AI Performance: The ensemble-based AI agents achieved a win rate advantage of 14.6% to 19.7% over random agents, outperforming standard LLM architectures like Chain-of-Thought.
- Cost Efficiency: By utilizing generated Python code for AI rather than live LLM calls, the cost of running 200 test games remains nearly flat, overcoming the linear cost scaling of standard LLM agents.
Conclusion and Future Work
Cardiverse demonstrates that LLMs are more effective at writing strategy and rules than executing them in real-time. While currently optimized for text-representable card games, future work aims to expand the framework to board games requiring spatial reasoning and to incorporate "Theory of Mind" for modeling bluffs and player intentions. By distilling high-level reasoning into fast, code-based ensembles, Cardiverse lowers the barrier to entry for game developers and accelerates the creative cycle.
Summary updated