AI Game Dev Search

What Cookie Clicker's numbers taught our sushi game: small buys, big jumps and a visitor worth clicking

We read Cookie Clicker's real numbers from its console and simulated its first four hours: most purchases add only 1-5%, broken by rare x2 jumps and golden cookies. Three Claude Code sessions gave Neta the same rhythm, a collection multiplier and a visitor to click. Part 14.

Tested with Claude Code 2.1.296 · Opus 5.5

Osaka's conveyor-belt shop with a food blogger in a purple suit standing at the counter with a notebook, a gold arrow at the screen edge pointing at him, and BOOK x3.43 next to income
What we asked“Read the idle-economy skill's notes on Cookie Clicker: its numbers, read from the live game, and a simulation of its first 4 hours. Neta's upgrades are fair (every level exactly +10%) but flat. Add Cookie Clicker's rhythm in three changes: cheap frequent small buys broken by visible big jumps; every card you own adds a small bonus to every price, like achievements feeding kittens; and a golden-cookie event every 5-15 minutes that an idle player loses nothing by ignoring.”

What happened

  • Changed each level to ×1.05 at the same price, with each line doubling every 10 levels and the four lines' doublings staggered
  • Added BOOK: every card copy you pull multiplies every price by 1.026, so a 3-card pack is always +8%
  • Added visitors every 5–15 minutes, themed per city: a food blogger, a TV crew, a festival float
Claude
The casual bot now gets a +30% jump every 2–3 minutes instead of every 7–10, at a median +5% per buy. Four later cities run long; I didn't finish their balance.
  • Two shorter prompts finished the balance: picks never lower income, and the ×16 cost charge after each ×2 was replaced by smooth cost growth from a formula

After part 13 every Neta upgrade was exactly +10%. Fair, but flat. So we went to the game that defined the genre and measured it.

Play it

The first visitor comes after 2½–5 minutes. Open full screen (saves your game).

1. Cookie Clicker, measured

Cookie Clicker runs in the browser and keeps its whole state in one object, Game, open in the console. Claude read the numbers straight from the live game (version 2.058):

  • 20 buildings, each copy ×1.15 the price of the last. Each new building costs about 11–15× the one before and earns 5–7× more, so its payback roughly doubles.
  • A ×2 upgrade for each building when you own 1, 5, 25, 50, 100, 150 of it.
  • A golden cookie every 5–15 minutes; its Frenzy is ×7 for 77 seconds.
  • 643 achievements that fill up "milk", and kitten upgrades that turn milk into a multiplier on everything.

Then it simulated the first four hours with a bot that buys the best payback (buildings and ×2 upgrades only):

TimeBuys a minuteMedian gain per buyBiggest
1–5 min1.8+23.8%+83%
5–30 min2.9+4.5%+83%
30–60 min2.1+0.9%+45%
1–4 hours0.6–0.9+1–2%+32–44%

Most purchases are small. What makes it feel good is the rhythm: cheap buys every 20–30 seconds, broken by a ×2 upgrade, a new building or a golden cookie. Neta's "always +10%" had no rhythm at all.

2. Small buys, big jumps

Each level is now ×1.05, with a ×2 every 10 levels. The four lines double at different levels (5, 7, 10, 12, then every 10), so the big jumps don't come in clumps, and each row shows when its next one comes.

Costs grow from a formula: a level is worth 1.05 × 21/10 ≈ ×1.125 on average, four lines bought in turn give ×1.125⁴ ≈ ×1.60, so each line's cost grows ×1.60 a level and payback stays flat. The ×2 level costs the same as any other level, so it's the cheap big jump: below, BETTER RICE's next level is +110% and pays back in 2 minutes, against 7–12 for an ordinary level.

The upgrade screen in Osaka: BELT KITCHEN, INGREDIENTS and NEON SIGN at +5.0%/S with paybacks of 7 to 12 minutes and their next x2 shown, and BETTER RICE at NEXT LEVEL: X2! for +110%/S, paying back in 2 minutes

3. Your collection pays

Like Cookie Clicker's achievements feeding its kittens, every card you pull now multiplies every price by 1.026. It shows as BOOK next to your income, and on every pack's ending, so a pack is always worth at least +8%, even when none of its cards are on your menu.

A pack ending in Osaka showing BOOK x2.94 to x3.17, +8%

