A new store review says one of your mid-game levels is impossible. The playtest group got through it fine, so you're about to nerf it on a hunch, or nerf the wrong level.
A playtest is a handful of people, and reviews come from the loudest players. This guide shows how to build a difficulty curve from the level events your game already sends, read it, tell what kind of hard a level is, and check whether a balancing change worked. The short version: count fails per start for every level, put them in level order, and look first at the levels that jump above their neighbors.
Step 1: Check which level events your game already sends
Game balancing means tuning a game's challenge, rewards and pacing so it plays the way the designer intended. In a level-based game, balancing with data starts with four events. Each one has to carry the level it belongs to (level_id in the demo game used later):
- level_started: a player begins an attempt at a level.
- level_failed: the attempt ended in a loss. In the demo game, it carries fail_reason, moves_used and duration_seconds, fields the game defines in its event parameters.
- level_completed: the attempt was won.
- level_retried: the player tried the level again.
Every number on the curve is a count of these events per level. For the fields each event holds, see what each event carries.
If some of these events are missing, plan your level events first. Then add tracking with the Codex plugin or add tracking with the Claude Code plugin. The plugin has passed the official review for ChatGPT (Codex) and for Claude.
Two details keep the counts honest. A delivery can arrive twice, for example after a dropped connection. Rawbbit drops duplicate deliveries on the pair app_id and event_id, as long as a resend keeps the same event ID. So one attempt stays one attempt. New events also appear in queries after the next scheduled load, not the moment they happen.
Step 2: Build the difficulty curve: fail rate per start, level by level
Fail rate per start is the number of fails on a level divided by the number of starts on that level. Put those values in level order and you have your difficulty curve.
Counting per start, not per player, matters. One stuck player who fails a level over and over can produce as many fails as a crowd of players who each fail once. Those are different problems. One is a wall for a few people; the other is a level most people find hard. So keep the player count next to starts.
The open-source stack has no ready-made level metric or dashboard. The curve comes from a query, or from a view your team builds in Metabase, the dashboard tool that sits on top of your Rawbbit data. The guide on how to build the curve as a Metabase view includes a hardest-levels query and shows how to pin it as a chart.
For a quick first pass, ask an AI agent. The analytics MCP is a read-only connection next to your Rawbbit data that lets an agent such as Codex look up your events and run queries. Its daily-active-users and funnel tools look at environment prod by default. Its read-only SQL tool filters neither app nor environment on its own, so each prompt names both. Once you connect the analytics MCP, paste this into Codex or another compatible agent and swap in your own values:
For app_id com.studio.mygame in environment prod, use the Rawbbit analytics MCP to find our level events: level_started, level_failed, level_completed and level_retried. For each level_id, count starts, fails, completions, retries and unique players who started the level. Add fail rate per start (fails divided by starts). Count each event_id once and sort by level number, not as text. Show the SQL you ran.
You get one row per level, plus the query behind it. Read the SQL once to check it counts what you expect, then save it and rerun it after every update.
Step 3: Read the curve: spikes, walls and levels that are too easy
Look for spikes, not thresholds: no fail rate means "too hard" for every game. What matters is a level that jumps well above the levels on either side. A jump means this level asks for something its neighbors didn't.
A spike is a level that stands well above the levels on either side.
Far more starts than players on one level, meaning many retries per player, points to a wall.
A long stretch where fails drop well below the levels before it may be too easy. It may also be a planned breather after a hard level. Treat it as a pacing check for the designer, not a verdict.
Levels with few players give weak signals. With a small number of starts, a handful of extra fails moves the rate a lot. Wait for more data before you change them.
Keep one limit in mind. The curve shows where players struggle, not why, and it doesn't show where they stop playing. For that, see the guide on where players quit.
Step 4: Find out what kind of hard it is: fail reasons and moves used
A fail count says a level is hard. The fail_reason and moves_used fields say what kind of hard it is.
Start with fail_reason. In the demo match-3 game used later, almost every fail is out_of_moves: the player used the whole move budget without reaching the goal. If one reason dominates a level, that's the part of the design to look at. If fails carry no reason at all, fix the tracking before you trust the breakdown.
Then compare moves used on fails with the level's move limit. The demo game sends that limit as moves_available on level_started; otherwise your designer knows it from the level setup. Fails at the full limit mean players ran out of moves. Fails well under it mean the attempt ended some other way. Neither shows how close a player got to the goal, so send that too if you need it.
Use this prompt for one level from your shortlist, with your own app and level_id swapped in:
Through the Rawbbit analytics MCP, look at level_failed events for level_id 44 in app_id com.studio.mygame, environment prod. Break the fails down by fail_reason. For each reason, show the number of fails, unique players, average moves_used and average duration_seconds. Skip duplicate event_ids. Include the SQL query in your answer.
The answer is one row per fail reason, with the SQL. These numbers show what ended the attempts. They don't show how players felt about it.
Step 5: Check a balancing change by comparing two variants
Compare two values of experiment_variant on the same levels over the same dates.
Same levels, because a change to a few levels gets diluted when you average it with every other level in the game. Same dates, because players who arrive during a launch or a promotion may play differently from those who arrive later. Without an experiment, compare the app_version field before and after the release that changed the levels, provided your game fills it in on its events. That's weaker, since anything else in that release lands in the same numbers.
Rawbbit doesn't assign variants, switch configs or balance levels for you. Your game decides which variant a player gets and writes it into its events as experiment_id and experiment_variant.
Run this for the levels a change touched, with your own experiment name and level range swapped in:
Compare the variants of experiment difficulty_curve_v3 for app_id com.studio.mygame in environment prod, using the Rawbbit analytics MCP. Use only level_started and level_failed events for level_id 30 to 40, from the first to the last day the experiment ran (UTC days). For each experiment_variant, show starts, fails, unique players and fail rate per start. Deduplicate by event_id. Then give me the SQL behind the numbers.
Back comes one row per variant. A gap between them is a difference, not proof the change caused it. Check that the player counts are close and that the gap holds on fresh data before you roll the variant out.
Worked example: the demo match-3 game
The numbers below come from the Rawbbit demo project, a synthetic match-3 dataset, not real players. They were pulled on November 8, 2026, and the dataset keeps growing. The demo rows sit in environment test, so a prompt against the demo data must name environment test instead of prod.
The curve starts at 0.15 fails per start on level 1 and stays between 0.15 and 0.153 through level 5. Those early levels sit high but flat, so none of them is a spike. From level 15 on, the curve settles into a long, low stretch, reaching 0.107 to 0.109 across levels 21 to 24. That stretch is the first pacing check: a designer might ask whether those levels give players enough to do.
The levels that stand out on the demo curve
Among the levels with solid start counts, three jump above their neighbors. Level 34 reaches 0.131, against 0.117 on level 33 and 0.112 on level 35. Level 37 reaches 0.138 after 0.116 on level 36. Level 44 is the highest of the three: 0.151, with 0.134 on both level 43 and level 45. Those three form the shortlist.
Further out, levels 51, 56, 59 and 62 show 0.167, 0.224, 0.24 and 0.25. They rest on 114, 49, 25 and 12 starts, so they are weaker signals. Level 64, with 4 starts and no fails, says nothing about being easy.
The fail reasons are simple. Across all level fails, out_of_moves covers 62,882 fails from 49,484 players, with 24.4 moves used and 198.5 seconds on average. Only 3 fails have an empty reason, the kind of tracking gap Step 4 warns about.
Level 44 shows it clearly. Its starts carry a move budget of 30, 25 or 22 moves, and every one of its 51 fails used exactly 22 or 25 moves. So those players ran out at the full limit. To choose between a bigger move budget and a different goal or board, the game would also need to send how close each player got.
What the variant comparison shows, and what it can't
The demo events carry experiments named difficulty_curve_v2, difficulty_curve_v3 and difficulty_curve_v4, among others. In difficulty_curve_v3, control has 0.134 fails per start from 76,196 starts. booster_assist has 0.129 from 75,623 starts, and softer_midgame has 0.133 from 76,796. Player counts are close: 24,507, 24,540 and 24,570. In difficulty_curve_v4, the three variants sit at 0.145 and 0.146, with no gap worth acting on.
This demo query mixes every level and date, so it skips Step 5's narrowing to the changed levels. And because the data is synthetic, the gap in difficulty_curve_v3 shows how to read the method, not a real result.
When a difficulty curve won't be enough
Fail rate per start needs discrete levels with a clear start and end. An endless runner or an open-world game needs a different unit, such as a run or a zone. It also needs players: with a small audience, most levels stay weak signals for a long time. And it needs consistent events. If one level sends level_started but skips level_failed when a player quits mid-attempt, its curve looks easier than it is.
Even a clean curve is only a shortlist. A designer still has to read it, choose a change and playtest the fix before it ships.
Next step: get your level events somewhere you can query
Self-host Rawbbit free from GitHub, or ask for a quoted setup if you'd rather not run it yourself; it includes Metabase deployment and basic analytics support. See how Rawbbit works for how the pieces fit together, and the telemetry guide for which events to send first.
From there, connect the analytics MCP to Codex to run the prompts above, or keep the curve on a chart with the Metabase dashboard guide. Because Rawbbit keeps the raw events (keeping raw events), you can bring new balance questions to an AI agent for game analytics later, as long as the events and fields were captured.
FAQ
What is game balancing?
Game balancing is tuning a game's challenge, rewards and pacing so it plays the way the designer intended. In a level-based game, a big part of it is making difficulty rise without sudden walls.
What is a difficulty curve in a game?
It's how hard each level is, in level order. With data, you can build it from fail rate per start: the fails on each level divided by its starts.
What fail rate means a level is too hard?
There's no universal number. Compare each level with its neighbors and with what you intended. A level that jumps well above the levels around it is the one to look at first.
How many players do I need before the difficulty curve means anything?
No fixed count works for every game. The fewer players on a level, the more a handful of fails swings its rate. Treat levels with few starts as weak signals and wait for more data before changing them.
Can I check a balancing change without an A/B test?
Yes. Compare the same levels before and after the release that changed them, using the app_version field on your events, if your game fills it in. It's weaker than a variant comparison, because anything else in that release shows up in the same numbers.
Does Rawbbit find the hard levels for me automatically?
No. The open-source stack has no ready-made level metric or dashboard. It keeps your level events and lets you query them with SQL, a Metabase view your team builds, or an AI agent through the analytics MCP. Your designer reads the curve and decides what to change.