# Help me adjust this RPG logarithmic leveling formula! [duplicate]

I'm trying to find a formula that's fits the way I want my player to gain experience and level up. I know this is primarily opinion based but I hope someone can help me!

I've used the following formula as a base, I found it here:

//Calculate level
Level = Math.Max( Math.Floor(6.7f * Math.Log(Experience + 455f) + -40f), 1 );

//Calculate experience for level
Experience = (long)(Math.Exp((Level - -40f) / 6.7f) - 455f);


I wrote a script that will show what it will look like, which is this:

I want to find a way to make it very easy for the player at early levels (let's say until level 15~), and then slowly harder. I'm not sure how to change the formula or if it's even possible! Hope you can help!

## marked as duplicate by Tyyppi_77, Philipp, Community♦Nov 22 '18 at 7:04

• What specifically do you dislike about your current formula? By what criteria should we judge candidate solutions? – DMGregory Nov 21 '18 at 11:53
• @Philipp thanks again, I hadn't seen this thread yet. As always when I ask a question, you point me to the right direction! – Niels van Dam Nov 22 '18 at 7:02

I want to find a way to make it very easy for the player at early levels (let's say until level 15~), and then slowly harder. I'm not sure how to change the formula or if it's even possible! Hope you can help!

There are too many ways to approach this, I don't think anyone can give a concrete answer without know more about your game, but here are some ideas:

• Make it "easy" for someone to gain levels is subjective. Depending on the game, the dungeons (for example) that are meant for players level 1-15 could have monsters that give a lot of experience, while the rest of them give less experience (For example).
• Your formula has some magic numbers, I'm not sure I can see the pattern behind them, but you can treat your formula like an interpolation. In linear interpolation, you go from A to B in equal steps, but you can use an exponential interpolation, that starts slow, and then goes faster. An example formula is x*x and looks like this

Example:

total_experience = experience;
x = your_formula_for_exp_to_next_level;
experience_to_level = x*x;


This will take your already existing formula, and tweak it in such a way that all values will now need less experience in the beginning, and increasingly more at the end. To increase the curve and make it so that it needs less and less experience in early levels, just keep multiplying that by x

For example, the interpolation x*x*x looks like this:

Unfortunately I can't give a more concrete answer than this, because each game has multiple ways to tweak difficulty, by giving more monster to the player, awarding more experience, giving more equipment etc etc. Hope this can help to get you started.

• Thank you very much! That will get me on my way, I think I'm close to getting what I want. This was very informative. – Niels van Dam Nov 22 '18 at 6:56