I’m building a puzzle game, and the user will be timed to complete the level. The user will get rated based on the time it took him/her to complete the level. Naturally, as the levels increase they get harder.
I am trying to come up with a good algorithm for rating the user as the levels increase in dificulty. The user should get more time on level 10 than on, say, level 1 to earn a 3 star rank.
Does anyone know a good algorithm to use for this?
Supplementary Gameplay Example:
The user will have 2:00 to complete each level. But in order to get 5 star on the first level the user must complete the level before 1:50.
It’s hard to give a direct and formal answer since this would really depend on the game, and I don’t know anything specifically about your game. You mention that you’re making a puzzle game, so I’ll list some generic algorithms that might work, and you could adapt/apply them however fits your needs.
As Pshemo mention, you could calculate the number of moves/interactions that would be required, and then given a baseline value (e.g. for a 3 Star rank, no move should take more 0.75 seconds to calculate), add it all up. Then compare the user’s time versus that.
You could also create a base time rank for all levels, say, 1 min. Every entity in your game would then add, or subtract from that time value based upon how it affects the player. If your game has anything that directly challenges the player (e.g. enemies, hidden bombs, etc.) they would add to the time (example: every bomb-block gives you 3 extra seconds, etc.). Anything that helps the player would then do the opposite (example: every star-block, which the player can use to destroy all surrounding blocks, would take away 3 seconds.) Different values would be used for different difficulties. Finally compare the player’s time with the rank time.
Overall, this method helps keep a good balance.
If you’d like to target a more personalized experience, could always use an average medium difficulty time, and measure how the player is performing against it. If he constantly beats it at 50% or less, then reduce the time to make it more challenging. You could increase it as well.
Those are some basic principles that apply to many types of puzzle games. They may or may not directly apply to your game, but I’m sure you could easily adapt them.
I hope I helped! 🙂