Wednesday, June 19, 2013

Design (Part 3) - Luck and Randomness


This will be a series of articles about game design, using the popular games DOTA and League of Legends as illustrative examples. The specific words, "Design is an Optimization" was coined by the design director of Riot. It means that to him, design is an iterative process of optimization.

Thus if some aspect of DOTA or LOL seems inferior or different to the other, it is because a conscious choice has been made by its designers – the trade-offs have been examined, the benefits judged more than the costs.

Design (Part 3) - Luck and Randomness

Randomness or luck in games is usually considered a negative trait because in general, you want the more skilled player to win, not the luckier player. There are games with no luck involved, such as Chess. There are games where combat is influenced by luck – say like in Risk, where both players have to roll dice in combat, and it’s possible for a weaker army to win simply by virtue of getting a higher number on the dice roll.

There’s also what I call deterministic luck, like in the board game Game of Thrones – there are no dice involved, but combat involves guessing and predicting your opponent’s movement orders and combat decisions. You could get “lucky” in that you made a correct prediction and outmaneuvered the enemy, but that kind of play can be attributed to skill instead.

Through the course of history, there have been a variety of popular games on either end of the spectrum, from having zero luck involved to being almost entirely luck based (like Snakes and Ladders).

DOTA's developers seems to be happy with some level of randomness and luck in the game, even encouraging it with heroes that are specifically built around the concept of randomness. In LOL, Riot has decided that for it to be a proper competitive game, they need to reduce the luck element as much as possible so the more skilled team is more likely to win. Even when abilities seem random there's usually an element of player control involved. See below for examples!

Random Disables in DOTA

The Spirit Breaker has a passive called Greater Bash that gives him a 17% chance to stun his enemy for 1.6 seconds on hit.

The Lone Druid's Spirit Bear has a passive called Entangling Claws that give it a 20% chance to immobilize the enemy for 3 seconds on hit.

The Chaos Knight has a spell called Chaos Bolt that will damage and stun the enemy for anywhere from 2 to 4 seconds.

These random disables can be debilitating. The infamous "lucky first hit root" of the Spirit Bear has been responsible for the deaths of many heroes. And of course when you play the Spirit Breaker, his Greater Bash never seems to proc but when someone is playing it against you he seems to get bashes all the time!

Controlled Random Disables in LOL

Annie has a passive called Pyromania, that causes her spells to inflict a 1.75 second stun on every fourth spellcast.

Kennen has a passive which causes damaging spells to inflict a stacking “Mark of the Storm” debuff on the enemy, when it hits 3 stacks the enemy is stunned for 1 second.

A large part of playing Annie is manipulating the sequence of spells so the AOE nuke gets the stun proc, in order to stun multiple champions at once. Also, "priming" her passive by building up three counters first allows her to stun in the first moment of the engagement. Kennen's stun is more a sustained build up stun, where if you don't immediately disengage from combat with him you're certain to get stunned for that one second.

Random Damage in DOTA

The Phantom Assassin has a passive called Coup de Grace which grants her grants her normal attacks a 15% chance to critically strike for 450% damage, far beyond what is typical of normal critical mechanics.

The Ogre Magi has a passive ability called Multi Cast, which enables all his spells to randomly cast multiple times. His Fireblast spell ordinarily does 275 damage and stuns for 1.5 seconds - however, it can randomly be cast twice, three times, even four times on the same target. This is a basically a spell critical mechanic. A 4x multicast on a single target will deal 1100 damage and stun the target for 2.4 seconds. It even plays the jackpot winning sound =)

It's not unheard of for the Phantom Assassin or Ogre Magi to instantly kill a squishy support hero with one hit right at the beginning of a fight, before they can even react or cast a single spell. Not a very fun experience for them...

Controlled Random Damage in LOL

Jax has a passive called Grandmaster's Might, where every third basic attack will do bonus damage.

Vayne has a passive called Silver Bolts, where every third consecutive attack on the same target inflicts additional damage.

Realistic Simulation

So what benefits could randomness bring, if it hurts the competitive nature of the game?

One answer is something I call realistic simulation. Imagine a D&D RPG game, where killing goblins awarded the player loot (gold coins). The loot from each goblin killed has to be random. It would be kind of stupid if every single goblin killed awarded exactly 2 gold coins - it breaks immersion completely. It's fair, it's balanced, but you lose immersion because it immediately feels like an artificially designed world rather than a real one, where some goblins have no gold on them, and some have a lot.

So here we see one possible trade-off - the real world is random, and if a game is completely stripped of random elements, it can feel artificial and fake.

Drama and Revelation

This is another benefit that randomness brings - the act of revealing the result of a random event can cause anticipation, suspense, surprise, and drama. In some cases, this element alone is all that is needed to carry the entire game, even if it has no other elements or gameplay!

A famous example of this is the Candy Land board game, designed for young children, most recently in fact referenced in the Wreck it Ralph movie. Cars race around a track - players draw from a deck of cards which indicate how far the car advances each turn.

In some sense, the game is already completely decided at the start, when the deck is shuffled and set down. All the player does is reveal the cards one by one. It can be played alone by one child, allowing him to experience the excitement of watching which car will win the race. This game has been so popular it has been in continual production from 1949 until today.

Drama and revelation are important elements in all game design, not just children's games, and a game stripped of randomness will naturally lose some of this.

Skill in adaptation, not execution

Random elements in the game creates openings and opportunities - if you get some lucky procs, the enemy is forced to use some cooldowns, and your team has a choice - do you capitalize on this now and blow your cooldowns as well, or do you let them expend their cooldowns and take them at another time in the near future?

Without the background of a rapidly shifting state of play, the game becomes stable and biased towards the teams who had the best build composition and execution, rather than the team with the better flexibility and reaction time. Adaptive play is more exciting than a game where a team with perfect build and execution wins every time.

Faking Randomness - Pseudo Random Distributions

This is actually something developed by Blizzard in their Warcraft 3 engine which was eventually carried over into DOTA and LOL. Pseudo Random Distribution, or PRD, refers to a dynamic probability calculation aimed at reducing randomness in the game while still preserving all the benefits of randomness.

In a true random distribution, every roll operates independantly, but in PRD, the probability of an event happening is increased every time it fails to happen, and then gets set back to its initial value once it does. An example will be helpful here...

The Phantom Assassin, as mentioned above, has a 15% chance to proc a Coup de Grace critical on hit. In a true random distribution, the system works as you'd expect - every hit is granted a 15% chance to crit. With PRD, there is a pre-calculated constant, C, that corresponds to the 15% proc chance - in this case, it is 3.2%. At her first hit, the system checks for the 3.2% crit chance - if it fails to crit, the next strike is granted a 6.4% chance to crit. If that fails also, the third strike is granted a 9.6% chance to crit, and so on. If a critical does occur, the next hit after that is reset back to 3.2%.

The idea is that over a large sample, using a PRD yields the same crit chance as using a true random distribution (150 crits out of 1000 hits) but with one key difference - the distribution of the crits is more stable. Using a true random distribution results in a higher likelihood of streaks - two lucky crits in a row, or long periods without a crit. In a true random distribution, the chance of two crits in a row is low but possible (15% x 15% = 2.25%) while under PRD the chance of two crits in a row is negligable (3.2% x 3.2% =  0.1%). On the other hand, the chance of at least one crit over a long sequence of attacks is higher for PRD - over 13 hits, PRD has a 97% chance to generate at least one crit, while a true random distribution only has an 88% chance.