Key findings
- sin(x) + sin(2x) + sin(0.5x) doesn't hide the wave. The three periods fit into each other, so the same shape repeats every 4π ≈ 12.6 levels: about 80 times in 1,000 levels.
- Inside each cycle the sum slides down for 10.5 levels and jumps back up in 2: the hardest level right after the easiest. Mirrored (for sines that's the same as flipping the sign) it becomes a sawtooth, a bumpy one. Amplitudes 1, 1/2, 1/3, 1/4 make a clean one.
- Periods of 7, 11 and 30 levels don't divide each other: the pattern repeats only after 2,310 levels, and no level jumps more than 28% of the range.
- Squared, the 100-level sawtooth stays below half of its range for 71 levels and below 10% for 32.
- Real games use spikes, not waves. In recent Candy Crush Saga (King) episodes every third level is hard (about 80%) and the next one easy. Royal Match (Dream Games) runs a 10-level cycle. Homescapes (Playrix) almost never puts two hard levels in a row. In Lily's Garden (Tactile Games) the level after a spike takes half the attempts.
A few days ago Oleg Shabrov posted about balancing 1,000 levels, days or sessions. His idea: treat the balance as infinite from day one and build it from math. A sine wave keeps demands and rewards in a sane relation forever. Stack a few of them and the player won't notice the waves. Add a sawtooth when you need contrast.
I liked it. I also realised I had never actually looked at what these formulas draw. So I plotted them, counted what happens on every level, and then went looking for public data from real games to compare.
Some of it surprised me. Most of it is easy to fix.
The formulas from the post
sin(x) one wave
sin(x) + sin(2x) + sin(0.5x) regular + short wave + long wave
mod(x, 100) sawtooth, resets every 100 levels
(mod(x, 100) / 100)^2 sawtooth with more easy levels at the start
Here x is the level number (or the day, or the session). The formulas describe the rhythm: how the ratio of demands to rewards swings. The growth itself (HP going from 100 to 100,000) is a separate base curve, and the rhythm multiplies it. Everything below is about the rhythm.
One thing to keep in mind the whole time: the player never sees the smooth line. They see one point per level. A lot of what follows comes from that.
1. One wave, and what x means
sin(x) has a period of 2π, so with x as the level number one full wave takes 6.28 levels. On whole levels the peaks land on levels 2, 8, 14, 20, 27, 33, 39: every 6 or 7 levels, and the exact shape is a little different every time.

That's not bad in itself. It's just a decision the formula makes for you. If you meant "a wave about every 10 levels", you need sin(2π · x / 10). I'd always write periods this way, in levels: sin(2π · x / T), where T is the number of levels (or days) in one wave.
With days it matters more. A period of 6.28 days doesn't match the week. Every week the peak moves 0.72 days earlier, and in about 9 weeks it goes around all the weekdays. If the idea was "easier on weekends", it works for a couple of weeks, and a month later the easy days are in the middle of the week. For a weekly rhythm it has to be sin(2π · x / 7).
2. Three waves repeat every 12.6 levels
The idea of stacking waves is to make the swing less obvious. A regular wave, a short one and a long one should make a pattern that's hard to read.

But look at the periods: 3.14, 6.28 and 12.57 levels. The short wave fits into the regular one exactly twice, and the regular one into the long one exactly twice. So every 12.57 levels all three come back to the same point at the same time, and the sum starts over.
The easiest way to see it is to take all 1,000 levels and lay them on top of one cycle:

On the left every level lands on the same curve. 1,000 levels are about 80 copies of one 12.6-level shape. Each copy starts at a slightly different point, because 12.57 isn't a whole number, but it's the same shape. (A nerdy detail: 377 levels are almost exactly 30 cycles, so level n and level n + 377 differ by less than 1% of the range, anywhere in the first 1,000 levels.)
On the right are three waves with periods of 7, 11 and 30 levels. None of them divides another, so they line up again only after 7 × 11 × 30 = 2,310 levels. Within 1,000 levels nothing repeats.
One more small thing for whoever normalises this. Three waves don't give a range of ±3, because their peaks never meet. The real range is ±2.23. If you divide the sum by 3 to get ±1, you get ±0.74.
3. The hardest level right after the easiest
Inside one cycle the sum has a clear shape:

A long slide down, about 10.5 levels with a few bumps, and then a jump from the lowest point to the highest in about 2 levels. On whole levels: level 12 is at −1.72, level 13 is at +1.40.
If this sum drives enemy HP, level cost or the number of moves taken away, the hardest level of every cycle comes two levels after the easiest. And then it slowly gets easier for ten levels.
That's the opposite of what the sawtooth in the same post is for: a long climb and a quick release after the hardest level. Funny enough, mirroring the sum gives exactly that.
Mirrored, it's a sawtooth
Mirror it left to right and it climbs for 10.5 levels and drops in 2. For a sum of sines, the left-right mirror and the sign flip are the same thing, because sin(−x) = −sin(x). So sin(−x) + sin(−2x) + sin(−0.5x) and −(sin(x) + sin(2x) + sin(0.5x)) are one formula.
But it's a bumpy sawtooth. On the way up it falls back three times, once by 60% of the whole range, and on whole levels it goes up 13 times and down 12 times in 25 levels. That's the equal amplitudes: the short wave is as strong as the long one.
A sawtooth made of sines is an old recipe (the Fourier series): frequencies 1, 2, 3, 4 times the base one, with amplitudes 1, 1/2, 1/3, 1/4. For a 12.6-level period:
−(sin(0.5x) + sin(x)/2 + sin(1.5x)/3 + sin(2x)/4)

This one climbs almost smoothly for 10 levels and drops in about 2.5. Its range is ±1.53. Against a true sawtooth it matches much better (correlation 0.93, against 0.79 for the mirrored sum from the post). And unlike mod(x, 100), the drop isn't a cliff, it takes two or three levels. For a period of T levels it's −(sin(2π·x/T) + sin(4π·x/T)/2 + sin(6π·x/T)/3 + sin(8π·x/T)/4).
Jumps between neighbouring levels
Back to the sum from the post. The jumps between neighbouring levels are big too. The largest one is 3.14, which is 70% of the whole range in one level. Out of 999 level-to-level steps, 79 jump more than half of the range. The biggest jumps happen where all three waves climb at full speed at the same moment, which is the same alignment again.
The short wave adds the most to those jumps. With a period of 3.14 levels, on whole levels it doesn't look like a wave at all: 0, 0.91, −0.76, −0.28, 0.99, −0.54... That's noise. Fine if you want noise, but then I'd add controlled random on purpose and keep the waves longer.
| Three waves | Repeats | Range | Largest jump | Jumps over half the range, of 999 |
|---|---|---|---|---|
| sin(x), sin(2x), sin(0.5x) | every 12.6 levels | ±2.23 | 70% | 79 |
| periods of 7, 11, 30 levels | after 2,310 levels | −2.96 to +2.92 | 28% | 0 |
| periods of 8, 12.9, 20.9 (golden ratio) | never | ±2.55 | 29% | 0 |
The largest jump is between two neighbouring levels, as a share of the whole range.
4. The sawtooth and its square
mod(x, 100) is a straight climb for 100 levels and a drop back to zero. The squared version, (mod(x, 100) / 100)^2, is meant to give more easy levels at the start of each cycle and a faster climb near the end.
It does. Maybe more than you'd expect:

| Power | Levels below half | Below 10% | First 10 levels add | Last 20 levels add |
|---|---|---|---|---|
| 1 | 50 | 10 | 10% | 20% |
| 1.5 | 63 | 22 | 3.2% | 28% |
| 2 (the post) | 71 | 32 | 1% | 36% |
| 3 | 80 | 47 | 0.1% | 48% |
Squared, the first 32 levels of each cycle stay in the bottom 10%, and the first 10 levels add 1% of the range in total. For the player that's about 30 levels where the rhythm doesn't change. Whether that's a rest or a bore depends on the base curve underneath, but it's a long stretch. Then the top half of the range takes the last 29 levels. Level 99 is at 98%, and level 100 is back at zero.
If I wanted an easy start without such a long flat stretch, I'd try power 1.5: 22 levels below 10% instead of 32, and still 63 levels below half.
And on its own the sawtooth drops all the way to zero, so level 100 is as easy as level 0. On top of a growing base it only takes back its own part, and how big that part is, is the real decision. The real games in the next section use a different rhythm anyway.
5. What real games do
Formulas are one thing. I wanted to see real curves next to them, so I looked for public data that goes level by level. There isn't much of it, but enough for a comparison.
Candy Crush Saga: a hard level every third level
Candy Crush Saga (King) marks levels as Hard, Super Hard, Nightmarishly Hard or Legendary, right on the level button. The fan wiki keeps a table of those labels for every level: 16,475 of them as of April 2024. About 40% of all levels carry one of the labels.
Group the levels by their place inside a 15-level episode, and the recent episodes show a rhythm you don't need any math to read:

In levels 9,000 to 16,475, positions 2, 5, 8, 11 and 14 are hard 77 to 82% of the time. The level right after each of them is hard only 5 to 19% of the time. So it's a three-level beat: normal, hard, easy. Hard, then a release, again and again.
Funny enough, that's almost the period of the short wave from the post (3.14 levels). Except here it's exactly 3, so it never drifts.
The first 1,500 levels look different. No clean beat, and more hard levels around positions 5, 10 and 15, closer to a climb towards the end of an episode.
And King doesn't hide any of it. The label is on the button before you start the level. So "the player shouldn't notice the waves" isn't a rule here at all. The rhythm is visible and the hard level is announced. My guess is that it works because the player knows a release is coming.
There's also an older, much smaller sample: one week of King's data from January 2014, 6,814 players on one 15-level episode (it's not said which one), published for a DataCamp course. Level 1 is won on 62% of attempts. Levels 7 to 12 are all between 4% and 19%. Then level 13 jumps back to 52%, and level 15, the last one in the episode, is the wall: 3.8%, about 26 attempts per win.
A caveat: the labels are kept by fans, and King relabels levels over time. I wouldn't trust the exact percentages. The pattern is too strong to be noise.
Homescapes and Gardenscapes: the same idea, a bit looser
Playrix's games label levels the same way, and their fan wikis keep tables too (patchier, and some pages are a few years old). In Homescapes, 18% of levels 1 to 500 are Hard or Super Hard, about one every 5 levels, with gaps from 2 to 15. By levels 1,801 to 2,200 it's 27%, and 68% of the gaps are 3 or 4 levels. Gardenscapes' first 240 levels look like early Homescapes: 19%, about one every 5.
And two hard levels in a row almost never happen there: once in 241 hard levels across both games.
Royal Match: a 10-level sawtooth
For Royal Match (Dream Games) I found no level tables, only two teardowns that describe the same rule: a Chinese one of the first 200 levels from 2021, and Anton Slashcev's "Royal Match Level Design Insights" on Gamigion (2025). The first hard levels are 39, 45 and 49, and after that the hard ones end in 5 (55, 65, 75...) and the super hard ones end in 9 (59, 69, 79...). By Slashcev's list, every 10th level from 20 is a bonus level.

So from level 55 on it's a cycle of 10: a hard level in the middle, the hardest one at the end, and a bonus level right after it. That's a sawtooth, just with a period of 10 instead of 100, and the release is a bonus level. Slashcev also gives rough attempts: about 1.2 for a normal level, 1.6 for a hard one and up to 2.5 for a super hard one. Neither source says how the numbers were collected, and they cover only the first 100 to 200 levels, so I'd treat this as notes rather than data.
Lily's Garden: growth that stops, and spikes with a release
This is the only long run of real player numbers I found. A 2022 paper on Lily's Garden by Tactile Games (Kristensen, Guckelsberger, Burelli and Hämäläinen, reused in a 2024 paper by Kristensen and Burelli) charts the average number of attempts players needed to complete each of the first 500 levels: 759,382 players in the second half of 2021. The chart in the PDF is vector graphics, so the numbers below come straight from the plotted line.
Two things to keep in mind. Only players who started at level 1 and got to at least level 200 are counted, so these are the persistent ones. And another figure in the same paper gives somewhat different averages for a couple of levels, so I'd trust the shape more than the exact values.

What I see there:
- The base climbs fast over the first 100 levels (2.1 attempts on average) and then settles: 3.0, 3.3, 3.5 and 3.2 for the next hundreds. The authors put it at about 3.2 after level 100. That's the "keep the relation, not the growth" idea from the post, in a real game.
- On top of the base there are spikes. 51 levels need at least 1.5 times the attempts of the levels around them. They come every 2 to 35 levels, 6.5 in the middle, with no fixed period.
- The level right after a spike takes about half the attempts (0.48 of the spike, by the median). 40 of the 51 spikes are followed by a level that's easier than the ones around it.
- The hardest levels take 6 to 6.5 attempts. The biggest jump between two neighbours is ×5.
- After level 20, every tenth level brings a new mechanic (21, 31, 41 and so on, later less often). Those levels take about half the attempts of the levels around them. So there is a 10-level release in there, it just comes from content, not from a formula.
What this says about the formulas
None of these games looks like a smooth wave, and none has a 100-level sawtooth. A hard level is a single spike, and the next level is easier. They all agree on that.
The share of hard levels is similar too. A 2018 Playliner study of the match-3 games in the US top 500 by revenue found about one hard level in five in most of them (one in four in King's Candy Crush Soda). That's where early Homescapes and Gardenscapes are. Later levels get denser: 27% in Homescapes 1,801 to 2,200, about 40% in Candy Crush.
Where they differ is whether the player should feel the rhythm. Candy Crush makes it a strict beat and labels it. Royal Match, if the list is right, runs a 10-level cycle with a bonus level at the end. Lily's Garden keeps the gaps irregular. Homescapes is somewhere in between and gets more regular further into the game. All of that is fine, as long as it's a decision and not a side effect of the formula.
6. Putting it together
Here's how I'd write a formula that behaves like the real curve. The target is the average number of attempts a level should take.
base(x) = 2.3 · (1 − e^(−x/90))
waves(x) = sin(2π·x/7) + sin(2π·x/11) + sin(2π·x/30)
noise(x) = 2 · frac(sin(12.9898·x) · 43758.5453) − 1
hard(x) = waves(x) is a local peak and waves(x) > 0.8
normal: 1 + base · (1 + 0.3·waves/3 + 0.7·noise)
hard: 1 + base · (1 + 0.3·waves/3) · 2
after hard: the normal formula, extra part × 0.6
A few notes on the pieces:
baseis the extra attempts on top of the one every level needs, so a level never goes below 1 attempt. It grows fast at first and stops near 2.3 extra, 3.3 in total.- The waves change the extra attempts by up to ±30%, but their main job is to decide where the hard levels go: a hard level sits on a peak of the 7/11/30 sum. That gives 46 hard levels in 500, with gaps from 5 to 22 levels, and the pattern doesn't repeat until level 2,310.
noiseis the variety between normal levels, from −1 to 1.frac(sin(12.9898·x) · 43758.5453)is an old trick from shader code: it looks random, but level 137 always gets the same number, so the balance is repeatable and works in a spreadsheet.- The release is explicit: the level after a hard one loses 40% of its extra attempts.
And here it is next to the real game, on the same scale:

Close enough for a start: 1.9, 3.0, 3.3, 3.6 and 3.6 attempts on average per 100 levels against 2.1, 3.0, 3.3, 3.5 and 3.2 in the real game, and the level after a hard one at 0.44 of it against 0.48. The real game is messier: its spikes vary more, and some normal levels get as hard as spikes. For the first version of a balance, that's fine.
There's no sawtooth in this formula. If you want one, Royal Match shows where it fits: a short cycle with a climb to a wall and a release right after it. Then the period is 10 or 15 levels (a cycle, an episode, a chapter), not 100.
And the formula is the easy part. The hard part is Oleg's last question: connecting it with rewards, boosters, lives and offers, and checking it for different players. That needs a simulation, not a chart.
What I'd take from this
- Write every period in levels or days:
sin(2π · x / T). Then you know what the player gets. - If you want the pattern hidden, pick periods that don't divide each other (7, 11, 30). If you want a fixed shape, harmonics are fine, but then you're designing that shape, so look at it.
- Normalise by the real maximum of the sum, not by the number of waves.
- Look at the dots, not the line. Check the biggest jump between two neighbouring levels.
- If you want a sawtooth made of sines, give the waves amplitudes 1, 1/2, 1/3, 1/4. Equal amplitudes make it bumpy.
- Real games make a hard level a spike and give the release on the next level. If your formula has a wall, check which way it goes: slow climb and fast drop, or the other way round.
- Decide whether the player should feel the rhythm. Hiding it is one option. Candy Crush does the opposite and labels every hard level.
Thanks to Oleg Shabrov for the post that started all of this :)
Data sources: Candy Crush Saga Fandom wiki, level labels as of April 2024; Homescapes and Gardenscapes Fandom wikis, level tables (2021 to 2024 revisions); Anton Slashcev, "Royal Match Level Design Insights", Gamigion, 2025; Playliner study via WN Hub, 2018; DataCamp project "Level Difficulty in Candy Crush Saga" (2014 sample); Kristensen, Guckelsberger, Burelli, Hämäläinen, UIST 2022, and Kristensen, Burelli, 2024 (arXiv:2401.17436), figure 2.
Get new teardowns by email
One email when a new shop teardown is out, usually twice a month. The numbers, what works, what I'd change. Unsubscribe in one click.
Game Shops: Ultimate Guidelines
300+ pages of shop frameworks, pricing math and real shop breakdowns. Everything behind the teardowns on this site.
Get the bookSample shop report
A real Game Shop Snapshot: the top 5 issues in a live game's shop, the numbers behind each one and the order to fix them in.
Download the sample




