Tag Archives: games

Math in Game Design Pt1: The Level Curve

Game system design can seem like sort of a dark art to the more creatively inclined. Which is a shame as it can prove to be a powerful tool in your arsenal. Furthermore you needn’t have knowledge of material any more advanced than what you learned in high school. All you have to do is learn to apply math to simple game problems.

I feel that I can usually get a good idea of a designers pepper by looking at their formulas. In general there are three levels of understanding:

  • A designer can create a system that makes sense.
  • A good designer can find ways to make that system intricate and scalable.
  • A great designer will see how numbers translate into player enjoyment and frustration.

In this blog I’m going to start to share some game problems and examples of how the power of math can solve them. This post is aimed as an introduction so I will start with the most basic examples:

Problem #1: The Level Curve.

This is such a staple, but a lot of aspiring designers I know have never even made a level curve, the mind boggles!

A level curve is straight forward in isolation, but it could impact a great many faucets of your game. So, It’s best to ask yourself some general questions before you begin.

  • How many days should it take to experience everything your game has to offer?
  • How much EXP are you dishing out per kill/race /click?
  • How many battles/races/puzzles do you want per level?

Try your best to conjure up some solid numbers in answer to these questions. You may think it too difficult to accurately pin it down. Some people prefer to playtest prototypes constantly to get a feel for the underlying numbers. Others build elaborate simulations and run those thousands of times. If you are starting from scratch, it’s best to go with what you ideally want in your game. Personally I love plucking ideal numbers out of the air, its roughly 100x faster then building anything!

These numbers will be your guiding star, your constants in a sea of digits. They are the framework of your level curve. Your level curve could well be the central nervous system of your game. Don’t be scared to make these seemingly big decisions on the spot, just dive in, it will be alright.

If you are building an RPG your answers to the above questions might look something like this:

  • (8 days) ~ 200 hours to complete
  • Player gets 10exp per battle + another 6 per level they are at.
  • (lvl1) = 1 battle, (lvl2) = 2 battles, (lvl3) = 3 battles, (lvl4) = 4 battles, (lvl5) = 5 battles, (lvl6) = 6 battles, (lvl7) = 7 etc…

Great job! Thanks to these values the math seems like a zero brainer. Let’s open a spreadsheet and make a simple graph.

Level Battles required EXP won per battle Total EXP accumulated
1 1 16 16
2 2 22 38
3 3 28 66
4 4 34 100
5 5 40 140
6 6 52 186

Xp Curve

One basic curve! But wait… How do we know how long it will take a player to actually reach level 6 in the above example? It’s impossible to know if you don’t have an idea of the time it takes a player to perform an action that awards EXP in your game.

Again, I suggest aim for your ideal, and later build your game according to that ideal. You are the designer after all. As the designer I might say that a race in my kart game should take on average 3 minutes to complete. Also I believe that my game should last 20 hours. Following the 1 race for each level rule I wind up with the following progression:

XP Curve 

If each race is 3 minutes and I want my game to last 20h that means my game is ~400 races long. Wow! But let’s be honest, the player won’t spend all that time racing right? Ideally I want 5 minutes between each race for tuning the car/ decorating. Accounting for the extra 5 minutes per race changes our level curve to this:

Xp Curve

The number of races seems reasonable to me. But it now takes the player 20 hours to reach only level 17. Ouch! I want the player to get to level 40 by the time they have sunk 20h into it. In order to do this I need to make them level up faster in fewer races.

To do this we must increment the number of races required to level up a lot more gradually each level, to do that we have to introduce a delta value that we use to increment the number of races by every level.

Level Races required to level up Races Delta EXP required  (rounded) Total EXP accumulated (Rounded) Total races run
1 1 0 16 16 1
2 1 0.1 22 38 2
3 1.1 0.1 31 69 3.1
4 1.2 0.1 41 110 4.3
5 1.3 0.1 40 162 5.6
6 1.4 0.1 64 226 7


Simply put, the number of actions (races) required to level up = the number of actions it took to level up previously + the delta. Your delta can increase or even decrease as the levels rise. Depending on where you want the player to grind or simply take it easy.

I have to calculate the XP required per level a little differently adjusting for this smoother, more gradual curve. The amount of XP earned from a race is still 10+(6*player level). But I multiply this value by the ‘races required to level up’ number to get a more accurate measurement of how much XP the player should have to earn to attain the next level.

Deltas are my go-to technique for level curves because it gives me the ability to control the curve as closely as I would like. This is particularly important in earlier levels.

Resulting curve:

Xp curve

Other methods:

I have not seen it done on live games but I have often seen budding designers attempt a completely formulaic approach, usually leveraging the Fibonacci sequence (or similar). Curves of this nature generally use a derivative of the following formula:

