Thursday 30 August 2012

Praise for the Fibonacci Sequence, and other mathematical scaling options


WARNING: This post is heavy on math.


I am here to sing the praises of the Fibonacci sequence. For those unfamiliar with it, here it is in its glory:

0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, and so on ad inifitum

It starts with 0 and 1, and then every number thereafter is the sum of the previous two. It can theoretically start with any two numbers, and in many cases it will be more convenient to start with 1 and 2, or even 2 and 3 if the gap between 1 and 2 is too extreme for you.

But what does this sequence have to do with game design?

Game design is inherently about designing systems for your players to enjoy. In order to effectively design systems, you need to know a thing or two about math. For example, I mention in the title the word 'scaling'. For those of you unfamiliar with the term, it refers to the ability for abilities/items/classes/cards/whatever (objects in future) to be effective at all points throughout the game.


Some objects start off incredibly powerful, but lose effectiveness as the game progresses. The most extreme example of this is Dragon Rage from Pokemon. It does 40 damage, regardless of any stats. At low levels, this will kill everything in one hit; at higher levels, everything has enough health that it is pretty much useless.

Other objects start off incredibly underwhelming, but are said to 'scale' incredibly well, making them amazing late game. An example of this is technology in 7 Wonders, whose value is equal to the square of the number of them that you have. Having 4 of a given technology is extremely difficult to beat. This is not to be confused with 'snowball' effects, where an advantage compounds itself in directly competitive games.

If something is always over or under powered throughout the course of the game, scaling is irrelevant, and you probably just need to balance it better.

As a designer, you will inevitably encounter scenarios where you have to scale your objects: the relative strength of all the levels of your object, or of different objects to each other.

This is where math comes in. There are many different curves you can employ when scaling.

There is linear [or incremental]:
1, 2, 3, 4,  5,  6,  7,  8,   etc.
2, 4, 6, 8,  10, 12, 14, 16,  etc.
There is exponential:
1, 4, 9, 16, 25, 36, 49, 64,  etc.
There is geometric:
1, 2, 4, 8,  16, 32, 64, 128, etc.
1, 3, 9, 27, 81, 243, etc.
And then there is the fibonacci sequence:
1, 2, 3, 5,  8,  13, 21,  34,  etc.
There is also Triangular Growth: (for interested parties [(x + x^2) / 2])
1, 3, 6, 10, 15, 21, 28, 36, 45, etc.

