Einstein & God
Reluctant Hero: An Introduction

Mathematics of XP

Dd_box1st What is the best mathematical principle upon which to base an experience system? To explore the mathematics of XP we must first look at why such systems can be useful, and then examine the properties of the mathematical functions upon which they are most commonly built. 

Experience systems have their origins in tabletop war games, but became more significant when they were used as the central progression mechanic in Dungeons & Dragons back in 1974. Since then, their significance to tabletop role playing games has diminished to irrelevance, but they remain of central importance to computer RPGs where they provide a centralised progression mechanic effectively brokering the time the player spends with the game into rewards. By relating a character’s power level to experience (and hence indirectly to time spent playing) cRPGs allow any and all players to progress in return for their time commitment. 

This can be seen as the central transaction between the player and the game in the context of cRPGs: “Continue to play me, and you will continue to progress.”

Compare this to the deal offered by adventure games (“Solve my puzzles to progress”) or tactical and strategic games (“Try to beat me!”) and the strength of the experience system (and its equivalents) becomes more apparent. 

Central to the implementation of an experience point (or XP) system is the gearing of the progression mechanic – that is, the relationship between the XP required for one level and the next. This gearing can be arranged according to a number of different mathematical models, with different implications.

It is important to note that we will be examining solely the XP values for levels in this discussion (because this data is readily available) and not the XP rewards the player receives for, say, killing monsters. This data is harder to come by, but we can estimate the effect of this element, as we shall see shortly. 

Progression Ratios

In examining these differences, we should consider in particular the progression ratios – which are determined by dividing the XP required to reach one level by the XP required to reach the previous level. There are two such ratios of note: 

  • the basic progression ratio: [XP difference between level (n+1) and level (n) / XP difference between level (n) and level (n-1)]
  • the total progression ratio: [XP for level (n+1) / XP for level (n)].

Note that these ratios are rarely fixed values, but usually decrease as the game progresses as a consequence of the mathematics of the XP systems that are used. 

In general, the lower the basic progression ratio the less difference between the time the player must spend to reach one level and the next, that is, the less steep the progression curve of the game. It should be remembered that the basic progression ratio need not be constant, and in fact generally recedes as the game progresses. This doesn’t mean that progress gets faster as the game proceeds, however, owing to the cumulative effect of multipliers over a number of levels.

The total progression ratio on the other hand shows how the total XP required for a level increases. If this value is large, it implies that the total XP the player requires for a level increases significantly as the game progresses. To a reasonable approximation, this indicates that the rewards for killing monsters (the usual basic source of XP) increases significantly between levels – with the consequence that players will progress much faster through the game if they choose to stay “ahead of the curve” (to fight monsters much tougher than themselves). 

We are now ready to examine some specific mathematical choices in the context of XP.

1. Exponential Progression 

In an exponential progression, the relationship of XP for level (n) and level (n+1) is a fixed number e.g. in the sequence 100, 150, 225, 337 the exponential factor is 1.5.

A quirk of these exponential systems is that (in general terms) the basic and total progression ratios are the same. For instance, if the total experience increases by a factor of 1.5 per level, the basic progression ratio will also work out at 1.5. Similarly, if the experience difference per level increases by 2.0, the total experience required will rapidly approximate to 2.0. 

The original Dungeons & Dragons mechanics were based on a broadly exponential progression with the exponential factor changing slightly by class, but being around 2.0. This element of the rules was lost when Wizards of the Coast/TSR revamped the system in 2000.

Exponential progression might be falling out of fashion in games design, in part because of the high total progression ratio it implies. In order to give the player a smooth experience, the rewards must also rise exponentially as the player’s level increases – often meaning that the game can be ‘rushed’ by staying ahead of the curve. The extent to which one can remain ahead of the curve determines how rushed the game can be – in the worst case, the player can dip into a future area, kill a monster for phenomenal XP and level up through a large part of the game in seconds. This problem can be ameliorated by various means, however. 

Runescape Where exponential progression does survive in cRPGs, it tends to do so by having a very low exponential factor. For example, in RuneScape (Jagex, 2001) the exponential factor is a relatively low 1.1 e.g. total XP required = 83, 174, 276, 388, 512, XP differences = 83, 91, 102, 112, 124. With progression ratios around 1.1, the difficulty curve of the game is relatively gentle.

