Ludus: An Optimization Framework to Balance Auto Battler Cards

Nathaniel Budijono, Phoebe Goldman, Jack Maloney, Joseph B. Mueller, Phillip Walker, Jack Ladwig, Richard G. FreedmanAAAI 2022 · DOI

Introduction

In the strategic landscape of deck-building games like Magic: The Gathering or Teamfight Tactics, game balance represents a "wicked problem." With a nearly infinite number of possible deck combinations, a small set of overpowered cards can quickly lead to a homogenous metagame where players converge on a single dominant strategy. Traditionally, developers have relied on expensive human playtesting or reactive post-release data analysis—methods that are often too slow to prevent player frustration.

LUDUS is an optimization framework designed to address these challenges by using genetic algorithms and automated playtesting. By simulating thousands of matches and optimizing card statistics against diversity metrics, LUDUS allows designers to "stress-test" card designs and identify optimal configurations before a game reaches the public.

Methodology

The LUDUS framework consists of three primary components: a custom simulator, a sampling-based win rate approximation, and a genetic algorithm for optimization.

The Simulator and Win Rate Approximation

The researchers developed a deterministic auto battler simulator featuring both "vanilla" cards and cards with complex mechanics such as "Heal on Death" and "Armor." Evaluating a metagame's health typically requires a full round-robin tournament between all possible card combinations, which is computationally expensive ($O(n^2)$).

To overcome this, LUDUS implements a sampling-based approximation. By randomly partitioning lineups into smaller groups and running tournaments within those groups, the framework significantly accelerates evaluation. The study demonstrated that as the group size increases, the error in win-rate estimation drops sharply, becoming negligible at a group size of 256.

Absolute error in win-rate estimation decreases as the tournament group size increases, validating the sampling-based approach.

Genetic Algorithm Optimization

Using the PyGAD library, the framework treats card parameters—such as Attack, Health, and special effect values—as "genes." These parameters are evolved over generations using a Standard Deviation Metric (SDM) as the fitness function. The objective is to minimize the variance in win rates across all possible lineups, theoretically fostering a more diverse and balanced strategic environment.

Key Insights and Results

The application of LUDUS yielded several critical insights into the nature of game balance and the effectiveness of automated tools.

Visualizing Counter-play

One of the most practical outputs for designers is the ability to visualize how the stats of one card affect the viability of others. LUDUS generates heatmaps that act as a "weather map" for balance, showing, for instance, how a "Bruiser's" attack power interacts with the health of a "Grow-on-Damage" card.

A heatmap visualizing the interaction between Bruiser Attack and Grow-on-Damage Health, providing a 'weather map' of card viability.

Efficiency and Diversity

The sampling-based approach enabled rapid iteration during the genetic search. In experiments involving special mechanics, the framework successfully reduced the SDM from 0.0751 to 0.0589. This quantitative improvement corresponds to a "smoother" distribution of win rates, effectively reducing the number of "trash" and "god-tier" lineups.

The "Boring Balance" Trap

The researchers also identified a unique failure mode: "perfect" mathematical balance does not always equal good game design. When optimizing vanilla cards for minimum variance, the GA found a solution where all cards were statted to kill each other simultaneously. While perfectly balanced (every game is a tie), it results in unengaging gameplay. This underscores the necessity of pairing automated metrics with qualitative design goals.

Limitations and Future Work

Currently, the LUDUS simulator is deterministic. Most commercial auto battlers include stochastic elements (e.g., random targeting), which would require more extensive simulations to achieve statistical significance. Furthermore, the study focused on small, fixed lineups of three cards, whereas real-world games involve larger teams and complex drafting phases.

Future development aims to incorporate "human-in-the-loop" workflows, where LUDUS generates candidate balance profiles for human designers to refine, ensuring that the final game is not only balanced but also fun to play.

Summary updated

BibTeX
@inproceedings{budijono2022ludus,
  author = {Nathaniel Budijono and Phoebe Goldman and Jack Maloney and Joseph B. Mueller and Phillip Walker and Jack Ladwig and Richard G. Freedman},
  title = {{Ludus: An Optimization Framework to Balance Auto Battler Cards}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2022},
  doi = {10.1609/aaai.v36i11.21550},
}
Figure