Basic Formula:

  • Current level = F
  • XP required to reach current level = N
  • N = (Xp required to reach level F-1) + (Xp required to reach level F-2)

Curve Result:

Fibonacci curve

So this curve is obviously not practical due to the rate that it escalates. But we can alter the formula to make it nice and smooth.

Basic Formula:

  • Xp = (Xp required to reach level F-1) + ((Xp required to reach level F-2)*0.1)

By multiplying part of the formula by a factor of *0.1 we slow the climb of our curve quite visibly.

bad xp curve

While you might make a neat curve from 1 – 100 using this kind of technique, you have set your game up poorly for any additional levels you may want to add down the line. You will likely wind up dishing out exorbitant amounts of XP to keep up with new level requirements. It seems inevitable that you would find the need to slow down the curve at some point.


By now it should be clear that building a lovely level curve is not rocket science. As long as you define your constants before you start. If you are struggling to think of some clear numbers, ask yourself the following questions to get started:

  • How many days should it take to experience everything your game has to offer?
  • How much EXP are you dishing out per kill/race/puzzle?
  • How many battles/races/puzzles do you want per level?
  • How much time does it take to perform one battle/race/puzzle?

Use your constants as a set of requirements that your level curve has to conform to. Initially identify the primary action of your game (such as fighting) and figure out how many primary actions a player should perform to get to the next level.

Secondly, you should build your curve formula to be easily adjustable and scalable. As most games released now are often actively updated and maintained, level cap extensions are common occurrences. If you don’t have control over the XP requirement ramp in later levels, you may wind up placing unreasonable requests on players. Bad numbers = unhappy players, after all.

Bitcoin and the Secret to Virtual Currencies.

Bitcoin and the Secret to Virtual Currencies.

Ah Bitcoin, how you have grown! I must admit that in your infancy I, like many other web users saw you as a glorified gift voucher. The attitude many of us adopted early 2012, was similar to that of a neglectful father, scarcely acknowledging their daughter’s latest macaroni assortment in the fridge – ‘Grin and bear it’ … one day we where certain that the bitcoin/macaroni monstrosity will vanish from the internet/kitchen and no incriminating evidence will be seen or heard. A tragic story of modern day indifference.

It goes without saying that the smug users of the internet were more than wrong. As of the 12th of April, a single Bitcoin was valued in the region of $250 a piece before enduring a near frantic free fall in trading. I don’t know what’s more impressive, that a pretend coin that is really nothing more than a bar code can be valued so highly in the first place. Or that the same currency survived what looked at the time to be a total collapse. Beyond the bout of the recent selling frenzy, and the hundreds of attempted hacks, Bitcoin as a bonafide true and blue currency remarkably, still has strength.

But this is not a piece about how impressed we all are, or of how digital currency could change the global economy. I won’t write much about these things because I am a Game Designer and whilst I care about these things; it is not my job to care. However, when I hear of a digital economy doing well I feel a breeze of jealousy. When nearly all the currencies I have carefully crafted and created, managed and sustained have fallen to my old advisories: inflation, redundancy and exploitation. Where I have failed repeatedly: Bitcoin has succeeded. This must have been how the now obscure Samuel Pierpont Langley felt when he heard of the Wright brothers 60 second flight. Except that in my case, the Wright Brothers have been obnoxiously flying around my head for over a year now.

I am aware that there exists no company, or person for me to acknowledge as a victor here. Furthermore, the war for the approaching digital economy, best described as a boundless sea of Bitcoins, Bitcash or whatever currency you can dream up next. Has just begun. I feel no remorse as I gut Bitcoin, to unlock its secrets. Laying out the key factors in Bitcoin’s success. Highlighting how can we successfully model such an economy in a digital game and attempt to create a set of standards for game economies to follow. Above all I want to know how I was beaten at my own game, the game of creating something of value, something that people care about from nothing.

Observation #1: People only care about things that have value.

People care about Bitcoins, much like people care about any other currency. It’s a colossal achievement, but easy to take for granted. What really needs to be understood is that the sensation of ‘care’ is incredibly difficult to foster in humans; even once established it’s easily corrupted. As contemporary money fulfils a basic necessity, it appears obvious that all humans should care about it… right? But was that always the case? I imagine back in the Egyptian BC’s people were uncertain whether gold was something worth cherishing, after all, how was someone to know how much gold actually existed? Or, if this new shiny rock could be counterfeited?

Imagine a scenario today, where one lucky fellow discovers a huge abundance of gold under his back garden. Or perhaps more feasibly, a factory begins to mass produce a synthetic equivalent to gold indistinguishable from the real thing. Slowly but surely we would start seeing gold everywhere in our daily lives. Over time after much exposure and overwhelming supply of the element we would no longer treat it with the same reverence we have done historically. King Tushratta of Egypt once claimed that gold in his kingdom was ‘more plentiful then dirt’ words of a man who seemed to care little for the rock.