4. A visitor worth clicking

Every 5–15 minutes a visitor walks in from the door and hops to the counter: in Osaka a food blogger, a comedy TV crew or a festival float. A gold arrow at the screen edge points at it. Click it within 13 seconds for ×6 on every plate for a minute, or four minutes of income at once. Ignore it and you lose nothing else.

A food blogger in a purple suit at Osaka's counter with a FOOD BLOGGER label, and a gold arrow at the right edge of the screen pointing at him

Balance

The casual bot, which buys in screen order like a first-time player, now gets a +30% jump about every 2–3 minutes (before: every 7–10) and buys 2 to 3.7 times a minute in most cities. Eight runs of the whole chain:

CityGreedyCasual
Tokyo30:4446:10
Osaka27:4744:42
Toyama41:4954:55
Kanazawa43:0857:16
Sapporo42:2640:17
Fukuoka37:0737:19
Route3:374:38

What it cost

Three prompts: the three features ($5.84, 58 minutes), a first balance pass ($2.86) and the cost formula ($5.54, 71 minutes).

Still weak: four waits between minutes 6 and 10 of a city run past 60 seconds (up to 97 in Kanazawa), before the lines reach their first ×2; the casual bot takes 1.5–1.6× as long as the greedy one in Tokyo and Osaka; and run-to-run spread is wide (20 to 56 minutes for a city).

Next: the fourth playtest

A person plays it again. The bots agree with the math now; the open question is whether it feels good.

Learn from a game you can measure

  1. Copy the skill below into .claude/skills/idle-economy/, or download it.
  2. Pick a reference game you can read numbers from (a console, a save file, a wiki) and simulate it with the same bots you use on your own game.
  3. Compare the rhythm, not just the averages: how often a buy, how big the median, how often a big jump.

The skill that made it work

The economy skill, now with Cookie Clicker's measured numbers in its references: the rhythm of small buys and big jumps, and collection as a multiplier. Copy the rules below, or download it with its references.

idle-economy
  1. 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.
  2. 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.
  3. 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.
  4. 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.
  5. 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.
  6. Multiply, don't add. Players defend multiplicative upgrades and call additive ones "nothing". The math: a line worth 1 + s·L gives step s/(1 + s·L) for the next level (+10% a level is +3.3% at level 20) while its cost keeps growing, so payback explodes. Make each level a fixed ×m, and with k lines bought in turn set the cost growth to r ≈ m^k so payback stays flat; with payback P, a purchase comes every (m−1)·P seconds and n purchases give ×m^n, which tells you each stage's goal before any tuning. 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.
  7. 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.
  8. 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.
  9. 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.
  10. A second bottleneck besides coins. With only coins, the best move is always the same. A resource that is used up and refills on its own clock (ingredient stock, energy) makes the player spread out: the best dish runs dry and the second best earns while it refills. Tune it so the top dish covers about 40–60% of sales over 10 minutes, never 100%. A sink should eat something (stock, copies), not only give something.
  11. Every upgrade must visibly move income. If income is the minimum of several limits (seats, chef speed, stock, guests), every upgrade to a limit that isn't the current bottleneck does nothing, and players feel stuck. Prefer income as a product of multipliers, keep at most one throughput limit, and show each upgrade's real effect on income per second on its button ("+18%/s"). In the bot report, flag any purchase that raised income by exactly nothing. Small buys are fine if they are cheap and frequent: Cookie Clicker's median purchase adds only 1-5% at 2-3 buys a minute, punctuated by x2 upgrades (+30-80%), new tiers and a golden cookie every 5-15 min. Aim for that rhythm, many small buys broken by rare big jumps, not a flat +10% every time.
  12. Collection as a multiplier. Cookie Clicker turns achievements into milk and milk into a multiplier on everything. When collecting is part of the game (cards, recipes), let the collection itself multiply income a little, so every new item moves the number even when it isn't in use.
  13. Test with a casual bot, not only an optimizer. A greedy bot hides walls a person hits. Add a bot that plays like a first-time player (buys whatever it can afford in screen order, opens packs when it can, never plans), and require it to finish each stage within about 1.5x the greedy bot's time.
  14. 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).
  15. 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.

Part 14 ofMake a sushi chain incremental with AI
All parts →