Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Many games use random numbers for things like attack damage, gold loot, or monster type being spawned. It is obvious that random numbers allow you to generate content to make games more re-playable, but I am talking about specific things. For example: In DOTA, when you kill a monster you get a random amount of gold in between x and y where x and y never change. When you attack anything you have a chance to do damage within a range such as 52-60. How would making the gold drops static change the game?

I feel like the random numbers enhance the game-play, but I am having trouble understanding why. Does anyone know any reasons why random numbers can make game-play better when used with things like damage or loot? I'm hoping for answers that don't attribute it to luck being a good thing.

share|improve this question
    
There actually are pen-and-paper RPGs that work without the ranges; and some without the dice, from what I've been told. Hell if I can remember the names of any of 'em, though. –  Nick Wiggill Dec 21 '11 at 14:43
5  
Ranges could also be a simulation/simplification of real-life behavior. If you hit somebody several times, the amount of "damage" you do won't be the same with every hit. And not everybody carries the same amount of gold in his pockets :) –  bummzack Dec 21 '11 at 23:03

6 Answers 6

up vote 39 down vote accepted

I want to start by making a distinction between frequent random elements and infrequent ones.

If you're playing a game where you attack something once every 5-30 seconds, then damage happens frequently. If you're playing a game where you attack less frequently than that, maybe once every minute, then it is not frequent.

As an example, table-top RPGs, by the nature of being a board game played by human beings who have to do math and talk to each other, does not qualify as "frequent". Your RPG gaming group would be exceedingly fast if you make an attack roll every 1 minute; you're probably looking more at 3-5 minutes. And that's just for the time you're in combat; the time spent out of combat involves no attack rolls, and it can take just as long. So maybe half of your RPG time is spent out of combat (depending on the group, of course). Let's say you get one attack roll every 10 minutes.

Compare this with any videogame RPG. In fact, let's go straight for Diablo. In a 4 hours session, how many attacks have you made against monsters? In a 4 hour session, you've probably killed more stuff than the table-top group even encounters in an entire campaign.

What does this mean? Well, for the table-top player, each roll matters. It matters a lot. Each roll is precious, so you spend a lot of time maximizing the potential of each roll. You spend time acquiring weapons, items, and buffs to make each roll matter as much as possible. Those 9.5 minutes between attack rolls are there to ensure that when it comes time to roll for attack, you get the best bonuses and circumstances possible.

Some table-top players have dice superstitions (though some only do them in jest). Dice are hallowed among some table-top players, for they live and die based on them.

For the Diablo player, the random element means... nothing. Each roll doesn't matter that much, because 2 seconds later, you'll just make another one. If that attack did minimum damage, that's fine because you're about to make another one.

The only time it might matter is that you might run into a streak of bad luck. But really, how can you notice when you're making attacks once every 2 seconds, and many of your attacks are hitting a half-dozen monsters? Can you truly say that any particular death you may have suffered was due to bad damage rolls, rather than just too many enemies all attacking you?

Therefore, I submit the following idea:

  • In order for the random element to truly matter, it must be infrequent.

Poker is a good example. How long does it take for a hand to play out? 2 minutes or so, maybe 1.5. That's long enough to really consider the statistics of the matter. You have time to think about it, make decisions around it, etc. And to do that, you need time.

So if it doesn't matter, why does Diablo have random damage? My guess? Because that's how table-top RPGs did it. Simple idolatry: game developers looked at table-top games and just copied them without thinking about whether it actually mattered anymore.

Indeed, you can see how poorly this is done by looking at the ranges of damage. In table-top D&D, your damage range is huge. A 1d20 weapon has an absolutely massive damage range. It could hit as as ineffectively as a 1d4 weapon. Or it could hit harder than a 2d8 weapon. You don't know, and you won't know until you roll.

