Algorithm for dynamically calculating a level based on experience points?

Posted by George on Game Development See other posts from Game Development or by George
Published on 2011-06-14T16:29:38Z Indexed on 2013/10/27 10:19 UTC
Read the original article Hit count: 287

Filed under:

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.

© Game Development or respective owner

Related posts about game-design