Balancing an incremental game with bots that play it: an hour with no dead time
One prompt and a skill rebuilt our sushi bar's economy: upgrade lines with ×2 milestones, numbers that stay readable, and bots that played 84 hours of the real game in 14 seconds to prove there is always something to buy. Part 4. Play the first hour.

What we asked“Balance Neta's economy. Income, upgrades and pack prices were each tuned by feel in different parts. Make the first five minutes hook a new player, make sure there is always something worth buying, and add the upgrades an incremental game needs beyond seats and chef speed, so one shop keeps growing for about an hour before it hits a wall. Prove it with bots that play the real game.”
What happened
- Loaded the idle-economy skill, read the simulation and measured the game as it was
- Added upgrade lines (knife, rice, lantern, an apprentice, shop stars) to the game's rules
- Wrote bots that play the real simulation: best payback, cheapest first, random and idle
- Wrote a search that tries cost settings against a target hour, 8 seeds × 80 minutes per try, and ran it in the background
- Built the upgrade panel and a number formatter while it searched
After part 3 Neta had three money systems built in three different sessions, each tuned by feel: stools and chef speed, card packs, and invented dishes that suddenly earned 1.5 times more. Incremental games live or die on pacing. Players defend multiplicative upgrades and generous progress, and they quit at walls and dead time. So this part is about numbers, and about proving them.
Play the first hour
Click UPGRADE at the bottom for the new panel. New upgrade lines unlock as you earn more. Tap the coin counter to switch to scientific numbers. Click to turn on sound. Open full screen
1. Bots play the real game
The usual way to balance an idle game is a spreadsheet model of it. The problem is that the spreadsheet and the game drift apart. Two recent devlogs show the better way: run the real game code headless, with bots, many times. One idle game found its real problem was the first five minutes, where about 40% of players quit (dev.to). Grab Your Torches! ran 4,300 bot games in one night (devlog).
Our shop rules were already plain TypeScript with no graphics, from part 1. So Claude wrote four bots that play that exact code: one buys whatever pays itself back fastest, one always buys the cheapest thing, one buys at random, and one buys nothing. Payback is the price divided by how much income the purchase adds, the measure Anthony Pecorella's "Math of Idle Games" builds on (Game Developer). 20 seeds per bot, 80 minutes each: 84 hours of play in 14 seconds.

2. The first five minutes
The skill asks for a first purchase within about 30 seconds, something new within 2 minutes and a real choice within 5. Measured with the best-payback bot (medians):
| Moment | When |
|---|---|
| Free pack and first new dish | 0:00 |
| First stool | 0:24 |
| First real choice (a pack and an upgrade both within reach) | 1:09 |
| First paid pack | 1:33 |
Upgrade lines show up only once you've earned enough to care, so the panel starts with two rows and grows:

3. A ×2 every few minutes
Exponential costs always win in the end, so incremental games keep the player ahead with multipliers that land as "bumps and local victories", in Pecorella's words. AdVenture Capitalist doubles a business's speed at 25, 50 and 100 owned (wiki). Neta now has:
- Knife: chef speed, 30 levels.
- Rice: all prices, with ×2 at levels 10, 25, 40, 55 and so on.
- Lantern: guests come more often.
- Apprentice: a second cook.
- Shop stars: every dish ×2 when knife, rice and lantern all reach level 10, and again at 25.
- Book bonus: every card collected raises all prices a little, so packs still pay late.
Each row shows what you have, what the next level gives, how far the next ×2 is, and how much income it adds. When a ×2 lands, a banner crosses the shop:

