How do you design your levelling system?

I’ve designed my levelling system so that in order to level up, you need to reach the sum of your target level and previous levels, multiplied by 100.

This is represented by the simple formula:
n = Level
a = Exp required to level up
a = ((n(n+1)) / 2)x100

In simple, the first few levels look like this:
Level 1 - 0 Exp
Level 2 - 100 Exp
Level 3 - 300 Exp
Level 4 - 600 Exp
Level 5 - 1000 Exp

To get the reverse, so Level from Exp, I simply created this formula:
Level = math.floor((math.sqrt(((Exp+13)2)/100))+0.5)

This is a relatively simple levelling system, but also quite effective since it makes it progressively harder to level up the higher you become.

What are your thoughts on this method, and how do you design your levelling system?

10 Likes

This is better suited for #development-support:design-support, no?

2 Likes

Good call

Yours seems a lot more sophisticated than mine; normally my experience requirement is as simple as:

xpRequirement = previousXpRequirement * 1.5

I use expRequired = 10 + n^3.

1 Like

I have a nice (game specific) Experience library, I’ll share it here.

https://pastebin.com/idTdL0fW

1 Like

Surely that method creates decimals and fiddly numbers?

When I have implemented leveling systems I have generally done so in such a way that the user never saw the actual number for the experience requirement, and as such my numbers need not be as “clean” (multiples of 5, 10, etc) and as for the decimals that is easily solved with a built-in rounding method,.

Edit: obviously this was a low level implementation. You asked how we have done it, so that’s how I did it. I’m certainly not recommending that you use my lazy method.

Oh okay, fair enough. I’ve always showed exp which is why I’ve focused on more rounded numbers

Is a the EXP you need to get to level n from level 0 or the EXP you need to get to level n from level (n-1)?

This is code that I wrote for one of my projects. It took me a while to find the right curve and offset for my game. Lots of experimenting by printing for-loops with levels and exp deltas with the commandbar.

local exponent = 3
local lvlOffset = -4
local experienceOffset = -1250
function module.experienceToLevel(exp)
	return math.floor(.5+math.floor((exp-experienceOffset)/experienceMultiplier)^(1/exponent)) + lvlOffset
end
function module.levelToExperience(lvl)
	return math.floor(.5+((lvl-lvlOffset)^exponent)*experienceMultiplier + experienceOffset)
end

Note: The functions assume that exp is total exp, not the exp until the next level.

For mine, I would do something like

ExpRequired = Level < 30 and Level * 10 or 300

for example, to make them require 10 more exp than the last level until level 30, then it always needs 300 exp.

I use Quenty’s level calculator.

I currently use

		XpNeeded.Value = (Lvl.Value ^ 1.1) * 30 + 5

Althought its not using math.Floor it is quite effective :wink: And it makes it harder to level up each time so you can get to the first few levels easy, and it gets harder and harder (If any one could tell me the math so I could use math.Floor it would be great haha)

Good point. I actually start from Level 1, but then set the target exp to that of the current level.

For example, if you’re:
Level 1, you have to earn ((1(1+1)) / 2)*100 Exp
Level 2, you have to earn ((2(2+1)) / 2)*100 Exp
Level 3, you have to earn ((3(3+1)) / 2)*100 Exp

1 Like

Thanks for all your replies - it’s interesting to see how you design your systems

1 Like

Hey can I ask why you +13? I’m guessing it’s regarding the square root