Hi guys,
I haven't been very actively lately. I'm sure most of you have no idea who I am.
I've been lurking in the forums for several years, playing titles such as D2, D3, PoE, LoL, and WoW.
Now, I'm back, but instead of trading and playing games, I'm am mostly going to be in the sub-forums working on my current project (~3-4 weeks old at this point)
My first dilemma comes from my desire to learn more about the memory & processing requirements of web languages.
I have worked out an algorithm, however I feel that using the algorithm I've come up with might be "working hard, rather than working smarter".
The point of the algorithm is to determine how much experience the "player" needs to achieve their next level up.
The amounts (assuming I didn't fudge up my math anywhere in the table) are the exact amounts that I want!
The algorithm will generate the correct amount, however in order for it to do so there are several variables it needs to remember.
What I'm wondering is if any of you math savvy folk here at JSP could help me come up with an algorithm that generates the same experience chart posted below, but doesn't require the game to store/call as much data.
If you need a more thorough explanation of what I'm trying to do, please just ask.
Thanks for looking!
PseudoCode + Table Code
Experience per Level Algorithm
Current Level: lvl
Exp Needed to achieve next level: nExp
Exp cost of Current Level: cExp
Level 1: 0
Level 2: 10
Level 3: 30
Level 4: 60
Level 5: 100
nExp = cExp + lvl(10)
Level 0-1: 0 + 0 = 0 (Instant Level 1)
Level 1-2: 0 + 10 = 10
Level 2-3: 10 + 20 = 30
Level 3-4: 30 + 30 = 60
Level 4-5: 60 + 40 = 100
Level 5-6: 100 + 50 = 150
Level 6-7: 150 + 60 = 210
Level 7-8: 210 + 70 = 280
Level 8-9: 280 + 80 = 360
Level 9-10: 360 + 90 = 450
Level 10-11: 450 + 100 = 550
Level 11-12: 550 + 110 = 660
Level 12-13: 660 + 120 = 780
Level 13-14: 780 + 130 = 810
Level 14-15: 810 + 140 = 1050
Level 15-16: 1050 + 150 = 1200
Level 16-17: 1200 + 160 = 1360
Level 17-18: 1360 + 170 = 1530
Level 18-19: 1530 + 180 = 1710
Level 19-20: 1710 + 190 = 1900
Level 20-21: 1900 + 200 = 2100
Level 21-22: 2100 + 210 = 2310
Level 22-23: 2310 + 220 = 2530
Level 23-24: 2530 + 230 = 2860
Level 24-25: 2860 + 240 = 3100
Level 25-26: 3100 + 250 = 3350
Level 26-27: 3350 + 260 = 3610
Level 27-28: 3610 + 270 = 3880
Level 28-29: 3880 + 280 = 4160
Level 29-30: 4160 + 290 = 4450
Level 30-31: 4450 + 300 = 4750
Level 31-32: 4750 + 310 = 5060
Level 32-33: 5060 + 320 = 5380
Level 33-34: 5380 + 330 = 5710
Level 34-35: 5710 + 340 = 6050
Level 35-36: 6050 + 350 = 6400
Level 36-37: 6400 + 360 = 6760
Level 37-38: 6760 + 370 = 7130
Level 38-39: 7130 + 380 = 7510
Level 39-40: 7510 + 390 = 7900