Balancing Esports Idle Against Simulated Players
Every system in my esports idle game existed ten hours after the first commit. Balancing its economy took the next ten days, mostly by unleashing headless bots on it and discovering that hoodies had eaten the global economy.
Esports Idle is an incremental game in the Cookie Clicker mould. You click your team’s crest to build hype, sign generated pro players, send them through 16-match seasons across 12 parody esports titles, and fund the whole empire with passive businesses that start at solo ranked grinders and end at orbital headquarters. When the organisation gets big enough, you sell it, pocket Legacy Points, and start the next dynasty with permanent buffs.
Every single one of those systems existed by 09:07 on 15 September, roughly ten hours after the first commit.
That turns out to be the easy 10% of making an idle game. An incremental game is a pile of feedback loops wearing a trenchcoat: if two multipliers quietly compound on each other, everything looks completely fine for the first twenty minutes, and then at hour four the player has more money than the Bank of England.
Nobody has time to manually playtest a twelve-hour run after every tweak. So alongside friends and family, I wrote headless bots to play the game at high speed and tell me where the economy caught fire.

Ten hours to build, ten days to tame
Those first seven overnight commits (M0 through M6) bolted on layer after layer: a tick engine with offline catch-up and compressed saves; procedural players with six attributes, 32 traits and 10 gear slots; staff, injuries and a Gaming House ladder; golden-cookie-style Hype Drops, tournament brackets and 23 world events; a pixel-art studio for designing crests and team hoodies; 36 parody sponsors; and a 37-node prestige tree.
Because almost every system multiplied another system, Milestone 7 (scripts/sim.ts) introduced simulated players running the real game engine with four distinct human habits:
- Active: makes purchase decisions every 20 seconds and clicks every Hype Drop.
- Semi-active: checks the screen every two minutes.
- Passive: checks every ten minutes and relies on front-office automation.
- Casual: opens the tab four times a day and closes the browser in between.
One trillion dollars in sixty minutes
On the very first simulated run, the active bot hit $1,000,000,000,000 inside an hour.
Two exponents were compounding with no brakes: Fame (which scaled all income with fanbase size) and Match Prizes (which were being multiplied by passive operations income, which in turn grew from match prizes). M7 severed match prizes from operations and slapped a hard ceiling of 0.12 onto the fame exponent.
Keep that 0.12 cap in mind. It is going to commit a crime later in this post.
The bots also exposed a prestige problem no short playtest would ever catch: run #2 after selling your org was barely faster than run #1, because each Legacy Point only added +1% income. Selling felt like prestiging into wet cardboard. I added Founding Points on the first sale to unlock one of four permanent charters, plus three per-run mandates that trade a rule-bending buff for a structural penalty.
What human beings noticed that bots didn’t care about
Meanwhile, friends and family were playing v0.1.0 on real phones and laptops. Bots do not have ears, thumbs or feelings, so the humans immediately found a completely different class of bugs:
- Music auto-played on first load. It now starts muted, as civilised web games should.
- The automated Front Office buyer happily spent your cash while you were mid-scroll shopping for a player yourself. It now pauses whenever you have the Market, Gear or Lineup tab open.
- You could accidentally trade away your founding player and brick your save file. A startup migration now resurrects missing founders.
- The first org sale required $10¹⁵ in lifetime earnings, which felt like staring at a brick wall. Dropping the threshold to $10¹² brought the first reset inside a two-to-three-hour opening session.
- Hype Drops could spawn underneath the top navigation bar where no mortal cursor could click them, and sponsor contracts paid out a percentage of your current income per second at the moment of completion, letting late-game players sign a beginner contract, finish it in four seconds, and print money. Sponsor payouts now pay 25% of what the org actually earned while the contract was active.
The great hoodie singularity of 22 September
On 22 September, testers reported two things: scrolling felt weird on phones, and late-game merch sales “go completely insane”.
Instead of guessing, I wrote scripts/audit.ts to simulate 12-hour marathons across three playstyles and three random seeds each, prestiging whenever Legacy Points were ready.
The testers were not exaggerating. Across every single playstyle, selling team hoodies and mousepads accounted for 78% to 100% of all revenue. At peak, the active bot’s merch store was earning 100,000 to 480,000 times more money per second than its entire global network of esports teams and arenas. You weren’t running an esports organisation any more; you were running Primark in space with a Counter-Strike team attached for tax purposes.
The culprit was an uncapped feedback loop: Merch Designers multiplied merch revenue with no ceiling, and you bought more Merch Designers using merch revenue. By 1,000 designers, that single multiplier was hitting ×154 on top of every other buff. Worse, because Legacy Points scale with the cube root of lifetime earnings divided by 10¹², one runaway hoodie run generated 1.3 to 1.8 million Legacy Points, rendering every earlier prestige completely meaningless.
Rather than just nerfing merch into the ground, I changed what designers do. Designers now extend how long a shirt design stays fresh and how long fashion trends last, with a diminishing-returns ceiling on their direct sales boost. If you leave your merch store on autopilot, it earns less than your esports operations. If you actively use the pixel-art Studio to chase the current trend, it doubles sales and beats operations.
Here is the scripts/audit.ts ratio of merch income to operations income before and after breaking the loop:
| Merch income ÷ operations income | Passive | Semi-active | Active |
|---|---|---|---|
| Peak, before the fix | 55-400× | 2,200-44,000× | 100,000-480,000× |
| Median, after the fix | 0.04-0.08× | 0.34-0.50× | 2.0-3.1× |
(Peak vs median: before the fix, the runaway peak was the whole story; after the fix, short-lived peaks of a few hundred times operations still happen for about sixty seconds if an active player deliberately stacks a Frenzy, a Merch Spotlight and a Mania buff at the same time.)
The same audit profiled frame rendering times on 12-hour-old saves. Drawing a single frame was taking 85 to 180 ms because one HQ summary card was re-evaluating every free agent on the transfer market against your entire roster on every tick. Caching that check dropped late-game frame times from 84 ms to 10 ms on HQ, 95 ms to 15 ms on Teams, and 178 ms to 12 ms in the Studio. And the phone scrolling bug? The top bar had a hard minimum width of 422px, which quietly shoved the entire viewport sideways on any phone narrower than an iPhone Pro Max.
Remember that 0.12 fame cap?
On 24 September, a tester mentioned that the Fame upgrade line felt underwhelming.
I opened the maths and discovered that my 0.12 emergency cap from Milestone 7 had been silently robbing players blind for a week.
The base fame exponent plus the first three cash upgrades already reached 0.115. Upgrade #4 promised +0.015, delivered 0.005, and hit the 0.12 ceiling. The next eight upgrades in the shop, costing between 2×10¹¹ and 2×10²⁵, did literally nothing. Even better, two Legacy Tree nodes already reached the cap by themselves, which meant a prestiged player got zero benefit from all twelve cash upgrades. My unit test hadn’t caught it because the test only asserted fameExponent <= 0.12.
I raised the exponent cap to 0.13 to fit the first four upgrades cleanly, converted the remaining eight upgrades into direct multipliers on the fame bonus (which don’t compound exponentially with fanbase size), and wrote a ruthless new test that buys every single item in the store in price order and fails the build if any purchase leaves the player’s effective modifiers unchanged. That test immediately caught three more dead upgrades hiding in offline efficiency and staff morale caps.
Two black screens of death
On 23 September, a returning player opened the live URL and got a completely black screen, while an incognito window loaded fine.
GitHub Pages serves HTML with Cache-Control: max-age=600. If a browser cached index.html five minutes before a deployment, that HTML asked for hashed Vite JavaScript bundles from the previous build that no longer existed on the server, crashed before Svelte mounted, and left the player staring into the void.
I embedded a tiny, zero-dependency inline recovery script directly in index.html: if the game hasn’t mounted within a few seconds, it renders a fallback card with a cache-busting reload button and emergency buttons to copy or download your raw save string from localStorage.
Within hours, that recovery card caught a second bug that had been lurking since night one: Svelte’s each_key_duplicate crash on load. The recent-matches list keyed entries by gameId + timestamp. When a player returned after hours away, offline catch-up simulated time in coarse chunks and occasionally finished two matches for the same team inside the same tick, producing identical keys and crashing the UI.
160 gear icons and strikethrough patch notes
Alongside the economy fixes, every placeholder icon from the first night was replaced with layered pixel art on a shared 48-pixel grid: 160 distinct pieces of player gear across 16 tiers and 10 slots, custom buildings for all 16 operations, and redrawn trophies and Hype Drops after the visual audit pointed out that the game’s golden cookie had less detail than a tier-1 mousepad.
To stop myself (and the AI coding agents working in the repo) from undoing last Tuesday’s balance fixes while solving Thursday’s bug, the repository’s patch notes keep every superseded rule in strikethrough alongside a churn counter:
| System | Times changed |
|---|---|
| Sponsorship board | 5 |
| News ticker | 5 |
| Merch store | 4 |
| Selling the org | 3 |
| Player illness and injury | 3 |
The game is live on GitHub Pages with 40 test files keeping the economy honest. The opening run up to the first org sale is right where I want it; the deep late-game after taking hoodies off the throne is what I am tuning next.