DEV Community

Cover image for We let a random tapper decide how hard each level of our cat puzzle game is
Rahim Khan
Rahim Khan

Posted on AI-assisted

We let a random tapper decide how hard each level of our cat puzzle game is

Kitten Box Parade has 150 levels. We made the first 10 by hand. A program made the rest, and it judges how hard a level is with an odd yardstick: how often a player who taps completely at random would win.

The game in two sentences

Kittens wait in mixed-color lines, and only the one at the front can move. Tap it and it walks to its box, or, if its box isn't open yet, it waits on a window seat with only a few pillows. Run out of pillows and the level is lost.

The board is small: at most 4 boxes, 4 lines and 20 kittens. That turned out to matter a lot.

A solver that sees everything

Because the board is small, our level tool can solve a level exactly. It walks every state the board can reach, so for any layout it knows for sure whether the level can be won, whether it can be lost, and the fewest window-seat visits a perfect player needs. That last number becomes the 3-star target.

The generator throws a layout away unless:

  • it can be won
  • it can be lost
  • it needs planning (you have to use the window seat on purpose)
  • every rule in it matters. If Cocoa is in the level, her roll to the back of the line has to change the result. If Pebble is there, the fact that he takes two pillows has to matter. A tangled line has to change the 3-star target or the odds.

That last filter stops a "new" level from being an old level with a decoration on it.

Difficulty = the chance a random tapper wins

For every level that survives, we also store one number: the chance that someone tapping random front kittens wins.

The real numbers from the game:

  • Levels 1 and 2 (the tutorial): 1.0. You can't lose.
  • A normal level after 100: about 0.015, so a random tapper wins roughly 1 time in 66.
  • Level 10, Grand Finale: 0.002, about 1 in 500.
  • The hardest boss levels, 120 Bubble Bath Bonanza and 140 The Starry Parade: also 0.002.

It's a strange measure, because nobody plays at random. But it's exact, and it counts something real: how many ways there are to mess a level up. When random taps win a quarter of the time, there's room for mistakes. When they win once in 500, you need a plan before the first tap.

Shaping 150 levels

With one number per level, we can shape the whole game instead of tuning levels one by one.

The levels come in chapters of 20, and each chapter has its own difficulty sawtooth: it starts easy and climbs to a peak at the 19th level. So every new room in the cottage opens with a breath before it gets hard again.

From level 101 there's a rhythm inside each chapter too:

  • every 5th level is a breather: 4 pillows, short lines, random-tapper win 0.10 to 0.26
  • every 10th level is a boss: 4 boxes, 4 lines, 18 to 20 kittens and a chain of locked boxes 3 deep

New rules get a soft start too. From level 101, a rule's first level is made about 3 times easier than the ramp, with only 3 boxes and 3 lines. Level 101, where tangled yarn first shows up, sits at 0.173, against about 0.015 for a normal level. Cocoa's first level, 61, sits at 0.271.

Random-tapper win chance for all 150 levels of Kitten Box Parade on a log scale, with a sawtooth in every 20-level chapter

The tool plays with the game's own code

A generator is only useful if what it checks is what the player gets. So the verify step doesn't use its own copy of the rules. It compiles the game's own lane rules and hint solver into the tool, then replays every level: following the in-game hint from the start has to win with exactly the 3-star number of window-seat visits.

When we added Cocoa's roll, we checked that the game and the solver agreed on every line in the game at the time, all 355 of them.

Generating levels 101 to 150 takes about 3 minutes.

Shipped levels are frozen

Once levels ship, they're frozen. Levels 1 to 100 are marked as done, and the generator refuses to write over them. New rules and new tuning only go into new chapters, so a level that's already out never changes.

What the number can't tell you

Random-tapper odds are a proxy, not the truth. Two levels with the same number can feel completely different. So the rule is: play them, and reseed or hand-edit any level that feels wrong, whatever the number says. When we first played the generated levels, they held up.

If you're making a puzzle game

  1. If your board is small, solve it exactly. Knowing "this can always be won" is worth a lot.
  2. Pick one difficulty number you can compute for every level, then shape the curve with it. Ours is crude, but it let us shape 150 levels instead of tuning each one by feel.
  3. Make the checker run the game's real rules, not a copy.
  4. Freeze what you ship.

The art and music were made with AI tools (Gemini and ElevenLabs), then picked and placed by us. We built the level tools with help from AI coding tools.

Kitten Box Parade is free on Google Play. If a level feels unfair, tell us its number. We'd like to know whether the random tapper agrees.

Top comments (0)