
How Designers Engineer Luck into Video Games - elorant
http://nautil.us/issue/44/luck/how-designers-engineer-luck-into-video-games
======
corysama
Sid Meier (Civilization) gave a great GDC keynote in 2010 where he describes
his multi-decade struggle to convey to users ideas like "Stuff that only has a
10% chance of happening still happens sometimes."

[https://www.youtube.com/watch?v=bY7aRJE-
oOY](https://www.youtube.com/watch?v=bY7aRJE-oOY)

Multiply that by a million daily active users and it really works out to
"Stuff that has a 1-in-a-million chance of happening will happen to somebody
every day". Leading to player reviews like "The game rolled me a 1-out-of-10
SIX TIMES IN A ROW!!! The game is explicitly cheating me!!!" every day. Thus
games tend to use random shuffles rather than independent random numbers so as
to better align with common misunderstandings about statistics...

~~~
riazrizvi
I'm not sure if probability modifiers are applied appropriately when modeling
combat in games. If you are an advanced fighter, you get a +30% chance of
winning, right, so you get one biased roll to see who wins. But when I play a
better player in tennis say, they win the match almost every time. Of course I
win games, but over the match they will take the lead every time. I think
fighting in real life is like this, not a single roll but a set of rolls that
magnifies the advantage.

tl;dr I think Civ players are right to expect to win when they have a better
unit.

~~~
rangibaby
Civ 1 had two statistics: attack and defense, which were rolled in a simple
way. This lead to lucky Roman legions defeating tanks occasionally. Civ 2
added two more statistics (health and "firepower") which more clearly divided
units into eras.

For example, Musketeers will almost always lose to Riflemen even though their
stats are very similar apart from the Riflemen unit having 100% more health.

There are some things I disliked about the game, for examples city walls turns
any city into an almost impregnable fortress until the very end of the game,
but the unit health system was satisfactory.

~~~
waterhouse
Actually, in Civ 2, Riflemen and Musketeers both have 2 hit points and 1
firepower.

A good replacement example would be Archers (3 attack, 2 defense, 1/1 hit
points/firepower) vs Musketeers (3/3 attack/defense, 2/1 hit
points/firepower).

Regarding city walls: If the units inside are musketeers or weaker, cannons
may do well (depending on the units' respective veterancy). If they're
riflemen or higher, I think veteran artillery will still generally win. And
then, of course, there are bombers and howitzers in the later game.

~~~
rangibaby
Oops! I always thought riflemen had more hit point stats. Your example is much
better. Sorry.

About city walls:

The computer loads cities up with a massive amount of units on deity (usually
enough to defend against a one-turn attack, I find it difficult to park enough
cannons or artillery next to their cities). The only reliable way I have found
to take out cities is to spam their cities with diplomats and sabotage until I
get their city walls, it is always the very last thing he will sabotage.

It's hard to get a technological advantage for a long time because computer
players will always help each other with technologies so in that sense they
can get 6x as much science output as the player, although usually less because
the computer is not very clever about boosting their trade.

I think the balance would have been better if catapults, cannons, and
artillery straight up ignored city walls like the howitzer does.

The pollution from nuclear missiles contributing to global warming make the
endgame frustrating too because the computer loves to use nukes, and you are
punished for their pollution squares as well as your own. Sigh, time for a new
game. lol

~~~
TeMPOraL
> _The pollution from nuclear missiles contributing to global warming make the
> endgame frustrating too because the computer loves to use nukes, and you are
> punished for their pollution squares as well as your own. Sigh, time for a
> new game. lol_

For a more realistic and complex treatment of nuclear warfare, I strongly
recommend DEFCON.

[https://www.introversion.co.uk/defcon/](https://www.introversion.co.uk/defcon/)
||
[http://store.steampowered.com/app/1520/](http://store.steampowered.com/app/1520/)

------
Zaskoda
I was a developer on Dead Man's Hand published by Atari and developed by Human
Head. I was assigned the development of a mini poker game that pops up before
each level and potentially rewards the player with extra ammo, armor, etc. In
real life, great poker hands don't come along often. In our game, we wanted
the flip the odds so the player usually won something and only lost it all on
occasion. I basically scripted the game based on what I wanted the odds to be
and produced hands to match. This includes when the user trades in cards. The
result ended up being very addictive and was called out specifically this
review:

[https://youtu.be/rjf3G43cUfg?t=1m55s](https://youtu.be/rjf3G43cUfg?t=1m55s)

~~~
trevyn
_This includes when the user trades in cards._

Do you mean that it will produce hands to match the target odds no matter what
cards are traded in?

~~~
softawre
Looked like it, from the video. Guy holds [A,3] and draws [3,3,3].

------
writeslowly
> _Extensive play-testing revealed that a player who was told that he had a 33
> percent chance of success in a battle but then failed to defeat their
> opponent three times in a row would become irate and incredulous...So Meier
> altered the game to more closely match human cognitive biases; if your odds
> of winning a battle were 1 in 3, the game guaranteed that you’d win on the
> third attempt..._

Fire Emblem (another strategy game series) solves this problem by taking the
average of two random numbers. If the average is lower than the "to miss"
value, an action succeeds [0]. This skews the probabilities at the low and
high ends so that an 80% chance becomes 92%, 90% becomes 98%, etc, to minimize
the occurrence of "spearman defeats tank" scenarios where players assume a
1/10 chance of failure will never happen.

[0] [http://serenesforest.net/general/true-
hit/](http://serenesforest.net/general/true-hit/)

~~~
Benjammer
The "pseudo-random distribution"[1] used in Dota2 comes to mind as well.

[1] [http://dota2.gamepedia.com/Pseudo-
random_distribution](http://dota2.gamepedia.com/Pseudo-random_distribution)

~~~
tavrobel
An interesting side-effect of this style of RNG is that if you need to get a
particular RNG roll to win a PVP conflict, you can 'farm' up the roll by
waiting until you've gotten sufficiently unlucky during PVE, then go to PVP
where you will have a much higher chance of getting one right away.

I'm not sure if Dota2 has mitigations against that, but I've certainly seen it
in other games.

~~~
n0w
This is actually a strategy in game.

Go and hit a neutral unit so that you have 2+ hits in a row without your
ability/item proc'ing and then save the next hit for an enemy player since
your next hit is likely to have a higher chance of proc'ing.

~~~
eterm
In league of legends you could previously "auto-cancel", and critical hits
have different recognisable animations. So if you were about to crit a minion
you could cancel the auto-attack and "store" the crit to hit an enemy with it.

I think that's been patched now but it was there for a good while.

~~~
derivagral
This existed in Dota2 for some time as well; one could use an (illegal) mod to
quickly start/stop attacks until it found a crit animation.

------
koz1000
_" Some designers have sworn off pulling the levers of luck at all. For a long
time Larry DeMar, a noted pinball-game designer who worked with Williams,
avoided using the ball-saver in the company’s designs, believing it undermined
the purity of the game. If you lose, you lose—tough luck for you."_

Having worked with Mr. DeMar, I can also say that he engineered _other_ things
to make you feel lucky without being so obvious.

It was only recently discovered that in Robotron:2084 (a video title he
designed with Eugene Jarvis), the game's difficulty would ratchet down
dramatically if your game started out badly (i.e. you were getting killed over
and over before making it out of the first wave).

There were also some clever things Larry put into stuff like pinball match
routines. This is the "random" number that would come up at the end and if
your last two score digits matched, you won a free game. Cleverly, if you were
playing a multiple-player game, the odds of one person winning a free game
would suddenly increase - thereby increasing the real-world chances that the
rest of the players would insert more money for another round.

~~~
cableshaft
Wow, I've played Robotron a ton at a freeplay arcade and I noticed it seemed
to feel a little different in difficulty some games compared to others. I
didn't quite put my finger on why, but it was probably the games where I lost
a couple of lives in the first wave. Thanks for sharing that.

------
emptybits
I was a programmer on several baseball games on Playstation (1) & Windows.
Among my duties was AI. That meant consuming, encoding, and deploying a lot of
historic stats. They'd be sliced and grouped and accessible across interesting
combinations of team, opposing team, player at bat, player pitching, players
fielding, stadium, inning, absolute score, score difference, time of day, and
really just a fascinating set of inputs. We'd license the historic stats.

Baseball is a game of obsessively recorded stats anyways, and we'd use that to
our advantage to model pitches, plays, games, seasons, etc. into something
that 1) reflected what truly (historically) would/could/should happen in a
given scenario, and 2) was fun and kept the player coming back for more. (Or
else we'd hear about it in reviews!)

Well, turns out #2 is really, really important. Playing to statistical
misunderstandings had to be part of the consideration. "That
pitch/play/decision/outcome would never happen as often as it does! Fix it!" a
producer with more baseball knowledge than I would claim. "It's happening
exactly as frequently as it does/has historically," I would counter. Doesn't
matter. Games need to be enjoyable and that means playing to common
(mis)perceptions even if they're statistically wrong. But not too wrong. (Or
else we'd hear about it in reviews!) :-)

~~~
ooqr
Is there in general a formula for fudging statistics in the direction of bias?
I.e., 90% becomes 99% as 10% becomes 1%? Was there a general algorithm you
used. I'd be interested in hearing the technical details.

~~~
emptybits
What you describe (non-linear) would probably have been superior but in my
youth and inexperience over 15 years ago (and pressed with time and code-size
constraints) I am sure I did nothing more than a scalar, maybe clamped with a
C macro MAX() or MIN(). Sorry to disappoint; sometimes game AI and sim work
just needs to be "good enough" and ... most importantly, needs to ship _on
time_ (on shelves, yes shelves, X weeks before opening day of baseball season)
with _zero bugs_ (no online patches in those days). So there is a certain
satisfaction in that. :-)

~~~
ooqr
Thanks for the reply.

I came up with:

f(x) = (sin((pi * x) - (pi / 2)) + 1) / 2 where x is between 0 and 1

I'm a collector of randomness functions for games. Weighted, gaussian, linear,
etc. This sinusoidal randomness will be handy! Thanks for the inspiration.

------
minimaxir
There's another more technical instance of engineered luck in video games:
too-simple RNGs (as a result of system limitations) that they've been fully
reverse-engineered. Tool-assisted speed runs of games have their own category
for runs which utilize these shennanigans:
[http://tasvideos.org/LuckManipulation.html](http://tasvideos.org/LuckManipulation.html)

Most of thoses require faster-than-human actions, though. But some RNGs are
even _simpler_ : in the GBA RPG Golden Sun, the RNG is seeded only when the
system is turned on, so you can engineer any rare drop just by following an
action script. (I wrote a blog post about this specific instance awhile ago:
[http://minimaxir.com/2013/05/guaranteed-to-be-
random/](http://minimaxir.com/2013/05/guaranteed-to-be-random/) )

~~~
shados
Ive never quite understood that stuff. Monster Hunter, Fire Emblem, etc, all
have seeded RNGs. In some cases, with fixed tables to make it even worse so
that grinding for something for months will never get you what you want
without restarting in some cases.

Are those devices really unable of anything better?

~~~
khedoros1
If the hardware doesn't have a clock that keeps track of the current time, the
game could still re-seed based on the timing of player actions, because
there's a certain amount of unpredictability there (at least, more than "seed
with 0, only iterate on easily-controlled player actions"). It could do
something like iterate the RNG every frame that the player doesn't move.

------
cc439
This might be one of the reasons I've always tended to prefer games that trend
toward or actually are simulators. It's very hard to notice a "luck" mechanism
designed by a skilled and thoughtful developer but those are few and far
between. The more experience one has with a game, the more apparent things
like the holy "RNG Jesus" become apparent.

The greatest enjoyment I derive from games is that of accomplishment. To me,
there is no greater feeling of accomplishment than placing well in an iRacing
league race or having a great dogfight against a human opponent in a DCS
server. I don't even need to win the race or shoot them down to derive a sense
of satisfaction as the outcome is entirely determined by skill and one can
always strive to improve their skills.

I've always subscribed to the line of thinking that luck is where preparation
meets opportunity. Whatever "luck" one experiences in a simulation type game,
whether or not it is in their favor, is still something that required skill if
it was to be taken advantage of. If I skip a yellow flag pit stop and make a
fuel mileage gamble, I still have to have a feel for how far I can stretch the
tank and how skilled the other drivers are as if they race clean all the way
to the finish I'm going to still be a lap short. Sure, my opponents might say
I "got lucky" but my luck was a result of a calculated gamble rather than an
artifact of a lucky roll in the game's algorithm.

I'm probably the outlier but I think there's something to be said for games
that refuse to introduce artificial luck. They aren't for everyone but they
deliver an experience that can't be matched any other way.

~~~
BigJono
I think this is partly the reason games like Rocket League, League of Legends
and Counter Strike are doing so well these days. They're just pure team-based
competitive games where the only things that affect the outcome are the rules
of the game, the game's physics, and the skill of the players.

There are very small elements of luck, just enough to stop the games from
feeling sterile or unnatural, but nothing big enough to decide the outcome of
a match without being completely overshadowed by the strategic decisions
leading up to it.

~~~
pugworthy
This is only somewhat true. Most shooters rely on the concept of a shot
pattern - that where you place your crosshair is only statistically the center
of where your shot will land.

This is actually exactly what real life shooting is like. There is RNG in the
process.

What a developer CAN do is control just how tight the shot pattern is. One
example is to have a wide shot pattern when the player is standing, tighter
when crouched, and really tight when prone. Or use an "iron sights" mode for
tighter aiming.

~~~
fjdlwlv
But in real life you can tighten your shot pattern with practice

~~~
pbhjpbhj
I've just started playing CS:GO, in that you can tighten your shot pattern
with practice too -in a different way. Continuous bursts spread in a
predictable trend (a different trend with different weapons), shot interval
feeds in to spread as a multiplier.

I've not worked out yet whether higher rank/XP and health status (HP) are also
factors on shot spread and the progression of spread under continuous fire?

------
DonHopkins
The Sims had to dumb down the AI, because the autonomy algorithm for deciding
what to do next in the absence of player input was based on dynamically
scoring every possible interaction.

But if the characters always autonomously chose the best interaction, then
almost anything the player told them to do would distract them from their
perfect AI driven routine, and effectively make their lives less efficient and
more miserable.

So instead of picking the top scoring action to do next, it fuzzed their
behavior by picking randomly from the top several actions, making them less
compulsive and more whimsical, and giving the player more opportunities to
have a positive effect on their lives, instead of being a negative influence.

Then again, some people would prefer to play The Sims that way, by bringing
them down like they're wearing a turtleneck and a backpack all day, messing up
their otherwise perfectly balanced idealistic lives by acting as Satan instead
of as God, more like Afterlife and Dungeon Keeper!

------
dcw303
I have a high preference to games of skill over games of chance. Most of the
fun I get out of video games is in understanding the patterns and behaviour of
the game world, and then using that understand to master the environment. For
this to work, the game needs to be fairly deterministic in nature.

It's interesting that when tried World of Warcraft, I lost interest quickly as
I found it too much like a slot machine.

I don't know if it's a personality trait (I'm a programmer so I tend to
analyze everything) or because I grew up in the era of 8/16-bit games, where
games were a lot more skill based in nature.

------
abecedarius
In _Surely You 're Joking, Mr. Feynman_ Feynman tells of gambling at Vegas for
the first time. He calculated his expected loss at craps at around a penny a
game, so he tried it and lost 5 dollars right away -- and never gambled again.
This lousy luck and good meta-luck has been engineered away, apparently.

In _A Theory of Fun_ Raph Koster says fun is basically about learning. What
video games teach you a feel for probabilities? There's poker -- anything
else? There ought to be.

~~~
Klockan
> What video games teach you a feel for probabilities?

Every trading card game, Hearthstone is a popular example.

~~~
abecedarius
Thanks, I've never tried one yet.

Bringing this up made me wonder if we couldn't have a game that's to poker
what Go is to chess -- simpler rules, deeper play, keeping poker's
nondeterminism and incomplete information.

------
0xcde4c3db
Tetris gets into this too. The official modern Tetris rules (known as the
Tetris Guideline) reportedly specify the use of a shuffle bag [1] to avoid
having too-short or too-long periods between repeats of any given shape. Other
versions have their own methods of making the distribution "fairer".

[1] [https://gamedev.stackexchange.com/questions/11217/how-do-
i-a...](https://gamedev.stackexchange.com/questions/11217/how-do-i-avoid-too-
lucky-unlucky-streaks-in-random-number-generation)

------
ryanx435
the first paragraph is a description of a youtube video, but doesn't include a
link to it. what was the author thinking?

anyways, here it is:
[https://www.youtube.com/watch?v=5pkVVJuBfgo](https://www.youtube.com/watch?v=5pkVVJuBfgo)

~~~
rosstex
It also mentions Really Bad Chess, a refreshing take on Chess that's free for
iPhone and Andriod. Check it out!

[http://reallybadchess.com/](http://reallybadchess.com/)

~~~
westoncb
Heh—similar to this gem I found the other day:
[https://en.wikipedia.org/wiki/Knightmare_Chess](https://en.wikipedia.org/wiki/Knightmare_Chess)

------
Nomentatus
This is a very fine article, but I keep hoping to see an article that's more
general and discusses the real-world consequences (such as having to hire
spoiled employees) of the ways games systematically distort reality and
rewards.

We know that the more TV kids watch, the more likely they are to end up in
hospital from an accident - their view of physics and risk has been distorted.
Are heavy game players more likely to get fired from their first few jobs?

I grant that games have to be fun, but I wonder if there isn't a way to both
please the player, as is done now; and inform them about the downsides of
reality too - by showing them the contrast with a reality-run-through (maybe
as an option), or by showing them after the game where they got an assist, or
something.

I started thinking about this topic heavily after playing Borderlands 2 a lot.
Quite apart from the sociopathic role-playing bits, it became very clear to me
that mere perseverance was being rewarded far more than skill, or increases in
skill. Much less real learning. Just churning through a level badly a few
times would you'd level up enough to be able to Steam through it. (Pardon the
pun.) I don't know what the effects of this on developing minds are - will
they persevere at hopeless real-world tasks futilely waiting for the pity-
timer to kick in, but not really try to learn or improve in the meanwhile?
Will they rarely persevere 'cause the rewards are too slow in coming? I dread
to think (but could be wrong to be pessimistic.)

I do think I learned a lot about learning when playing solo computer games
decades ago in a way that is all but impossible now, since online players or
your buddies will tell you the most efficient way. There's nothing like
realizing you've played the carriers in Starcraft the wrong way for years to
make you reevaluate whether you're a good learner or have really tried to
figure out how the world works; or really understand the world, your
relationships or anything else.

------
WA
Check out the link in the comments about the addictiveness of Angry Birds,
too. Good additional read:

[http://www.mauronewmedia.com/blog/why-angry-birds-is-so-
succ...](http://www.mauronewmedia.com/blog/why-angry-birds-is-so-successful-a-
cognitive-teardown-of-the-user-experience/)

------
morley
Here's Richard Garfield giving a talk about Luck vs Skill in game design:

[https://www.youtube.com/watch?v=dSg408i-eKw](https://www.youtube.com/watch?v=dSg408i-eKw)

------
whyileft
Its almost like there was an actual reason many municipalities required
permits for arcade games.

------
kriro
I've always wondered how learnable an understanding of unlikely events is but
never investigated further. I guess a population of online poker players with
increasing number of hands played (10k, 100k, 1 million etc.) (preferably
winning ones) and others could yield interesting results.

------
amelius
Warning: reading this article might take the fun out of playing video games.

------
c3534l
I find it hard to take an article seriously when they claim that Olaf
Haraldsson story is factual.

------
rosstex
This makes me want to go fire up Peggle for old time's sake.

~~~
InitialLastName
I had that urge last week, and found that it had disappeared from my Steam
library. Granted, I purchased it with the "Valve Everything Pack" in 2008, but
the rest of the games from that pack are available. I guess it's just another
lesson in "you don't get to keep the stuff in your digital library".

