Tag: algorithms
The perfect experience / level curve
by CyberShadow on May.16, 2010, under Code
I was recently tasked to create a required-experience-per-level table for a game – that is, create a table which indicates how many experience points the player must earn to progress to a certain experience level. The requirement to reach the next level must continuously increase (the “double derivate” must be non-negative). Of course, it is easy to come up with a function to satisfy that requirement alone, but what about generating a level curve that’s also aesthetic? I mean, it’s much nicer to look forward to reaching 15000 points than, say, 16384.
So, I wrote a small program to attempt to generate experience ranks with the following properties:
- Continuous acceleration
- Smoothness (calculated as “roughness”, using the sum of squares of the “triple-derivate”)
- Roundness (100 is more round than 150, 150 is more round than 160, 160 is more round than 165 etc.)
- Emphasis on the roundness of the last level
The qualifying factor here is smoothness vs. roundness. (continue reading…)