Author Topic: Experience Point cost per level  (Read 9919 times)

sokol815

  • Rogueliker
  • ***
  • Posts: 85
  • Karma: +0/-0
  • Web Developer by Day, still Web Developer by night
    • View Profile
    • Email
Experience Point cost per level
« on: October 31, 2014, 05:23:37 PM »
So, for the last 2 years or so I have been using a fairly simple method of defining how many experience points are required to reach a certain level. I thought it might be nice to share this method so others could share their thoughts.

To do this, I just set a base experience Requirement. Most commonly, I choose 5.

That means for 5 base exp, it takes 5 exp to reach level 2, 15 more to reach level 3, and 25 more to reach level 4. so by the time you hit level 4, you have gained 45 exp. each level takes 2 * base more exp to reach than the previous level.

It also happens that this method quite nicely leads to an easy total exp formula:

expReq for level n = (((n-1)^2) * baseReq) - currentTotalExp

Levels start at 1.

Total EXP required to reach a given level:

base 5 xp base 6 xp base 7 xp base 8 xp base 9 xp base 10 xp
Level 1:000000
Level 2:5678910
Level 3:202428323640
Level 4:455463728190
Level 5:8096112128144160
Level 6:125150175200225250
Level 7:180216252288324360
Level 8:245294343392441490
Level 9:320384448512576640
Level 10:405486567648729810
Level 11:5006007008009001000
Level 12:60572684796810891210
Level 13:7208641008115212961440
Level 14:84510141183135215211690
Level 15:98011761372156817641960
Level 16:112513501575180020252250
Level 17:128015361792204823042560
Level 18:144517342023231226012890
Level 19:162019442268259229163240

This has so far seemed like a decent linear increase. Of course, the amount of increase in experience needs to be gauged with the amount of experience given by a single monster. in strife, the early monsters give only 1 exp, late-game bosses/elites will(not yet implemented) eventually give up to 100 or so.

This could also easily lend itself to creating player race-types that require different amounts of exp. E.g. the troll race in ADOM requires a ton more exp relative to the grey elf race. So, in my case maybe grey elf would be 5 exp base and a troll would be 11 exp base.

If anyone is interested in seeing this system in action, head on over to strife to check it out:
http://www.exilania.com/strife

Babblu0

  • Newcomer
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Experience Point cost per level
« Reply #1 on: March 26, 2015, 10:02:04 AM »
If you can do a decent IF engine that procedurally generates scripted story and encounters, that would be awesome.  But Interactive Fiction tends to be game as story, where roguelikes tend to be game as contest, so mixing elements is easy to do badly and hard to do well. 
FSL:

Soulmask

  • Newcomer
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: Experience Point cost per level
« Reply #2 on: April 13, 2015, 10:22:20 PM »
Nice and simple! I'd have a few suggestions which might or might not be better :P

As an idea, you could add a small exponential value each level, that starts at 0 and doesn't add much of anything for the first levels, but increasingly adds more experience so the last level is definitely longer to reach(easy to do with a float double converting to int). However if the game is small then it's definitely not recommended.

Also I found that using very small values increases the difficulty of balancing thing in big games. For example, if you have 50 different types of level 1 mobs, you might need 10-40 different exp values for all of those, and that would imply a value higher than 5 for level 2. However if theres only 4-5 level 1 mobs then its easy to make them give 1-3 xp each. Another issue is xp randomization, you'd want more inflated xp values if you want to randomize xp gain smoothly. Again if xp is constant and minions are streamlined  neatly then it's a non-issue.

Thirdly, and on another tangent, I'm really interested about xp gain depending on PC lvl vs Mob lvl, for example does a lvl 20 PC get same xp for killing lvl 1 mob than a lvl 1 PC? And the reverse is true, if a player finds a way to "cheese" he could run through game and kill high lvl "dumb" mobs for vast xp gain and some games like diablo prevent that from happening by giving significantly less xp.

Yet another point, you're talking about different races getting different xp, and I'm usually against this, at least the way it's been implemented so far in most games. Mostly because of dungeon crawl stone soup, where normally "good" races are the hardest(needs more xp with a limited non-respawning mob pool, also demigods can't use religion(fluffy but without religion the game is 2 to 5 times harder), trolls have to eat tons, etc),  while normally bad small races like Kobolds and Spriggans are the easiest because they level quickly. Also dislike that religion is mandatory if you're not an expert of the game, in D&D game masters usually don't force you to be religious. Should be renamed Religion Crawl really.

