Algorithm for dynamically calculating a level based on experience points?
- by George
One of the struggles I've always had in game development is deciding how to implement experience points attributed to gaining a level. There doesn't seem to be a pattern to gaining a level in many of the games I've played, so I assume they have a static dictionary table which contains experience points vs. the level. e.g.
Experience Level
0 1
100 2
175 3
280 4
800 5
...There isn't a rhyme or reason why 280 points is equal to level 4, it just is.
I'm not sure how those levels are decided, but it certainly wouldn't be dynamic. I've also thought about the possibility of exponential levels, as not to have to keep a separate lookup table, e.g.
Experience Level
0 1
100 2
200 3
400 4
800 5
1600 6
3200 7
6400 8
...but that seems like it would grow out of control rather quickly, as towards the upper levels, the enemies in the game would have to provide a whopping amount of experience to level -- and that would be to difficult to control. Leveling would become an impossible task.
Does anyone have any pointers, or methods they use to decide how to level a character based on experience? I want to be fair in leveling and I want to stay ahead of the players as not to worry about constantly adding new experience/level lookups.