Friday, January 1, 2010

Perceived Randomness: A Guide to Chance in Games

(As a primer, I’d suggest checking out Psychochild’s post about “good” and “bad” randoms, as well as my previous post about the role of chance in RPGs. This article digs a bit deeper than those two and tries to arrive at general guidelines for when chance and randomness fit into game design well.)

dice-illusion Perceived randomness has nothing to do with true unpredictability. True randomness is completely opaque: a perfect random number generator would generate a sequence of numbers that, when taken as a whole, has no discernable pattern. Its results would be completely unpredictable. We approximate true randomness through rolling dice, and this approximation of randomness is satisfactory to our perceptions as long as the dice are “fair”. When you roll dice, though, the result is not truly random. You can do some extraordinarily complex math, if given enough time, and figure out what face of the die will face up when the die comes to rest based only upon the force exerted on the die by your hand when you throw it and the composition of the die. We accept the outcome of a die roll as being random because, in common perception in the time-frame of the die rolling, we are incapable of forming and executing a process that will allow us to presage the side that will face up when the die has come to a halt.

Perceived Randomness as the Result of Theory-absence

On the level of abstraction on which a human being operates throughout his daily life, nothing is random from an objective view. For any event we can trace causes and effects into and beyond the conceivable and perceivable past.

If we’re diligent and use all the tools at our disposal, we can reliably form useful theories about events (e.g. theories that can predict the outcome of events given inputs we can gather from our perceptions) . In the course of your life, you will rarely have the time to be so diligent—you do as little work possible to establish theories about the world that are as effective as possible in the context of your everyday life.

When you can’t investigate the causes of an event and you cannot conceive of what the causes might be (or you don’t have the time to conceive of causes), you perceive the event as being random. We usually ascribe meaning to events that we perceive of as random because we do not like to feel as if we’re at the mercy of cast dice—it does not sit well with our teleological sensibilities. From this fact all superstition has grown. The seemingly insurmountable role of chance in life can also lead to hopelessness if taken too seriously. If all events rely on an external factor over which we have no effect (chance, in this case), why should we bother trying to effect certain outcomes with our actions? If some talentless hack can stumble into riches while I slave for my entire life for barely any money and recognition, why should I bother working so hard?

Perceived Randomness as Uncertainty

We know with varying levels of certainty how specific parts of the world work. If we don’t know well-enough how something works, we will perceive the outcome of that something as random.

If I’m certain that an outcome will result from some event, that outcome cannot be random with respect to that event in my perception. I know what is going to happen—the pattern is determined so the result is clear.

If I have no information about how what outcomes will result from some event (e.g. I am completely uncertain as to the outcome of the event), the outcome of the event is indistinguishable from a the event randomly determining an outcome.

If I have some moderate degree of certainty about the outcomes of an event, I still can perceive the event to be random, but with well-defined outcomes of limited variety.

This is a restatement of perceived randomness as theory-absence, but in simpler terms.

Gauging Perceived Randomness

Four elements that lead us towards perceiving an event or outcome as practically random:

  • How much agency do we have in determining outcomes? If I have no perceivable say in the outcome, it might as well be determined by chance.
  • What do we know about the process, abstractly? If I don’t understand how certain outcomes result from certain situations, those outcomes might as well be determined by chance.
  • How much information do we have about this particular execution of the process? Even if I understand the process, if I cannot perceive details about this specific execution of the process, I still have no hope of making a prediction, so the outcome might as well be determined by chance.
  • How remote in time and space is the outcome? The further away, the more uncertain, the more “random” the result will seem to us. As subevents resolve, the likelihood of the main event resolving in a certain way will become more and more easily perceptible and seem less random.

