I recently asked this question on how to calculate a level based on experience:
Algorithm for dynamically calculating a level based on experience points?
I am using the following calculation to determine the players level:
decimal experience = 1829;
decimal rawLevel = (decimal)(.06 * Math.Sqrt(experience));
decimal level = Math.Floor(rawLevel);
For my test, 1829
experience points equates to 2.56600857364117M
, which I floor to level 2.
My question is, how can I figure out how many points it would take to get to the next level based off of the calculation above?
I know the next level is 3, so I would need to figure out how many points equate to level 3 so that I can find the difference. What formula would I use, given the constant .06 above?
Update: Solution:
int experience = 150777;
decimal rawLevel = (decimal)(.06 * Math.Sqrt(experience));
decimal level = Math.Floor(rawLevel);
decimal nextPoints = (decimal)Math.Pow((double)(level + 1) / 0.06, 2);