Alright, so currently I have a level system with experience, but I want to make it where every time you lvl up, the experience required to level up again will increase. What would be the best way to do this?
I’ve tried this, however as you reach around level 30, it increases significantly, obviously since its an exponential growth. Anyways how do other games make it where the required exp increases, but not so significantly?
For my own current level system I decided to simply hard code the max EXP for each level into a table, and then index that table by the player’s current level to find it. I think that would be the quickest way to handle this, but I’m also certain that theres another equation similar to the one you had that other developers use for their systems.
Never have an exponential exp increase when leveling up, this makes the game unsatisfying to play because you don’t feel like you’re making progress. Instead, choose a set number increase and a max amount:
local expreq = math.clamp(math.floor(10 + level.Value * 100))
I would say get th players current level and add two 0s onto it. So if they are level 100 they need
10000 to level up. This makes it so at the beginning you can level up fast but as you play the game more and more you level up slower
The D2 log chart darts up at the start and then tapers off to a straight, but shallow line. Your formula’s log char increases linearly because level increases linearly. The D2 chart resembles a square root to me, so I’d try to go toward 10 * 1.15 ^ math.sqrt(level.Value * 50). The 50 is there to make the cliff at the start more pronounced (I’m picking the part of the graph I like). To make the start even cliffier, increase that 50.
The D2 log chart is wobbly. There’s a bunch of tuning being done per stage of the game. Don’t rely entirely on a formula! Just draw the EXP curve you want in ms paint…
The D2 leveling system also has a lot of tuning being done in how much XP is being awarded. Be mindful of that, too! It helps to assign EXP gain values well, or, if that fails, reduce EXP gain based on how close to the area’s target power level you are.
A reminder to pluck out the part of the graph you like! If you have 100 levels, and the leveling is pretty nice up to 50 but gets out of hand past it, then you can multiply or divide or do whatever to level before it hits the formula and the problematic part of the curve can be “shoved out” to the right, past the level cap, or closer to it.
All in all, make it sane and make it feel good. Make sure that noobs in the noob area will level up with no more than a minute of actively gaining EXP (so the next goal is always in sight), and that later levels don’t feel unattainable!
Taking inspiration from a game called Flood Escape 2, (link here)
The way it calculates XP is by taking the player level, multiplying it by 400, and adding 200 to make it so that you start off with a fair bit of XP. Here’s an example
local Level = -- Put the player level here
local Cap = 5000 -- XP Requirement will not go higher than this.
local XPCalculation = ((Level- 1) * 400) + 200
local RequiredXP = math.clamp(XPCalculation, 1, Cap) -- Make sure it stays within the cap.
print("Player needs " .. RequiredXP .. " XP to level up")
You can play around with these values to make it fit and create functions to return these values, but this is just the basic code for it.