We can use these four elements to decide what parts of a game are best suited towards being procedurally or randomly determined.

  • If the player has no say in some event’s resolution or introduction, that event is well-suited towards having elements of randomness.
    • In Europa Universalis 3 there are some relatively fine-grained events that can happen within your kingdom that the player would have no way to cause or prevent, these events are introduced randomly as the game progresses.
  • If the player has no way of gaining knowledge about how a specific event actually happens, it makes sense to allow some randomness in how that event unfolds.
    • The player has no way of knowing how each magical item in Diablo II was made, so the player isn’t shocked when there are a wide variety of effects in a wide variety of magnitudes that are applied seemingly at random to items.
    • In Civilization games, the actual tactics of individual units in combat are entirely skipped over, so it makes sense for there to be randomness in the resolution of combat.
  • If the specifics about some particular event’s occurrence cannot be reliably shown to and understood by the player, randomness can play a role in deciding the result of that action.
    • Dungeons and Dragons’ combat resolution engine generally does not care about how a sword is swung under relatively normal conditions. To represent the minor variations of the PC’s swinging motion and the opponent’s defensive maneuver, it makes sense to use randomness.
    • Most RPG combat systems don’t make you worry about how exactly a spell is cast or a sword is swung. So we see a bit of randomness in the results of such actions.
  • What happens very far away, very long ago, or very far into the future does not need to be resolved with the same level of detail as what the player is currently doing. Some randomness can reasonably be used to stand for that detail.
    • In a TBS game like Civilization, a war between two far-off nations who are beneath fog-of-war for the player can be simulated more easily through a more liberal use of randomness. No need to move units individually when the player can’t see, for example.
    • In AI War, the AI’s production and resource gathering operations occur in another galaxy that is inaccessible to the player. The game doesn’t actually simulate this universe’s specific resources and the construction of ships and structures as the game shows the player’s resource gathering and construction. AI War warps AI ships into the player’s galaxy based on some heuristics and some randomness.


VRBones said...

The trouble with "Perceived Randomness as the Result of Theory-absence" is that the player is attempting to gain understanding of the underlying system through analysis of events presented to them. Players start out with little or no theory about how the world is working, but through repeated exposure should be able to gain insights into how the system works. Players may perceive the events as random initally, but if they actually ARE truly random then the player has nowhere to go; they may as well not try, just wait for the dice to fall in their favour.

I agree with your analysis of how we perceive randomness, but do not believe it should be used as an excuse for random events without cause. All random events should strive to give meaning to the game, for in these events lie the path to understanding and progressing through the game. You WANT the player to get to the point where they feel confident that the randomness is limited to a specific set of events that they can discern, and that they are comfortable with leaving it at that uncertainty level.

Some other interesting reading on randomness in games:
Randomness: Blight or Bane
Our cheatin' hearts

evizaer said...

"The trouble with "Perceived Randomness as the Result of Theory-absence" is that the player is attempting to gain understanding of the underlying system through analysis of events presented to them."

In the first two sections I was actually talking about how we perceive randomness in real life, not in games.

"I agree with your analysis of how we perceive randomness, but do not believe it should be used as an excuse for random events without cause."

You may have taken my analysis to be more forceful in its recommendations than it actually was. I was laying down a framework for finding out where randomness fits into game design, not an algorithm into which go game designs and out come where randomness should be used.

Brian 'Psychochild' Green said...

I, too, started thinking about the first section of your post in terms of a game. I think it's interesting to point out where people accept a feeling of randomness in the "real world" and how that translates to what players accept in the game.

One concern when translating this to games is that most of the elements we might think of as random aren't. As Einstein is paraphrased, "God does not throw dice." In a perfect simulation, there would be no random. But, obviously, we do not have perfect simulations. :) But, the design issue then becomes where you try to create a simulation and where a random result is "good enough".

I also think it's interesting to see how these situations apply in a game. When I don't know the game mechanics, I might attribute something to randomness when there's actually a lot more going on. When people reverse-engineer a game mechanic, it can take a lot of the apparently random element out of it. Of course, this can also cause problems as players make choices to exploit the system more fully.

Random elements also have other important design features. Since you only briefly touched upon the game design aspects in the last part of your post, I'll wait for you to take the lead in that. :)

motstandet said...

This is nitpicking, but Einstein was referring to the theory of Quantum Mechanics, in which the state is not deterministic. Particles are "probably" in many states; Einstein didn't buy it--"[God] does not throw dice."

Quantum physics is very much a proven science; transistors would not exist without quantum mechanics.

If real physics includes random values, then any model of the real world would include Random randy = new Random(); :P

Brian 'Psychochild' Green said...

motstandet wrote:
If real physics includes random values[...].

Is quantum physics random because it truly is random, or because we don't understand it enough and therefore ascribe the behavior to randomness, as evizaer wrote?

I picked that specific quote for a reason. :) If you believe in an omnipotent creator of the universe, then you could believe that quantum physics isn't random, but controlled in a way that mere mortals don't understand.

motstandet said...

The state of a QM system is described by a wavefunction, which outputs probabilities.

It is our inability to accept indeterminism that is the problem. The classic/Newtonian physics model is very definitive when talking about large objects. The theory of the very small is bizarre to us (e.g. particles cannot have both position and velocity).

Tesh said...

QM uses wave functions and probabilities because that's how we've come to describe it. That's not the same thing as understanding what is going on from an omnipotent view.