I created this calculation based on multiples below to determine how much the character will need to have experience to level up.
float NeededExperience(int level, float experienceRatio = 100F)
{
float neededExperience = ((level - 1) * experienceRatio) * level;
if(neededExperience == 0F)
neededExperience = experienceRatio;
return neededExperience;
}
With this function, setting experienceRatio
equal to 100, and user level is 1, it will need 200 experience to reach level 2 and 600 to level 3 ...
But I would like to do the opposite calculation, which calculates the level of the character from the amount of experience it has, for example: a user who has between 2000 and 2999 experience is at level 5.
Or if this is not the best way to calculate experience, I also accept suggestions.