2. Polynomial Progression 

In a polynomial progression, the XP required for a level is proportional to level^f, where f is the polynomial factor e.g. 2 for squared, 3 for cubed etc. It is a property of these systems that both the progression factors decline as level advances, but that total progression ratios fall more slowly than basic progression factors. 

An example of such a system can be found in the Dreamcast game Armada (Metro 3D, 1999) which uses the formula of 8 x (current level)^3 to determine the XP requirements.

Polynomial systems generally have gradation in their early levels akin to an exponential progression, and with similar problems. The difference comes in the effect at later levels. In an exponential system, the XP values become astronomical – beyond any reasonable expectation of achievement. But in a polynomial system, the difference actually gets smaller as the level increases; at higher levels, the basic progression ratio gets closer and closer to 1.0 (the total progression ratio does the same, but the effect is slightly less pronounced). 

These systems are broadly speaking an improvement over strict exponential progression, but the flattening out of the curve in the upper reaches tends to lead to a flattening out of the progression process – there becomes no appreciable difference between the actions required and time taken to advance a level once the level becomes sufficiently high.

A related problem is that the lowering total progression ratio implies there will be little difference in rewards in fighting stronger foes – in effect, the player would do better to fight weaker foes (which presumably die faster) than stronger ones, as the XP difference between the two will generally not be significant next to the number of foes that must be defeated, and so racking up easy kills becomes a faster means of progression than fighting foes of equivalent level.

3. Fibonacci Progression 

In a Fibonacci progression the relationship of XP for level (n) and level (n+1) is the sum of the XP for level (n) and level (n-1) e.g. 100, 200, 300, 500, 800, 1300, 2100 etc. In such a progression system, both of the progression ratios are a fixed 1.618034, that is, the golden ratio (also referred to by the Greek character ‘phi’).

I know of no game which uses such a progression system, but we can speculate about such a game. Given the values of the ratios are fixed, we can expect that such a game would remain relatively constant in its rate of progress – the time taken to level up would be directly proportional to the players choice of relative difficulty. If they stay ahead of the curve, they will advance more quickly and vice versa. It would, in short, inherit all the properties of a regular exponential progression mechanism. 

I am forced to conclude that Fibonacci progression, while initially seeming of interest as an alternative to exponential progression is in fact just a special case of it.

4. Near Arithmetic Progression

Worldofwarcrafta In cases of arithmetic progression (AP), the relationship of XP for level (n) and level (n+1) is a constant value. This is never used in practice, because it contains no variability at all, but a closely related form does occur - what we might call the near arithmetic progression (NAP). In this, the value is not constant, but increases very slightly between levels. For example, in World of Warcraft (Blizzard, 2004) the differences between level XP values are (for instance) 400, 500, 700, 700, 800, 900, 900, 1100, 1100, 1200 etc - i.e. a near arithmetic progression. 

When NAP is used, the progression ratios begin relatively high but fall gradually to just above 1.0. This may result in the same problems as polynomial progression in the later stages of such a game – a problem generally avoided by setting a maximum level (60 for World of Warcraft).

However, arithmetic progressions are much more forgiving than polynomial progression at lower levels, since their progression ratios are always relatively low. This creates a much more gentle curve than exponential or polynomial systems, and this gentle curve is becoming popular with players because it delivers rewards relatively regularly, and while advantages can be gained by pushing “ahead of the curve”, they are generally limited. (In fact, World of Warcraft enforces various rules on the acquisition of XP to limit the players ability to push ahead).

Conclusion 

An examination of the basic patterns in the mathematics of XP seems to show that it is not the choice of mathematical system which is the key issue, but rather the setting of the constant values that determine the steepness of the experience curve. Whether it is RuneScape with its exponential system with a low factor of 1.1, or World of Warcraft with its gentle near arithmetic progression, the focus seems to be on creating smooth curves with low progression ratios. These low progression ratios mean that there is a gentle pressure on the player to advance within the game space, and that the gaps between levels are retreating only slightly – the next level is always in sight, encouraging the player to play just that little bit more.

The fact that these progression mechanics can be fiendishly addictive to players – by virtue of creating a reward schedule which trains the player towards constant activity – is perhaps the reason we see so much of their use in modern games, and we can expect that XP systems will be with us for a long time to come.

