
Card Battle Auto-Balancer — Agentic AI System
Card Battle Auto-Balancer is an intelligent agent-based system that automatically balances card game parameters using multi-agent AI orchestration and Monte Carlo simulation — so game designers never have to tune cards by hand.
The Problem Balancing a card game is one of the hardest challenges in game design. A single overpowered card can break the entire meta. Traditionally, designers iterate manually: test, tweak, repeat. This project automates that loop entirely.
How It Works The system runs a three-stage agentic cycle. First, it simulates 1000+ battles per iteration across three deck archetypes (Aggro, Control, Midrange) to collect statistical balance data. Then, five specialist AI agents — each responsible for Cost, Stats, Archetypes, Global Scaling, or Effects — independently propose card adjustments in parallel using GPT-4o-mini reasoning. The orchestrator selects the best proposal and applies it. Finally, the system detects plateaus, switches strategy if stuck, and converges automatically when balance fitness exceeds 0.90.
Key Features
Multi-agent orchestration via LangGraph with 5 specialist agents
Monte Carlo simulation engine (1000+ battles per iteration)
Adaptive strategy switching to avoid local minima
Gradio web UI — upload CSV cards, set goals, download results
Real-time fitness visualization with Plotly charts
Deployable to AWS App Runner with auto-scaling and PostgreSQL
Tech Stack Python 3.11, LangGraph, OpenAI GPT-4o-mini, Gradio, Pydantic v2, NumPy, Plotly, Docker, AWS App Runner, pytest (258 tests)
Results In typical runs the agent reaches a fitness score of 0.92/1.0 in 7–15 iterations (~2–4 minutes), producing a fully balanced card set ready for use.