Best Way To Increase The Next Required Amount Of Exp

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?

local expreq = math.floor(10 * 1.15 ^ level.Value

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))
2 Likes

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

Be inspired! Here is the Diablo 2 experience table (copied from d2jsp)

D2 level -> total experience required table
Level	Experience	Experience to Next Level
1	-	500
2	500	1000
3	1500	2250
4	3750	4125
5	7875	6300
6	14175	8505
7	22680	10206
8	32886	11510
9	44396	13319
10	57715	14429
11	72144	18036
12	90180	22545
13	112725	28181
14	140906	35226
15	176132	44033
16	220165	55042
17	275207	68801
18	344008	86002
19	430010	107503
20	537513	134378
21	671891	167973
22	839864	209966
23	1049830	262457
24	1312287	328072
25	1640359	410090
26	2050449	512612
27	2563061	640765
28	3203826	698434
29	3902260	761293
30	4663553	829810
31	5493363	904492
32	6397855	985897
33	7383752	1074627
34	8458379	1171344
35	9629723	1276765
36	10906488	1391674
37	12298162	1516924
38	13815086	1653448
39	15468534	1802257
40	17270791	1964461
41	19235252	2141263
42	21376515	2333976
43	23710491	2544034
44	26254525	2772997
45	29027522	3022566
46	32050088	3294598
47	35344686	3591112
48	38935798	3914311
49	42850109	4266600
50	47116709	4650593
51	51767302	5069147
52	56836449	5525370
53	62361819	6022654
54	68384473	6564692
55	74949165	7155515
56	82104680	7799511
57	89904191	8501467
58	98405658	9266598
59	107672256	10100593
60	117772849	11009646
61	128782495	12000515
62	140783010	13080560
63	153863570	14257811
64	168121381	15541015
65	183662396	16939705
66	200602101	18464279
67	219066380	20126064
68	239192444	21937409
69	261129853	23911777
70	285041630	26063836
71	311105466	28409582
72	339515048	30966444
73	370481492	33753424
74	404234916	36791232
75	441026148	40102443
76	481128591	43711663
77	524840254	47645713
78	572485967	51933826
79	624419793	56607872
80	681027665	61702579
81	742730244	67255812
82	809986056	73308835
83	883294891	79906630
84	963201521	87098226
85	1050299747	94937067
86	1145236814	103481403
87	1248718217	112794729
88	1361512946	122946255
89	1484459201	134011418
90	1618470619	146072446
91	1764543065	159218965
92	1923762030	173548673
93	2097310703	189168053
94	2286478756	206193177
95	2492671933	224750564
96	2717422497	244978115
97	2962400612	267026144
98	3229426756	291058498
99	3520485254	-

Here are it and your original formula graphed side by side:

Big image

Some key observations:

  • 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!
1 Like

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.

2 Likes