4. No dead time, then a wall
At the best-payback pace, the longest stretch with nothing affordable is 23 seconds in the first 30 minutes and 1 minute 42 after (the skill's limits were 60 seconds and 3 minutes). Then the run of milestones:
| Minute | What happens |
|---|---|
| ~18 | Shop star 1 |
| ~27 | Rice level 25 |
| ~38 | Shop star 2 |
| ~51 | Rice level 40 |
| ~54 | The apprentice is hired |
Income grows from about 1 coin a second to about 12,000. At about 55 minutes it hits a wall on purpose: the next ×2 costs roughly an hour of income. Universal Paperclips is built the same way: growth flattens, and a new kind of thing breaks through (Wikipedia). For Neta, that breakthrough is the next shop.
The bots also check that no strategy dominates. Buying the cheapest thing every time reaches the same income 1.42 times slower than the best plan, inside the 1.5 limit, so a casual player isn't punished much. Where did the best bot's coins go? Rice 68%, packs 13%, the apprentice 11%, lanterns 7%.

5. Tuned by a search, not by hand
Claude first tried to tune by hand, and the curve kept tipping between runaway growth and flat stretches. So it wrote a search that tries cost settings against a target hour and ran it in the background while it built the panel. It didn't trust the search blindly: when the search pushed pack prices up so far that the card collection would starve, Claude limited that setting and searched again. Every change and its before/after numbers is in a balance log in the game folder.
Numbers stay readable: exact up to 999,999, then 1.23M, B, T, Qa, Qi, then scientific, and tapping the coin counter switches everything to scientific.
What it cost
One prompt and no follow-ups: 41 minutes and $9.48 of Claude Code working alone, starting from the part 3 game.
Not done: the coin counter has room for six characters, so it shows 250K rather than the exact number (the panel shows the exact amount). The full card collection takes about 100 packs, longer than the hour. The apprentice is the chef with a lighter tint and needs his own art. Still no saving; that comes with the next part.
Next: a chain of shops
The wall at 55 minutes is where the second restaurant comes in. In part 5 Neta grows into a chain across Japan, with a shop in each region and its own local sushi, managers, saving, earnings while you're away, and a real ending.
Balance your own game
- Copy the skill below into
.claude/skills/idle-economy/, or download it with its references. It works best if your game's rules can run without graphics. - Ask your agent: "Balance my game's economy with bots that play the real game. No dead time, and a ×2 every few minutes."
- Check its report: the first-five-minutes table, the longest stretch with nothing to buy, and how far apart the bots end up.
The skill that made it work
This is the skill we gave Claude Code. The full version has two reference files: the formulas with tested numbers from AdVenture Capitalist, Cookie Clicker and Eatventure, and how to build the bot simulator and its report. Copy the rules below, or download it with its references.
- Simulate the real code. The game's rules must run headless (no rendering) with a fixed step and a seeded random generator. Write bots that play that code at high speed: greedy (buys the best payback), cheapest-first and random. Never balance in a separate model of the game.
- Payback time is the main number. Payback = cost ÷ the income it adds per second (not the item's total income). The greedy bot buys the lowest payback. Show payback per purchase in the bot report.
- Get the first five minutes right first. First purchase within about 15–30 s, the first new kind of thing (a card pack, a new dish) within 2 minutes, the first real decision within 5 minutes. In one devlog about 40% of players quit before the first goal, with a median session of 5 minutes.
- No dead time. At the greedy bot's pace, the longest wait with nothing affordable stays under about 60 s in the first 30 minutes and under about 3 minutes after that. Eatventure's tables put every purchase within a small step of the next.
- Cost curves. `cost = base × r^owned` with r between 1.07 and 1.15 (lower r for expensive items, as AdVenture Capitalist does). Each new tier costs about 10× the last, with about 2–4× the payback. Use the bulk-buy formula for ×10 and Max buttons.
- Multiply, don't add. Players defend multiplicative upgrades and call additive ones "nothing". Milestone pops: ×2 at 25, 50 and 100 owned of something, with a visible celebration, plus a ×2 for everything when all items reach a milestone.
- Plateau, then breakthrough. Every 20–30 minutes income should flatten into a soft wall that a new kind of unlock breaks (a new system, a new shop), not another +5%. That is how Universal Paperclips is built.
- Find dominant strategies. If one bot policy reaches the end more than 1.5× faster than the others, or one item or card is part of the best plan in almost every run, rebalance it.
- Numbers people can read. Exact with separators up to 999,999, then K, M, B, T, Qa, Qi with three significant digits, then scientific; a setting to always use scientific. Keep money in one type behind `format()`. Plain JavaScript numbers are fine below about 1e15 for exact values and 1e308 for floats; only reach for break_infinity.js if the simulator shows you need it.
- Change one thing per pass. Re-run at least 20 seeded bot runs after each change and keep a balance log (what changed, the before and after numbers).
- Report a timeline: when each milestone happens for each bot (median and range), the longest gap, the total time to the current end of content, and a chart if possible.
Save it as .claude/skills/idle-economy/SKILL.md in your project. Put the references folder next to it.