Ferret

  • Rogueliker
  • ***
  • Posts: 122
  • Karma: +1/-0
    • View Profile
    • Demon: A monster collection roguelike
    • Email
Re: Experience Point cost per level
« Reply #3 on: April 14, 2015, 05:03:05 PM »
I'm currently wrapping up a fairly big balance revamp of Demon, and the XP curve was one of the things I tackled during that.

After some internal debate, I decided I had two primary goals:
* To be able to set a "target XP value" for encounters on a floor and know that challenge provided would be correct regardless of whether this value was reached by having a few normal-for-that-level monsters or a large number of weaker monsters.
* Players to gain levels at roughly the same rate throughout the game (1 per dungeon floor cleared.) Gaining levels and spending stat points is fun after all, why draw it out unnecessarily in the later game?

Relevant to the first goal: Players and monsters in Demon use the exact same stat systems (in fact they must, since the main mechanic of Demon is recruiting the same monsters you fight against to also fight alongside you), so characters (regardless of 'faction') of a similar experience level are usually also of a similar power/threat level. Gaining levels generally provides you with two benefits: you are more effective at doing whatever it is you do in combat (damage, support, healing, etc.), and you can take more damage. This has a sort of N^2 effect in terms of overall combat effectiveness: if a Level 20 character has 400 HP and deals 20 damage an attack, and a Level 40 character has double these values, the Level 40 character is actually *four* times more effective. Their 800 HP lasts twice as long, and their 40 damage per attack is twice as damaging for each attack during that doubled lifespan.

Based on this, I decided the XP value for a character should simply be its Level squared: once to account for its effective power per action, once to account for its ability to survive to do more actions, both of which are linearly influenced by Level. All characters "secretly" have +10 added to their Level for combat purposes (this is so that a Level 2 monster is not actually massively more threatening than a Level 1), so for 1st level monsters, this puts the XP value at 121 per kill, for example.

The second goal was fairly simple to solve at this point. I want the player to gain 1 experience level per floor. Every dungeon floor makes 7 checks on the encounter table for that level, that number being based on what has felt good in previous testing. For a good challenging encounter, I generally want the player to face enemies of (on paper, at least) equal power: the player has a party of 4, so the player's total level will be: Expected Level For Floor * 4. Therefore, encounters on that floor should also be that level, which means each floor will give experience equal to ((Expected Level For Floor * Expected Level For Floor) * 4) * 7), or ((Expected Level Floor * Expected Level For Floor) * 28). Therefore, that should be the amount of experience required to advance to the next level. That ends up looking something like this (remember the "invisible" +10 added to level behind the scenes:)

Level ; XP per Kill at Level ; XP required for Next Level (x28)
1 ; 121 ; 3388
2 ; 144 ; 4032
3 ; 169 ; 4732
4 ; 196 ; 5488
etc.

Based on my (still early I admit) testing, this seems to be working out for the most part. The player doesn't actually hit experience level 2 until just before the 3rd level of the dungeon, but that's because encounters on the first floor are very, very lightweight (the player only starts with a party of 2, as opposed to the party of 4 they will have for the vast majority of play.) So based on that I had to knock the "expected level" for floors 2+ down by 1 (basically treating Tower:1 and Tower:2 together as the first floor)

Encounters seem to be properly nasty whether they involve 4 "maximum" level enemies or a larger number of lower level enemies, so that part worked out.

Finally, I did have to make a small adjustment to the formula: it is now based off x26 instead of x28, to account for the 20% chance for checks on an encounter table to drop down to the next easier table (and the much smaller, but still important 3% chance of a check using the next harder table...)

I'm pretty happy with the results, overall. :) How adaptable this would be to other games would depend on the goals, and how easy it is to gauge the relative strength of characters vs. each other, particularly across the player/NPC line, but hopefully someone will find something useful in all this babbling. :D

Morcrist

  • Newcomer
  • Posts: 9
  • Karma: +0/-0
    • View Profile
    • Email
Re: Experience Point cost per level
« Reply #4 on: April 15, 2015, 02:00:14 AM »
I prefer an exponential xp requirement with unlimited level advancement. That way I don't have to worry about things like how much xp do high level PCs grinding out low level mobs get. If they want to take the time, fine with me, but it's going to take longer and longer to make progress doing so. All in the vein of me hating artificial restrictions.

E.g.:

lvl req worth 
1   10    1
2   20    2
3   40    3
4   80    4
5   160   5
+   x2    +1

Where req = xp required and worth = xp gained by killing a mob of that level.