The trick to effective scaling is to make each level superior to the last without making the previous completely obsolete (unless you deliberately want to build your game around that, but let's ignore that case for now)

With linear scaling, new levels are not that exciting beyond the second or third, as the fourth is only 33% higher than the third, the fourth to fifth only goes up 20%.
Exponential and Geometric growth grow out of control extremely quickly, so unless there are only a few levels of it, it will dominate and possibly break the late game.
The fibonacci sequence and Triangular growth both provide a reasonable, integral values for scaling your levels.

An example I just noticed (that blew my mind slightly) is in Dominion:
Value of Resource cards (fibonacci)
Copper - 1
Silver - 2
Gold - 3
Platinum - 5

Cost of resource cards (linear)
Copper - 0
Silver - 3
Gold - 6
Platinum - 9

Value of VP Cards (triangular)
Estate - 1
Duchy - 3
Province - 6
Colony - 10

Cost of VP Cards (linear)
Estate - 2
Duchy - 5
Province - 8
Colony - 11

If they ever top Prosperity, you can bet the next VP card (empire?) will cost 14 and be worth 15; and the next resource card (diamond?) will be worth 8 and cost 12. If.

I have also used these scaling options (specifically the fibonacci sequence) to generate stats based on a star ranking system. I rated each object from 1 to 5 on how "relatively" tough or damaging it was, and then scaled that rating using the fibonacci sequence. It results in a diverse range of values, where the difference between each can be felt intuitively, and strategies devised accordingly.

Every system is slightly different, and you should experiment with different scales on your objects, as there are times when each scaling method is appropriate.

In additon, there can even be multidimensional scaling. This is where the end value is the product of two or more different systems of scaling. This is usually only applicable to video games, as the math quickly becomes overwhelming.

The best example and implementation of multidimensional scaling is in Diablo 3. Because of the epic scale and length of Diablo 3, it has an incredible number of dimensions.

For your defence, it has the following:

  • Vitality
  • Health per Vitality
  • Armour (1 - damage reduction)
  • Resistance (1 - damage reduction)
  • Dodge Chance (1 - dodge chance)

The end product of this calculation is referred to as your EHP (equivalent HP) and is the single dimension of your durability.

Each of these values scales individually, resulting in a formula that looks something like this: EHP = HP / ( (1 - (0.1713*ln(Resistance)-0.4353)*(1 - (0.1713*ln(Armour / 10)-0.4353) )
Note that this does not take into account Mob Level, dodge, or block. I am hoping this points out why multidimensional scaling is scarce outside of computers.

Multidimensional scaling is very powerful, as it allows each of its dimensions to have a dramatic impact on the end value, while simultaneously rewarding a well rounded character.


The next time you find yourself wondering how strong to make a Goblin King, compare the relative strengths of his Minions, Shamans, Overlords, and Generals and see if you can find a pattern. The Fibonacci sequence is a very intuitive pattern, and you may have used it without even realizing it (I am not convinced the people behind Dominion did, they probably just went with what values 'felt' right). Knowing when and where to use various scaling methods may just make your job much easier.

But more on that later.

-Colin

Friday 24 August 2012

Inaugural Post

Hello everyone, my name is Colin Souva, and I am an amateur game designer. I have been interested in game design since elementary school, and have been doing it ever since. Most of my projects are for my own interests only, stories, game mechanics, and other works of interest; accumulating on various hard drives, google docs, and binders. I have occasionally, especially recently, began playing said games with my friends, prototyping, testing, tweaking, and retesting them; which has prompted me to start taking this hobby of mine a little bit more seriously.

I will be publishing my thoughts on design, as well as links to articles of interest, and documents concerning my private works. I will try and publish something every Thursday night. Anything I publish should be considered my intellectual property; if anyone has any professional interest in it, please respect the work that I've put into it, and contact me about any adaptation or publication of said works.





In order to have some actual content to this post, I will start by sharing some recent thoughts I've had about Dominion. I want to preface this, by stating that, whenever seeing a new system of any kind, I immediately try and design my own. I am also assuming that readers are at least somewhat familiar with the games I am talking about, or willing to familiarize themselves with the basics of said games.

Dominion is a great game. In it, you and the other players build a deck as you play, balancing economic cards to build your deck further, with victory point cards (which are useless in game, but the only thing that matters once the game is over).

I feel the most distinctive traits of Dominion (from a design standpoint, especially compared to other deck building games such as Tanto Cuore and Thunderstone) are as follows:

  • It is one dimensional
This is an important distinction, and one that not everyone may realize. Ultimately, your objective for any given turn is to get as much money as possible, and buy the best card you can. That is the one dimension: money. However you end up trying to do this, gold at turn end is pretty much all that matters.

This is both a good and bad thing. It is primarily good because it helps your turns consistent. With only a single resource to manage, you do not have to luck out to get (for example) both a mineral and vespene gas card in your hand to get the unit you want. It allows you to rely less on chance when devising a strategy.

Thunderstone deviates from this, and ends up with wildly inconsistent turns as it has 3 resources: gold, attack power (both physical and magic), light. Note that I am not counting experience because it does not go in your deck. It weakens the game overall (by making it harder to have an effective strategy and relying on luck instead), but makes up for it in a number of clever ways: firstly, it has a large base hand size than Dominion (6 vs 5), increasing the odds you will draw what you need; secondly, it allows you to compensate for a lack of light with additional attack; and lastly and most distinctively, it allows you to choose between spending gold, and fighting monsters in a given turn. But enough about that.

Dominion actually adds a second resource in the Alchemy expansion, much to its detriment. I have not played it, but it is the least popular expansion. You need to buy Potions to build the more powerful cards, though getting a potion and enough gold in your hand when you need it requires a lot more luck than strategy.

The way that this is bad is that it limits the inherent number of strategies, which brings me to:
  • There are not many viable strategies
I tried to come up with a list of viable strategies in Dominion. Here is what I came up with:
    • Big Money - focus heavily on buying economy cards and try and make one impressive purchase per turn
    • "Engine" Combos - use a clever combination of +action and +cards to run through large portions of your deck, ensuring you get the cards you need every turn
    • Big Buys - the idea is to buy large numbers of cheap cards; usually to fuel an engine and to deplete piles faster and end the game quickly, before enemy plans reach fruition [Note that it is difficult to pull this off, and it usually transitions into an Engine deck midgame, or combines with Aggression]
    • Aggression - you aim to end the game as quickly as possible, getting an early lead and ending it quickly. This is usually only possible to pull off in Intrigue with several Swindlers, who deplete piles at ridiculous rates, and replace enemy cards with ones of your choice, robbing them of their estates, and exchanging coppers for curses. It may also happen in games with larger numbers of players, who will each be buying from piles, emptying them more quickly.
That was basically all I could come up with, and the second two are not really that viable. I suppose I can't fault Dominion for this, as much of the excitement in this game comes from competing to make your decks more efficient rather than having diverging strategies compete. It offers a good variety of cards, ensuring interesting decisions from game to game as to how to optimize your deck.
  • It is entirely deck driven
This is an interesting choice. I want to compare this with Tanto Cuore, which allows you to "chambermaid" some of its cards, letting you keep their Victory Points without clogging up your deck with VP cards. It also offers private maids, who never occupy your deck, and give passive benefits just for having them.

Dominion offers players the paradoxical choice between economy and victory points. Focussing on economy helps you in the long run, by allowing you to get better VP cards later, while getting VP right away actually weakens your deck by diluting your good cards with VP filler.

Tanto Cuore largely avoids this decision, by allowing you to get your Victory Points and then remove them from your deck, basically getting the best of both worlds. By allowing you to streamline your deck in this manner however, it makes it easier to have more consistently good hands; which they balance out by having the 2 Love and 3 Love cards cost more than their Silver and Gold Dominion counterparts.

Both options have their merits, and I appreciate the designer's integrity of Dominion to stick to this principle, rather than make a quick and easy expansion that adds private maid equivalents that give you passive bonuses.




Examining the merits of Dominion has prompted me to go back and experiment with it, and (as ever) try and design my own that builds on it. 

But more on that later.

-Colin