TL;DR
Balancing asymmetric strategy games—where opposing factions have fundamentally different abilities and economies—usually requires exhausting cycles of manual tuning and human playtesting. RuleSmith automates this headache by pairing zero-shot Large Language Model (LLM) self-play with Bayesian optimization. Instead of training AI to master fixed rules, it treats the rules themselves as variables, using battling LLMs to find the sweet spot where wildly different factions achieve a fair 50/50 win rate.
What Problem Does This Paper Address?
Imagine designing a game like StarCraft or Civilization. Faction A builds slow, fortified economic engines; Faction B relies on fast, aggressive cavalry raids. How much health should a soldier have compared to a horseman so the game is fair?
Traditionally, designers tweak a spreadsheet, hire playtesters, watch what breaks, and repeat. You could use Reinforcement Learning (RL) bots to test the game, like AlphaStar, except every time you tweak unit damage by +1, you might invalidate your bots' strategies and have to retrain them from scratch. Some recent AI work uses LLMs to suggest rule edits, but RuleSmith flips the script: an external mathematical optimizer tweaks the dials, while instruction-following LLMs act as instant, zero-shot playtesters that adapt to new rulebooks on the fly without any retraining.
Methods
RuleSmith operates as a closed-loop system connecting a game engine, LLM players, and a black-box optimizer:
- Zero-Shot LLM Playtesters: Given a candidate set of numerical rules, two LLM agents (primarily InternVL3.5 at 2B and 8B scales, run text-only) read the natural-language rulebook (via lightweight TF-IDF retrieval), current board state, and strategy guides. Each turn, an agent outputs a single JSON object commanding all its units simultaneously. The game engine validates legality and falls back to simple priority rules if the LLM hallucinates an illegal move.
- Balance Loss Function: After $N$ games, the system calculates a loss score penalizing any deviation from a 50% win rate for either faction, plus an extra penalty for draws so the optimizer doesn't "balance" the game by making it impossible for anyone to win.
- Bayesian Optimization with Adaptive Sampling: Searching $1.9 \times 10^{10}$ discrete rule combinations by brute force is impossible. RuleSmith uses a standard Gaussian Process (GP) surrogate model to predict how rule changes affect balance, rounding continuous suggestions to valid discrete game numbers. What’s clever here is acquisition-based adaptive sampling: LLM rollouts are slow and noisy, so RuleSmith scales the number of evaluation games ($N_t \in [16, 64]$) based on Expected Improvement (EI). Unpromising rule tweaks get a quick 16-game check; strong candidates get up to 64 games to be sure.
Datasets
Because this is a simulation-driven optimization problem, there are no static training datasets. Instead, the authors built CivMini, a new, deterministic $7 \times 7$ grid-based 4X benchmark game featuring two asymmetric factions:
- Empire: Uses specialized Farmers (to gather resources) and slow Soldiers.
- Nomads: Field mobile Cavalry that cannot gather resources, earning income instead by killing enemy units.
CivMini exposes 12 tunable parameters across economy, combat (HP and damage), unit production costs, and tie-breaker scoring weights.
Key Insights and Ideas
- Flipping the RL paradigm: Self-play RL optimizes policies under fixed rules; RuleSmith optimizes rules under zero-shot policies. Because LLMs read the updated stats directly in the prompt, zero policy training is required when the rules shift.
- Balance is relative to player IQ: When the authors pitted a smaller 2B model against a smarter 8B model during optimization, RuleSmith still achieved a 50/50 split—by quietly buffing the stats and economy of the "dumber" 2B faction to compensate for its weaker tactical play!
- Cross-population transfer: A lingering worry with AI playtesting is that rules balanced for one quirkily behaving bot won't hold up for anyone else. Surprisingly, rules balanced by InternVL3.5-8B remained balanced when played by Qwen3.5-9B, Gemini 2.5, and even a small sample of human players.
- Compute goes where it counts: Adaptive game allocation reached the same balance quality as a fixed 64-game budget while cutting total simulated games nearly in half (~3,500 vs. 6,400).
Key Results
Starting from decisively broken configurations—an initial setup where Empire won 100% of games, and a code default where Empire won just 11.3%—RuleSmith reliably discovered balanced rulesets:
- Consistent Convergence: Across three independent GP optimization runs, held-out 300-game evaluations hit Empire win rates of 51.7%, 49.3%, and 52.7%. A 500-game deep evaluation of their primary optimized ruleset landed at 47.6% | 52.4%.
- Optimizer Agnostic: Swapping the GP optimizer for alternative search algorithms like NTBEA and TPE achieved 48.0% and 54.3% win rates, proving the LLM self-play interface is modular.
- Cross-Model & Human Transfer: Rules optimized on InternVL3.5-8B yielded an exact 50% | 50% split when evaluated by Qwen3.5-9B. In preliminary human tests, humans easily beat the AI agents (winning 80–92% of matches), yet faction win rates stayed remarkably even: 43.3%–45.0% in human-vs-AI games and 53.3% across 60 human-vs-human games.
- Scalability: RuleSmith successfully scaled to $11 \times 11$ maps and simultaneously balanced a three-faction variant (Empire, Nomads, Theocracy) to a 32% | 33% | 35% split.
Limitations and Future Work
RuleSmith isn't ready to balance Civilization VII overnight. Running 100 optimization iterations with 8B models took ~40 hours across 8 NVIDIA A100 GPUs—even for a tiny $7 \times 7$ game. Furthermore, CivMini has full observability and just 12 numerical dials; scaling to high-dimensional commercial games with fog-of-war (partial observability) remains an open challenge. Finally, because game balance inherently depends on who is playing, rules tuned for zero-shot LLMs may still drift if human players discover deep "meta" exploits that LLMs miss—especially since the human study here involved only three participants. Future work aims to tackle larger rule spaces, visual map inputs, and broader multi-agent simulations like economic policy or cybersecurity modeling.
Summary updated