What does a large damage range give you? This is where you start getting into psychology. At this point, it's truly gambling. The player wielding a 1d20 weapon wants that 20. He can smell it. But he's not going to get it. He's not going to get it often. But sometimes he is. And sometimes, not always, but sometimes, that 1d20 weapon will hit big when he needs it.

And sometimes, you'll roll a 1 when you really needed high damage. The highest of highs and the lowest of lows.

What is the most consistent damage weapon you can get in D&D? Maybe a 2d6 weapon; very consistently rolls 7-8s. But a 1d20 averages 10.5s, 2d10 average 10.75 on a bell-curve, and 2d12 averages 12.75 on a shallower bell. If you don't want to gamble in D&D, you're going to have to settle for lower damage. It may be more consistent, but it's lower.

Notice that once you start giving weapons +X bonuses, effectively increasing the minimum damage, the preferred weapon changes. That 2d6 weapon with a +4 bonus is in many ways better than a 1d20+4 weapon.

Videogame RPGs (unless they are direct ports of D&D or some other table-top rules) will have much smaller damage ranges. They'll have the equivalent of 1d10+40 damage. A large base damage, but with some small variation at the top.

Gambling in this system just isn't as important. The reason why is quite simple: a 1d10+40 weapon is guaranteed to do at least 41 damage. It might do 50, but that's only 9 damage up from 40.

In smoothing out the damage curve, it takes away the lowest of lows. But it also takes away the highest of highs. Can you imagine cheering that your 1d10+40 weapon did max damage against a dragon with 500 Hp? Now imagine your 1d20 weapon did max damage against a 100 Hp Beholder. That's a pretty big difference.

Therefore, I submit the following idea:

  • In order for the random element to truly matter, the range of values must be large, relative to the smallest guaranteed value.

So, why is the gold looted from a monster in DotA random? Because it's "supposed" to be random. Not because of any clever design, meticulous planning, whatever. You could make it not random and change virtually nothing about how the game plays out.

Yes, you would be able to know for a fact how many enemies of that type it takes to get the money to buy X. But since the range distribution is so small, you already know the maximum number you have to kill. So you must have a plan to deal with the eventuality that you will need to kill that many. Therefore, all that changing it to a fixed number does is turn it from a probability into a certainty.

Let's say something costs 250 gold. So, worst-case, that's 5 monsters that drop from 52-60 gold. But best-case, that's... 5 monsters. So if they dropped 56 gold, it would change nothing.

But let's say you're talking about a 1000 gold item. Worst-case, that's 20 monsters. Best case, that's 17. On average, it's 18. But, since it takes so many monsters, the highs and lows will average out. So you're much more likely to need 18 than you are to need 20. Again, changing it to the average changes nothing.

The ultimate evidence of this can be seen in the various WarCrafts. WarCraft 2 used random damage, with a large base and a smaller range. So did WarCraft 3.

And while it owes a very great deal to WarCraft 2 in terms of design, StarCraft specifically has no random damage at all. The only random numbers used in StarCraft (multiplayer) matches are when attacking high ground.

You might have heard of StarCraft: the single most widely played eSports game in the world. More than WC2 and WC3 put together.

To summarize, I would say this. If you want random elements to matter:

  1. Make them infrequent, so that the player plans around the random events and can anticipate them.
  2. Make the range of randomness broad, so that the player is actually gambling and can get into the spirit of that psychology.
share|improve this answer
2  
I think this answers my question. I think it makes more sense that a lot of developers add them just because others have before them back to D&D. Thanks. –  BarakatX2 Dec 22 '11 at 7:44
    
+1 Great answer! "Monkey sees, monkey does" is what this developers does. –  NemoStein Dec 27 '11 at 20:10
    
