CUNYbot: Bridging 1920s Macroeconomics and StarCraft AI Strategy
Standard Economic Models in Nonstandard Settings – StarCraft: Brood War
This paper introduces CUNYbot, a StarCraft: Brood War AI that utilizes the classic Cobb-Douglas (CD) economic model to drive high-level strategic decision-making. By framing the game as a macroeconomic resource allocation problem, the bot optimizes capital-to-labor and technology-to-labor ratios (k and t) using genetic algorithms, achieving a 100% win rate against built-in Zerg AI and competitive performance in tournament settings.
TL;DR
CUNYbot is an innovative StarCraft: Brood War AI that abandons traditional hard-coded "build orders" in favor of the Cobb-Douglas (CD) model—a mathematical staple of 20th-century economics. By treating the game as a national economy, CUNYbot optimizes its ratio of "Labor" (workers) to "Capital" (army) and "Technology" (upgrades). It doesn't just play a script; it solves for an economic equilibrium, evolving from an aggressive rusher to a sophisticated "Tit-for-Tat" strategist that reacts to enemy expenditures in real-time.
Problem & Motivation: The Macro Management Trap
In the world of StarCraft AI, most bots fall into two categories: micro-specialists (insane unit control) or macro-scripted bots (following rigid build orders). The former often ignores the "big picture," while the latter crumbles when an opponent does something unexpected.
The author's insight is elegant: StarCraft is, at its core, a scarce resource management problem. Why invent new heuristics when economists have spent 100 years perfecting models for exactly this? The challenge lies in mapping game units to economic variables and dealing with the Fog of War, where the "opponent's economy" is mostly hidden.
Methodology: The Calculus of War
CUNYbot uses a capital-augmenting Cobb-Douglas function to define its Utility ():
- Capital (): Combat units (the "tools" to win).
- Labor (): Workers (the resource gatherers).
- Technology (): Research and upgrades that multiply the effectiveness of Capital.
1. The Static Model
Using a Genetic Algorithm (GA), the bot plays thousands of games to find the optimal parameters for different races. This allows the bot to "learn" that it needs a tech-heavy, high-capital approach against Terran (to counter with Lurkers) but a more expansive, low-tech labor focus against Zerg.
Figure 1: The economic trajectory of CUNYbot. Notice the fluctuations in Utility () as the bot trades units () during battles and subsequently rebuilds.
2. The Reactive "Tit-for-Tat" Strategy
The true breakthrough is the Reactive Model. Instead of a fixed strategy, CUNYbot observes the opponent. While it can't see everything, it estimates the enemy labor force (assuming constant production) and scans for visible military units.
If the opponent invests heavily in army (), CUNYbot shifts its own parameters to match that aggression. If the opponent plays "greedy," CUNYbot prioritizes its own Labor () to out-grow them. This is a classic Tit-for-Tat strategy: play friendly (greedy) by default, but retaliate (build army) if the opponent gets aggressive.
Experiments & Results: Evolving Greed
The results show a fascinating shift in behavior between the Static and Reactive versions.
| Population | (Capital) | (Labor) | (Ratio) | Win Rate (vs T) |
|---|---|---|---|---|
| Static CD | 0.55 | 0.45 | 1.21 | 76.9% |
| Reactive CD | 0.51 | 0.49 | 1.05 | 75.8% |
Note: The Reactive bot opts for a lower (less army, more workers) because it trusts its ability to respond to threats dynamically.
In the SSCAIT tournament simulation (84 different bots), CUNYbot's results were mixed but promising. It achieved a 100% win rate against several bots and a respectable 31% win rate against top-tier competitors like tscmooz. The main limitation remains "executional complexity"—while the economic brain is smart, the rule-based micro-management still struggles against the very best combat-focused bots.
Critical Analysis & Conclusion
CUNYbot proves that economic intuition is a powerful substitute for complex deep learning in strategy games.
The Takeaway: By adopting a Tit-for-Tat strategy driven by the Cobb-Douglas model, CUNYbot effectively manages the "Greed vs. Fear" tradeoff that defines high-level StarCraft.
Limitations:
- The model assumes a continuous production function, whereas StarCraft has discrete "lumps" (e.g., you can't buy 0.5 of a Zealot).
- Fog of War estimation for Labor is still rudimentary (assuming 1 worker per depot always).
Future Outlook: Integrating this macroeconomic framework with a more advanced tactical "micro" engine or using Machine Learning to better predict obscured opponent expenditures could turn CUNYbot into a top-tier contender. It’s a compelling reminder that sometimes, the best way to solve a new problem is to look at a very old one.
