Mastodon Icon GitHub Icon LinkedIn Icon RSS Icon

GameDesign Math: RPG Level-based Progression

Header image for GameDesign Math: RPG Level-based Progression

Level-based progression is an extremely popular way of providing the player with the feeling of “getting stronger.” The system is born with Role-Playing Games (RPG), but it is nowadays embedded in practically every game; some more, some less. Even if it is entirely possible to provide progression feeling without levels and experience points, level-based progression is natural, direct, and linear, and it fits well in many (too many?) game genres.

However, not every experience-level progression is the same, and it is essential to design designing a fun system. Many games do that without much thinking: they just slap experience points and level, and that’s it. The general idea is that the more is your level, the more experience you need to advance to the next one. This is true, but it is just a small part of the design. In fact, you must keep in mind the effect of any gameplay element on the player, and you must be sure that what you do produces the emotion you want to convey.

I cannot give here a full analysis of the level-based progression system, but I can use simple math to explore the effects, limits, and the design space of it.

Why using a level-based progression system?

Judging from the number of games that have a level-based progression system in place, the real question is “why not?”. However, whenever we see something hugely successful, we should ask ourselves why it is so popular. The reason is that it is the most direct and explicit way to give the player a sense of progression. Players want to see that they are getting stronger, and there is no better way to do this than to show them a lot of “numbers getting bigger”: levels, damage, HPs. The player has spent hours playing to become powerful, and these big numbers are here to prove it! In many games, our skills cannot be directly measured. Sure, we can feel this warm sense of progression in Super Mario Bros when we go back to the first level and go much faster than the first time. But this is nothing respect to the feeling of going back to the starting location to deal ONE MILLION DAMAGE to that level 1 monster that gave us so many troubles at the beginning of the game.

Flow is the core concept of game design. You need to keep your player in the flow balancing difficulty. Levels and experience point are a great way to do this (sometime, a lazy way)
Figure 1. Flow is the core concept of game design. You need to keep your player in the flow balancing difficulty. Levels and experience point are a great way to do this (sometime, a lazy way)

But there is also another reason designers like to introduce levels in their game. They are a handy way for the designers to control the flow of the game. And they offer the player a clear indicator of this too. Nothing stops a player from rushing through the game like slamming a monster with several more levels than the player on its way. This kind of artificial difficulty can be done exceptionally badly, and when it does, games can be screwed by this. But if well-tuned, it is really effective.

Another question is: if we like big numbers, why use levels in the first place? Why do we not just use experience points and offer a “smooth” progression? Because it’s not satisfying! We want to see the number get bigger, but we want to perceive the change. That’s the reward after the “work”.

It is just like eating pizza. We can eat a pizza at the weekend after a week of a strict diet, or we can have just a couple bites of pizza every day. In the end, we will probably eat the same amount of pizza, but I think one solution is definitely more satisfying than the other.

Understanding the progression mechanics

Now that we know why we use a level-based progression, it is time to play with some number. Note that this is not necessary, but understanding the math behind gameplay elements is a pet peeve of mine, and I think it is helpful to understand better what and how to change something to achieve a particular goal. Also, because if you don’t do the math, your player will do it for you. At the basis of level-based progression, there are experience points. Mathematically speaking, level progression is a function mapping a certain amount of experience to a certain level.

$$ L = f(E) $$

When designing the level progression, we are designing this function. How much experience (ad so time) players have to invest in the game to gain a level? In practice, however, when designing a level-based progression, it is easier to find the inverse function: a function that, given a level, tell us how much experience we need for this. This is usually called experience curve.

Example of progression curves: Linear (blue, A), logarithmic (orange, B), quadratic (red, C) and exponential (green, D).
Figure 2. Example of progression curves: Linear (blue, A), logarithmic (orange, B), quadratic (red, C) and exponential (green, D).

We can already have some intuitions. If our experience curve is linear, then every level needs the same extra amount of experience: 10 for Level 2, 20 for Level 3, 30 for Level 4, and so on. If our experience curve is exponential, to level-up, we always need more experience than the previous level, and therefore we level-up slower at the end game. Instead, if our experience curve is logarithmic, at every level, we need less experience to level-up and, consequently, the more we play, the faster we level-up. They are all valid experience curves, everything depends on what kind of game you want.