Great answer! Just about the random damage, if you know you cán do a 100 damage in attack X but, thanks to randomness, you avarage at around 95, you are happy to see that 100 pop up every now and then. Though for gameplay, I agree it changes very, very little. –  Johan Dec 28 '11 at 12:36
2  
I submit that frequent random damage DOES matter, even if it's small. Warcraft demonstrates this better than Diablo, but the same rule would apply there. All things being equal, when two units of the same type fight, without random damage, the instigator will always win. With random damage, there's a risk in attacking unless you possess the upper-hand. The same could be said in Diablo, not for the majority of the fight, but when you're on your last legs, "rolling" high may just save your life. –  salmonmoose Mar 15 '12 at 23:40
1  
-1 There happens to be very good gameplay reasons for the random damage. See my answer. –  eBusiness Mar 16 '12 at 9:15

There is one very simple, and very good reason for why games use random numbers for rewards. The Skinner Box. Basically, what this says is that humans (and other animals) get a lot more endorphins when rewards are randomised than if they're either always the same, or if there's a (very obvious) sequence. More endorphins mean people are happier, and that often seems to translate to "more fun", even though in some/many/all cases, it might not actually be "fun".

share|improve this answer
4  
The concepts in the video do get close to what I am looking for, but it is more about conditioning players to think they enjoy a game by controlling a reward "schedule". The skinner box shows that animals/humans can be conditioned to make certain decisions. I don't think it really says much about randomizing very specific game values like attack damage or the range of gold loot from a certain monster. –  BarakatX2 Dec 21 '11 at 4:48
    
This was so informative! Thanks! –  jco Dec 21 '11 at 9:06

It gives the game a bit more of challenge and strategy. If you know you have to kill 10 enemies to get 100 gold, then you know exactly how the game will play out. However, if you have the chance of earning more or less of something randomly, then those kind of predictions aren’t as accurate and possibly more “fun".

Imagine playing a game level where you always know there will be an enemy jump out from behind one bush. If you die, or have to restart, you know that enemy will be there every time and so you’ll be prepared. This works for some games but it can become boring for some players.

share|improve this answer

How you display the random numbers to the player can make a huge difference in perception and acceptance. If you show them the random number generator as dice for example, or randomly drawing a card from a deck, it's random, but they feel like they are somehow in control. If you treat the random number generator simply as a pure black box call to some math function, it's not the same emotionally. Purely from a mathematical point of view, it's identical - but emotionally to the player it's another matter.

Dice for example are very acceptable random number generators, because even though they ARE random, players are much more prone to place emotional weight on the results of a roll. Players groan or cheer based on if they roll a low or high number. Even if they rationally understand it makes no difference, subconsciously many will feel like they somehow can influence the outcome of dice by shaking a bit longer, blowing on them, etc.

If you'e ever played a game like DnD, think about how you hold your breath a bit when the DM rolls for wandering monsters. Or if they are rolling for random treasure and it comes up "20" on a 20 sided dice, meaning "special treasure". It's far more exiting that way, with a lot more anticipation of the results.

