Math for Experience - Dustin Myers


Our game has had an experience system for some time now, however its functionality had not been implemented correctly during that time. Whenever the player kills an enemy, that enemy is supposed to award the player a base of 25 experience points, and every 100 experience points the player would receive a skill point to spend in the skill tree. Now that the skill tree is fully functional, I needed to fix up the experience system, as at the time no points where being rewarded. 

Luckily, I had made a game master previously, so all I had to do was make sure the correct calls where in place, which for the most part, they where not. Our AI systems had undergone a large overhaul, which included setting up all our AI with a parent class that handled everything, including death, which is where our experience system would be called normally. This meant however that it was very simple to wire up the fixed experience system again, and then on to my favorite part, scaling. 

In most games, every time a player fills an experience bar, the amount of experience needed to fill it again goes up. You can do this with a linear algorithm, exponential algorithm, or logarithmic! I experimented with some formulas in an excel sheet for a while trying to get a scale that looked nice, and eventually settled on :

E=(N+(L*(L*0.25)))
E is the total experience needed to level up
N is the previous amount of experience needed to level up (starting at 100)
L is the player level

This curve gave a nice slope that was not too extreme for the amount of content we would have finished by the end of our demo, was easy to implement in blueprints or code, and scaled just fast enough to discourage the player from "farming" our up and coming witch AI, who will have the ability to summon monsters to help her. 

Get Element Clash

Leave a comment

Log in with itch.io to leave a comment.