I have a match-3 mobile game, similar to these popular games in the store. Mechanics are different, but the gameplay stays the same:
- NxN board
- X moves
- Y objectives to complete to win
- tons of different levels. When you complete a level, you unlock a new one
When you run out of moves, you have to buy moves or try again, so you have to think on each move.
And the problem is in the moves, I'm trying to calculate the amount of moves required for each level. I want it to be be slightly lower than the average, so it takes 3-4 attempts for an average player to complete.
I discovered that "being stuck" 2 or 3 times on a level makes it a lot more fun, than completing levels each time with a single attempt.
My current solution
I have couple hundred players and with them - some statistics. With each level attempt (lost or won) I save it on my server to use it for calculations:
ID | Level Number | Used Moves | Lost/Won
Then, each week, I compute a sum of attempts on each level, and I do this for all players. Then, I compute a mean average on each level:
avg_lvl_attempts = sum_level_attempts / player_count
So if 3 people took level 10, all of them with 4 attempts, it would be:
avg = (4 + 4 + 4) / 3 = 4
Which means that it takes the players 4 attempts, on average, to complete level 10. Then, based on that, I increase the amount of moves on level 10 by a small amount, so it's a little bit easier for them (because I want to achieve 3 on average). And I do that for each level.
The problem with that solution is that it can produce strange results, for instance if someone had 130 attempts (it happens sometimes).
Is there any algorithm, or mathematical trick to do these kind of things more accurately, like excluding edge cases etc?