So in a way, using random numbers that the player feels they can control (even if they can't), makes them feel more in control and thus not just being tugged along some "random" path of events by a blackbox random number generator. They "get lucky" and get the "special reward" sometimes, and they aren't upset if they get an average reward. And even if they get the "low roll" sucky reward, they blame the dice, not the game.

share|improve this answer

Imagine Diablo without random damage. The player run into a horde of skeletons each with 50 HP, the player with current level, equipment etc. deal 24 damage on each hit, so it takes exactly 3 hits to kill a skeleton, but the player is basically forced to waste the majority of the 3rd hit, which is a quite unsatisfactory experience.

The way Diablo is designed the makers can't know exactly what stats the player will enter a given battle with, but they do have an approximate expectation to help them set the difficulty. However, in the described scenario they can't know if the player is good enough to kill the skeletons in 2 hits or have to use 3, which means that the difficulty will be very different for the two scenarios and ultimately either too hard in one case or too easy in the other.

If the player does random damage and deal somewhere from 16 to 32 damage per hit then it will on average take a little more than 2.5 hits to kill a skeleton. Slightly worse or better stats will change this number a little, but the range is much narrower than the 2 or 3 hit case, thus it is easier to make a suitable difficulty.

Sure there are other ways of solving this issue, but random damage does it just fine, and it helps a little in the way of filling the games Skinner box quota as well.

share|improve this answer
    
"which means that the difficulty will be very different for the two scenarios and ultimately either too hard in one case or too easy in the other." You're saying 3 hits per skeleton is too hard and 2 hits per skeleton is too easy. Why is that the case? Does the player not have access to special attacks, skills, or AoE powers, or anything else to affect how much damage they do? Your case is too simplistic to justify your conclusion. –  Nicol Bolas Mar 16 '12 at 17:12
1  
@NicolBolas Do I have to explain balancing 101 to you? You'd balance a Diablo battle by the number of enemies placed, in order to make that balancing you set some target for how long it should take the player to kill the enemies, and how much damage the player should take during the battle. If you place enough enemies to hit that target for a player who can kill an enemy in 2 hits, then you will shoot way above for a player who need 3 hits. –  eBusiness Mar 16 '12 at 20:11
1  
@NicolBolas Different skills, spells etc. factor in, but it still comes down to specific integer combinations needed for killing an enemy. The maths are slightly more complex, but the result is still that some players get a benefit from just reaching an arbitrary threshold, while others are penalised for being just below. –  eBusiness Mar 16 '12 at 20:19
    
That is again an oversimplification. You can make a battle go faster and/or take less damage by spending resources (aka: mana). And you would only shoot "way above" the difficulty if the player had no AoE abilities and could only hit one target at a time. Also, this analysis don't take into account battle tactics, positioning, first-strike (hitting them with range attacks before they come after you), etc. You're "balancing 101" approach is overly simplified and useless in the actual game with actual abilities and tactics. –  Nicol Bolas Mar 16 '12 at 20:23
    
It's not "slightly" more complex; it's substantially more complex. And that complexity is what changes it from a simple +33% increase in difficulty. It might be a 0% increase in difficulty if you've got some good debuff and kiting skills; that is, the number of hits doesn't matter because they just can't hit you. –  Nicol Bolas Mar 16 '12 at 20:25

This is a must-read article by Greg Costikyan: "Randomness - Blight or Bane".

Basically the argument is that randomness opens up the set of possibilities in a game, making it less predictable, harder to master, and making each playthrough novel.

Some example quotes:

"To properly simulate war, therefore, unpredictability is essential, and the easiest way to ensure unpredictability is to harness the power of randomness [...] In other words, a wargame that contains no random elements is, by nature, a poorer simulation than one that incorporates randomness."

"Just as war is too complex to simulate accurately through an entirely non-random system, so are almost all real-world phenomena, at least addressed at a high level, and thus a degree of randomness increases the simulation's fidelity."

"the strategy of Poker is based on its randomness. Without random card allocation, it would be an entirely different, and inferior game. The strategy of Poker lies in understanding the statistical nature of the game, and managing statistical outcomes."

"adding a random element to any game creates a risk that the outcome will depend on luck rather than strategy; but it also helps to break open a symmetrical game, which is essential to prevent it from degenerating into strategic gridlock."

share|improve this answer
1  
"it also helps to break open a symmetrical game, which is essential to prevent it from degenerating into strategic gridlock." And yet, there are many board games that, despite massive computing power, have yet to be solved and therefore degenerate "into strategic gridlock". So how "essential" is randomness in preventing this outcome? It seems if you design your game well, with good rules that create complexity and depth, you won't need random elements to ensure strategic depth. –  Nicol Bolas Dec 21 '11 at 20:26
    
The inability of computers to solve some games is really just about the branching factor of the game tree and not about strategy as such. 'Essential' is perhaps an overstatement, and creating a large branching factor is another way to create variety but doing it well, without inadvertently creating many dominated strategies, seems to be incredibly difficult. Games like Chess, Reversi, and Go have remained popular by being the very best examples of this approach, but lots of others are easy to solve, sometimes even for children. –  Kylotan Dec 22 '11 at 4:39

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.