Feel free to share your perspective on the experience systems of cRPGS you have played. Can you think of specific games in which progression was too slow or too fast? Have you played games where the struggle to advance eventually became insurmountable? I welcome your views! Those with a more mathematical bent are encouraged to comment on the mathematics, especially if I have made any errors!

Comments

Feed You can follow this conversation by subscribing to the comment feed for this post.

One has to take into account the relation between the XP required to level and the XP given by (for example) killing a foe. If I recall when at work, Sacred has a polynomial system but compensates by relating the XP reward to the relative level of player and foe. It only gives 1 XP if the foe is trivial to kill, making the standard approach of fighting easier foes much less appealing.

Yes, of course - I thought I had said this explicitly, but in fact I had only explained why I didn't use this data, i.e. it's harder to come by. :)

If XP rewards are normalised to level, as described above (and as happens in WoW as well, amongst other games) the shape of the XP curve is the only relevant factor, is it not, because variations in XP are being normalised (i.e. the normalisation system serves solely as a homeostat to rate of progress)?

Or it the case that the strength of the homeostatic effect drowns out any effect from the curve? This would suprise me, but it's certainly a possibility.

Or to put it another way: did the normalisation of XP in Oblivion ruin some people's enjoyment of the game because this effect was a more dominant component in the progression mechanics than the shape of the overall curve?

Anyone have any thoughts?

From the way my wife plays it, Oblivion is an exercise in grinding in much the same way as something like WoW. She selects what she does in such a way as to get the most benefit from grinding, but I have (for example) caught her putting a weight on the 'sneak' key and leaving the character close to a sleeping beggar for a few hours in order to grind the Sneak skill to 100%.

Levels appear to be related to improvements in the other skills, so careful control of the rate of acquiring those other skills appears to be a greater contributor to levels than (for example) straight combat.

This appeasr to have increased my wife's enjoyment of the game, as she feels she can "bend the rules" and "beat the game" somewhat in order to level faster - an effect that may be worthy of a post sometime, Chris :-).

Chris, I refraining from comment, because I don't feel I have much to add just at the moment. Hopefully more comments will spark a reaction other than "cool post". I am planing a post on XP/Renown in my system, but it's at least a week away at this point.

As a designer with an anti-grind, anti-level approach, you may well imagine that I aim to buck the tendencies you describe here.

Actually I agree with Corvus. I prefer to think of the "mathematics of progression" in terms of transfinite sets, that is deep patterns in the system, rather than finite numerical progression. What I mean to refer to is the theory of infinite numbers developed by George Cantor in the 1900s, where you can have infinite sets that are greater than other infinite sets. Think of it as the player gradually coming to grok the more percolated patterns, and by adjudicant having a stronger intuitve grasp of the system.

That said, I really think you should go with the Fibonacci approach for Reluctant Hero. I was reading a conversation with Phillip K. Dick about his year-long angel encounters, and at the end the Angel showed him a shape whcih defines 8 and 13, which are the inflexion point on the sequence before it begins its hyberbolic acceleration. Not that that proves its system dyanmical utlity, but its interesting.

Well this post serves as an introduction to the experience system for Reluctant Hero, which I'll post about today, time willing.

Thanks for the comments!

While not a designer - merely a player - I also have a distinct distaste for the whole "level" thing. In tabletop RPGs, I tend to prefer the Chaosium and GURPS approach of awarding skill increases or character points. However, I assume levels have the benefit that characters of the same level are roughly as tough as each other, so it's easier to tailor encounters to the ability of the player(s) in a computer game.

Yes, this is precisely the point, Peter. Like you, I don't like class and level in tabletop, but in cRPG design one of the key problems is game balancing which gets very complex if you don't have something central like level to help.

Chris, I just wanted to post a thank-you for the existence of this post. I'm designing an experience system and wanted to know if anyone had used a Fibonacci curve. I'm still interested in trying it just to see what happens (our experience system is more important in terms of unlocks and items, not PvP, so we can focus exclusively on the rewards), but this analysis was very helpful.

Erin: glad to have helped! Let me know how it works out for you.

Maybe I haven't spent enough time considering the issue, but I don't understand why advancement of skills, advancement of levels, advancement of enemy ability and advancement of the XP-worth of an enemy are necessarily related.

