Last updated on

Measuring roguelike difficulty with bots, and why we ended up needing two of them


Dungeon100 is a 3D roguelike where you descend a hundred floors. The hardest thing to get right was difficulty.

The people tuning it are the people who built it, so our own playthroughs were useless as data. We know every enemy and every room. So we handed the measurement to a bot.

The bot (src/dev/simBot.ts, about 1,000 lines) plays the actual game from floor 1, through the same code path a player uses. Run it N times and you get a distribution of the floor each run died on. That part went smoothly. The trouble started when we made the bot better.

Improving the bot destroyed the baseline

At first there was one bot, and we kept improving it: open chests, pick better cards in the draft, and so on. Then the death distribution moved, and we realised we could no longer say why.

Had the game become easier, or had the bot become better? The ruler we used to detect regressions was changing length every week.

So we split the bot into two profiles:

  • hard: baseline only. Walks straight to the exit, never opens chests, declines every event. Once the baseline was recorded, its behaviour was frozen.
  • human: perceived difficulty. Visits chests, scores draft cards from what is on screen, and decides on room events based on the situation.

The human profile has one rule: it gets no information a person could not read off the screen. It parses the HUD health text and the rarity border on cards, the same things a player sees. Pathfinding (BFS) is allowed, because players have a minimap.

The baseline was not the difficulty

The split immediately showed something important. In the same build, the baseline bot died on floors 6 and 9, while the human bot cleared the 12-floor cap in all three runs, collecting 46.7 items on average.

If we had read only the baseline number (“they die around floor 8, it’s too hard”) and lowered the difficulty, real players would have found the game trivial. The baseline is a regression detector. “Is this game hard?” has to be answered with the human profile.

Growth compounded, threat did not

The biggest surprise came from the other direction. In a “farming” run that grants a legendary reward every two floors, the bot reached floor 61 with 160 items and no resistance.

The cause was simple. Enemy stats hit their caps between floors 15 and 21, while player power keeps compounding with every item. After that point the game was a walk.

The obvious fix is to inflate enemy HP, but that also stiffens the early game. Instead, from floor 30 we ramp up damage taken only and raise the spawn cap.

The farming runs now die on floors 10, 10, 15 and 30, so even best-case farming breaks through only occasionally. We also confirmed the hard profile (8.3 floors on average) never reaches floor 15, so the change does not touch the baseline.

Running it in CI

Every night CI plays five hard runs. If the median leaves the baseline band (floors 5 to 13), an issue is opened automatically.

We did not fold everything into a red build, though. Exit codes are split: a crash fails the job, while a baseline deviation opens an issue. When real breakage and a tuning signal arrive as the same alert, people learn to ignore both.

CI runners have no GPU, so a single run initially took about 30 minutes. Dropping the viewport to 640×360 and forcing the low-quality preset brought five runs down to 16 minutes. The rule we kept: only pixels may be reduced. If you change a gameplay constant to make the run faster, you are measuring a different game.

What we took away

  • Separate the instrument that measures from the one that experiences. A single bot doing both does neither well. The baseline bot can be bad at the game; what matters is that it never changes.
  • Automated measurement still needs a human to decide what the numbers mean. The bot told us the late game was broken. Choosing to scale damage taken rather than enemy HP was a design call.