Here, we will explore the most famous experience curve, the exponential one. The exponential curve is constructed, starting from a single concept. Suppose you have a first amount of experience at level 1: \( a \). To reach level 2, you want the player to double, triple, etc., your initial experience. So

$$ E(2) = a + ba $$

That is, the experience at level 2 should be the starting experience plus \( b \) times that. For level 3, we do the same, we wont to have \( b \) times the increment at level 2.

$$ E(3) = (a+ba) + b(ba) = a + ba + b^2a $$

In general, at level \( L \):

$$ E(n) = a + ba + b^2a + \ldots + b^L $$

That is a geometric succession, that can be luckily be expressed in closed form.

$$ E(L) = a \frac{1-b^L}{1-b} $$

See? A nice exponential experience curve. But this time you know why it is like this. You know the meaning of the parameters and how to tweak them in order to obtain what you want.

Given an experience curve, one of the importan properties we can infer is the level progression over time. How fast a player will travel along the level progression from the bottom to the top? How much time the player need to put into the game for leveling up from 10 to 11? And from 79 to 80? How can I tune the experience of a certain area?

These are all interesting question. We can find an answer by looking at the experience curve. First step is to invert the function to obtain the level progression function, that is, how level advances given the experience.

$$ L(E) =\frac{1}{log(b)} \log(\frac{a + (b - 1) E}{a}) $$

Who. That’s ugly. But there is just some parameter noise. For the sake of the discussion, we assume \( b = e \) (that’s not unreasonable) and \( a=1 \).

$$ L(E) = \log(1+ (e - 1) E)$$

Much better. Now, we need to consider the experience a function of time. Obviously, we cannot know a real function for that, but we can general idea of “how much experience we expect the player to collect at each time”. Do we expect the player to get always the same experience over time? Do we expect to get always more experience? This is very common and implemented  with high level monsters or quests giving more experience points.

Then, we can derive some kind of leveling speed function.

$$ \frac{\partial L}{\partial t} =  \frac{(e-1)}{(1 + (e-1) E)} \frac{\partial E}{\partial t} $$

And here I stop for now. I like this stuff but, more than this is probably unnecessary. The important thing is that you try to model your progression in function of time by inverting the experience curve and plugging in some “experience function”. This will help you in having a rough estimate of the time and effort needed for leveling up in your game.

Real Case Examples

How are experience curves for real cases? Pretty much similar. I’ll give you the example of RuneScape.

$$ E(L) = floor \left(  \frac{\sum_{n=1}^{L-1} floor \left( n + 300 \cdot 2^{\frac{n}{7}} \right)}{4} \right)$$

That’s definitely a more complex formula. Why is done like this? No idea. However, we can identify that it is an exponential function, in the same spirit of the one discussed above.

World of Warcrat legacy formula instead is not analytic. Instead, we have a formula for the experience required to level up at a certain level.

$$ \Delta E(L) = ((8 \times L) + Diff(L)) \times MXP(L) \times RF(L)$$

Where \( Diff \) if a difficulty factor, \( MXP \) is the basic experience given by a monster of level \( L \) and \( RF \) is a generic scaling factor. This formula start as a quadratic experience curve and then explode into exponential (thanks to the Diff formula). Giving us this strange shape (note that this is the derivate of the experience curve).

In Diablo 3, instead the formula is a nightmare like this:

$$ y(x) = \begin{cases} 150x^2+1050x,& \text{if } 1 \geq x < 7 \cr 200x^2 + 1050x - 2450, & \text{if } 8 \geq x < 11 \cr 50x^2 + 1750x + 9800, & \text{if } 12 \geq x < 22 \cr 250x^2 - 1500x - 22750, & \text{if } 23 \geq x < 30 \cr 500x^2 - 13500x + 88000, & \text{if } 31 \geq x < 35 \cr 200x^2 + 1800x - 80000, & \text{if } 36 \geq x < 50 \cr 2500x^2 - 145000x + 2102500, & \text{if } 51 \geq x < 60 \end{cases} $$

Where \( y(x) \) is what we called \( \Delta E(L) \) and \( x \) is the level \( L \). Why are this constants chosen in this way. I don’t know. Probably for fine tuning.


In the end, I hope you have fun with experience curves. There are thousands of different way to do them. Just remember that it is not just and always an exponential curve. Time and experience are linked together and modeling the experience curve can give you a lot of insight on how to avoid “grindy” parts in you game and keep the player in the flow.

comments powered by Disqus