To avoid the 'problems' you mentioned in the polynomial progression section, the higher levels could give progressively lower attribute boosts. Then the enemies' XP worth could continue to rise, both encouraging players to battle harder enemies and also allowing for a contiually decellerating advancement of skills, which you seemed to want.

Though just a browser game, Kingdom of Loathing has a notable levelling mechanic. No XP exists. Only 3 attributes exist - Muscle, Magic and Mojo (sneakiness/ability to dodge). After a battle, attributes are raised directly. Then, once the class-relevant attribute is raised sufficiently, level increases. The increased level allows access to new skills, but no bonus increases in the 3 attributes. Unfortunately, I can't remember exactly how the levels increase (though suspect it works in a polynomial fashion if I understand the term correctly) and couldn't easily find that info.

Bezman: I haven't read this in quite a while so I'm not at all sure of the details I wrote. That said...

"I don't understand why advancement of skills, advancement of levels, advancement of enemy ability and advancement of the XP-worth of an enemy are necessarily related."

They're not necessarily related, but they're usually related as follows:

The player advances by killing enemies. The difficulty of this depends on the ratio of player skills vs enemy skills. The rate of progression of player skills depends upon the levelling mechanic (usually). The rate of progression of enemy skills is set by the game design in some manner.

So in effect there is one progress curve, and anything that deviates from the central curve disrupts the basic pattern. This could be faster player skill development, or it could be increasing amelioration of the the XP reward for killing enemies etc.

"Only 3 attributes exist - Muscle, Magic and Mojo (sneakiness/ability to dodge). After a battle, attributes are raised directly. Then, once the class-relevant attribute is raised sufficiently, level increases."

Depending on how the attributes are increased, this is functionally equivalent to an XP system (but arguably more elegant): instead of gaining XP which then raises attributes, you raise the attributes and then this is converted into a level.

I enjoyed Kingdom of Loathing, but I didn't play it for long. :)

Hi! I know you wrote this article, like, eleven years ago, but is there any way you could elaborate further on what Near Arithmetic Progression is? Or do you have any resources which discuss NAP?

Hi Sarah,
This is the only piece I know of that discusses 'Near Arithmetic Progression' in XP systems, although I feel certain other game designers must have tackled this topic in some way. It's so widely used as a method, you'd think there was something substantial behind it!

Let me elaborate the basic concept for you. An arithmetic progression (AP) is one in which a sequence of numbers have a constant difference. So 1, 3, 5, 7, 9, 11, 13, 15... is an arithmetic progression with the difference between each number being 2.

Now XP progression never uses strict AP, but they do have a system whereby the difference between levels increases slightly throughout. That's what I'm calling Near Arithmetic Progression (NAP). So if we look at the example from World of Warcraft of target XP increasing between levels by 400, 500, 700, 700, 800, 900, 900, 1100, 1100, 1200 etc. you can see that the amount the XP increases by each level is getting bigger, but not that much bigger in each case. That sequence shows +25%, +40%, +0%, +14%, +13%, +0%, +22%, +0%, +9%. So there is a 'compound interest' scenario here, whereby the amount of additional XP required increases by a percentage (averaging to about 14%) between each level - such that after many levels, that amount is as much as triple where it started.

That's the NAP in a nutshell... it has an exponential element (the 'compound interest' on the extra XP per level required) but not on the total XP required, only on the amount that increases at each level. And as the numbers above show, these kind of progressions are mostly put together by hand, which is another reason for calling it 'Near Arithmetic Progression'.

I hope that helps put that into perspective.

Thanks for taking an interest in this piece! I don't mind that it is eleven years old at all - everything is always up for further discussion. :)

Cheers,

Chris.

Hey Chris! Thanks for this piece and the work you've done in the industry. I'm a programmer and have recently referenced this article to help me compartmentalize these concepts for progression system algorithms I am writing. Additionally I have picked up your book, "Game Writing: Narrative Skills for Video Games", on Kindle.

I just started it, but I just want to praise the bit where you talk about all game developers, no matter their role, have to be in tune to the narrative in some sort of way. Couldn't be more true.

Thanks for the kind words, Joseph!
I always wanted to dig deeper than this into XP systems, but actually there's not much further to go without getting into the nitty gritty of the mathematical equations.

Hope you continue to enjoy the book!

Chris.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Your Information

(Name is required. Email address will not be displayed with the comment.)