How I Balance Idle Games With a Bot (Real Numbers From My Games)

In short: I balance my idle games with a simple greedy bot that plays 6 hours in under a second. Real numbers from my template: doubling income moved the second building from 6 to 3 minutes and the first prestige from 56 to 28 minutes. Cost growth 1.10 vs 1.15 vs 1.20 changed time-to-last-building from 3.3 h to 4.6 h to 5.4 h. Code and tables below.
Balancing idle games with a bot: real milestone timings

I make browser idle games: SILICON TYCOON, SPARKMIND and a few more. The hardest part is not the code, it is the pacing. Is the second building too far away? Does prestige come too late? You can’t answer that by playing for an afternoon after every change, so I let a bot do it.

The Bot: 30 Lines That Play for 6 Hours

The idea is simple. Every simulated second the bot earns income, then buys whatever gives the most income per coin, and buys any upgrade it can afford. It also clicks for the first 5 minutes, like a real player at the start. It logs the moment each building is first bought and when prestige becomes available.

let t = 0;
while (t < 6 * 3600) {
  const click = t < 300 ? 4 : 0;          // 4 clicks/s for the first 5 min
  earn((rate() + click) * 1); t += 1;
  for (;;) {                               // buy until broke
    let best = null, bestValue = 0;
    for (const g of visibleGenerators()) {
      const value = incomeOf(g) / costOf(g); // income per coin
      if (costOf(g) > money) continue;
      if (value > bestValue) { best = g; bestValue = value; }
    }
    const up = affordableUpgrade();
    if (up) { buy(up); continue; }
    if (!best) break;
    buy(best);
  }
  logFirsts(t);                             // first rig, first prestige...
}

It is greedy and perfect, so it is faster than a human. I use its times as the best case and expect real players to be roughly 1.5 to 2 times slower.

Experiment 1: Income Speed

The first version of my template’s demo, Star Miner, felt slow. The bot confirmed it: the second building took 6 minutes. I doubled the base income of every building and ran it again.

MilestoneBase income ×1Base income ×2
2nd building6 min3 min
3rd building22 min11 min
4th building41 min21 min
First prestige56 min28 min
Prestige worth 10 points161 min80 min
Last buildingnot reached in 6 h4.6 h

Six minutes for the second building is where people close the tab. Three minutes keeps them. Doubling income halved every milestone, which makes sense since everything scales with income, and it was the single most important change.

Experiment 2: Cost Growth

Every idle game uses a cost formula like cost = base × growth^owned. The genre standard is 1.15. I tested three values with everything else identical.

Cost growthFirst prestigeLast buildingDrones owned after 6 h
1.1021 min3.3 h200
1.1528 min4.6 h129
1.2033 min5.4 h95

Two things surprised me. First, the early game barely changes: the second building appears at 3–4 minutes in all three cases. Cost growth mostly matters in the mid and late game. Second, with 1.10 the bot ends up owning 200 of the first building, which makes the numbers feel cheap. I kept 1.15 and tune pacing with income and unlock thresholds instead.

What I Learned

  • Fix the first 3 minutes first. Getting the second building within 2–3 minutes matters more than any late-game tweak.
  • Put a cheap ×2 upgrade right after each new building. Buying the building then feels twice as rewarding.
  • Aim the first prestige at 20–40 minutes and make it worth at least +10–20% income, or nobody understands why they should reset.
  • Use a bot for pacing, humans for fun. The bot tells you when things happen, not whether they feel good. Both matter.
  • For big games, check the late game with a model. In SILICON TYCOON the bot plays the real engine for the first hour, where my test runs reached the Megafab era in about 25–32 minutes, and a simpler spreadsheet-style model checks the 10-hour late game.

Try It Yourself

The demo I used for these tests is free to play: Star Miner on itch.io. If you want to make your own idle game, I packaged its engine as IDLE FORGE, a plain-JavaScript template where you edit one config file. The balancing numbers in this article are its defaults.

Frequently Asked Questions

What is a good cost growth for an idle game?

Around 1.15 per purchase, meaning each building costs 15% more than the last. In my simulations 1.10 brought the last building forward from 4.6 to 3.3 hours, and 1.20 pushed it back to 5.4 hours. 1.15 is a good default and you tune pacing with income and unlock thresholds instead.

When should the first prestige happen?

In my games I aim for 20 to 40 minutes. In the IDLE FORGE demo it lands at about 28 minutes. Earlier and it feels pointless, later and many players quit before they discover it.

How do you test balance without playing for hours?

I write a small bot that plays the game at high speed: every simulated second it buys whatever gives the most income per coin spent. It plays 6 hours in under a second and logs when each building and prestige happens.

Does the bot play like a real player?

No. It is greedy and never forgets to buy, so real players are slower. I treat its times as a lower bound and expect real players to take about 1.5 to 2 times longer.

Leave a Comment