Observation #2: Rules can create value, and we can write the rules.

When creating a currency in the modern day we frankly don’t have the time to sit around for a century as the prospectors pickaxes slow down before we get the general idea of a resource’s value. In this age of recession and calculated risks we need to give people a sense of security and reassurances up front. To do this our new currency needs a set of rules. And not just any rules, rules that give players of games confidence in its value. Bitcoin achieved this with a simple set of rules outlined by its ‘base protocol’.

In summary, the Base-Protocol is a set of rules that have been programmed to create a guarantee that Bitcoins will be the following:

 – A finite resource that can no longer be generated beyond a certain year.

 – A currency that becomes increasingly difficult to ‘discover’ freely over time.

 – Will exist as long as people support it.

In essence, Bitcoins’ base protocol was designed in the image of a non-reactant precious material such as gold, silver and platinum. In order to give itself the perception of value, it makes sense that we should naturally compare the two things when the models that govern them are comparable. It reminds me of a common trick used by game designers that involves inserting recognisable objects into video game worlds. By presenting a player with something already familiar to them you can minimise the time spent explaining its functionality. For example, a reasonable person would expect in a game that an umbrella would shield them from rain, as much as they would expect a coin to give them some purchasing power.

It seems that the above trick (referred to by some as mental preconception or schema theory) works just as well these days when all physical objects and abstract representations are removed. This implies that people are ready to accept the model of a currency in a disembodied state, as long as it simulates something known and predicable. What may be baffling to some is how a digital currency manages to set itself some rules that we become to believe as fact. The answer is really is as straight forward as a promise.

Observation #3: People have evolved to accept promises.

If we were to scrutinise human behaviour throughout the ages, it may not come as such a surprise that as a species we are prepared to accept a promise in the first place. In fact, it seems as if it’s almost instinctive to us at this point to accept promises involving money. Every Dollar, Rupee or Yen we might own, was at some point a promise of some small amount of gold from the national bullion reserve. After war and recession eventually broke the link between the paper and the guarantee of gold, people still continued to trust the value of money. We trust in banks that tell us we have cash in our accounts, even if all we see as evidence is a number displayed on the ATM screen. And our banks trust that their costumers will repay their mortgages. Believe it or not (given it’s a fact, I suggest that you believe it) our planet’s economy is currently over $200 trillion in debt to itself, that’s over 300% of our global GDP. The only thing that keeps it all together is the promise made by individuals and corporations to financial bodies that the outstanding balance will be paid off at some point. Resilient and trustworthy humans do indeed ride on the waves of boom and bust, our sail powered by promises that tie us to debt, growth and prosperity.

No matter how much you currently distrust the milkman with your wife, ours is a species that simply thrives on promises. Through marriage, peace and economic growth, we are constantly writing both formal and psychological contracts with one another whilst placing some kind of value on them. It seems that only recently our trust has started to extend to systems and computer networks not associated with anyone in either public or private sectors. This may be due to our now blossoming relationship with the internet, or as a by-product of the faith lost in banks during the Great Recession. Perhaps it only now becomes logical to us, that paper currency should eventually go the way of physical media.

The Great Game Economy.

One might argue that computer games, particularly those designed as asynchronous or synchronous worlds occupied by many players should at this point be the authority on digital economies. Speaking matter-of-factly, they are not… what game developers excel at is the practice of manufacturing aspirations for a person, and then proceeding to place intricate roadblocks between that person and their new-found aspiration. The aspirations in question range from building cities to slaying dragons. In these scenarios, as with many more, money is not the ultimate goal for a player, but a hindrance. Much like a jam jar that can only be opened with moderate force, it will be a matter of time before you are the mayor of jam city.

So when I ask myself why precious game economies have so frequently fallen flat over time, the answer has more to do with games failing to give people adequate reasons to want money and ways in which to fruitfully spend it. However, assuming all capitalist desires are present, a robust digital economy would entail, as this piece describes: the creation of cash that attempts to approximate an already widely understood model for currency. This is in order to create the impression of lasting value. The economy must then subsequently fail to deviate from the rules set forth by the model it is trying to mimic, as to inspire the trust of the games players. As of now in the year 2013, both the players and yourselves are more likely than ever to trust in the value of your all-new currency. This is all due to the manner in which we have evolved to accept all sorts of promises involving money.


At this juncture most games are closed loops and currencies offer no real liquidity outside their respective spheres. However, what if, say the objective of a game was to mine a Bitcoin equivalent? Imagine if those Bitcoins could be bought and sold on the open market as a true currency. Consider for a moment the potential of bringing the concept of secure digital currencies to the masses, through the medium of games… just a thought.