Sub topic 1
Why Games Use Randomness
Prerequisites
This chapter assumes you can do basic arithmetic with fractions and percentages, such as knowing that 1 in 6 is about 16.7%. It also assumes you know common game mechanics (dice, shuffled decks, loot drops) and can read short Python programs. No probability theory is needed yet. Later chapters build the formal tools.
What randomness does in a game
Randomness is any element of a game whose result the player cannot fully predict from the current state and their own choices. A die roll, a shuffled deck, a procedurally generated map, and a critical-hit chance are all examples.
Designers add randomness for specific jobs. If you cannot name the job, the randomness is probably decoration, and it will annoy players more than it helps them. The main jobs are below.
| Job | What randomness provides | Example |
|---|---|---|
| Replayability | Different situations each session | Shuffled decks, generated dungeons |
| Uncertainty and tension | A result that is not yet known | A to-hit roll in a tactics game |
| Fairness between unequal players | A chance for the weaker player to win | Dice in family board games |
| Surprise and reward | Unexpected good outcomes | Rare loot drops |
| Variety without authored content | Many outcomes from few rules | Card draws, enemy spawns |
| Hidden information | Things the player must reason about | Opponent's hand in poker |
Replayability
A game with fixed rules and no hidden or varying elements can be solved. Tic-tac-toe is a solved game: perfect play always ends in a draw, so experienced players stop finding it interesting. Randomness keeps the starting position and the sequence of events different each time, so memorizing one winning line does not work. Players must adapt to what they are given.
Tension and drama
A player feels tension when an outcome matters and is not yet decided. Compare two attacks. In one, damage is always exactly 10. In the other, a 75% chance to hit is rolled. The second creates a moment where the player waits to see what happens. That moment is a source of excitement, and it is also a source of frustration when the roll goes badly. Both reactions come from the same mechanism.
Letting weaker players win sometimes
In a pure skill game, a beginner playing an expert loses essentially every match. A game with luck gives the beginner a real chance, which keeps them playing. This is why many party and family games lean on dice and cards. Chapter 8 on balancing skill and luck covers how to choose the amount.
Content without authoring everything
Generating a level, a loot drop, or an enemy group from a random table lets a small amount of designed content produce a large number of distinct experiences. The designer authors the table and the rules. Chance does the combining.
What randomness costs
Randomness is not free. Each use carries risks that you should weigh.
- Perceived unfairness. A player who loses to a bad roll may feel the game, not their play, decided the result.
- Reduced mastery. If luck dominates, skilled play is not rewarded and good players leave.
- Frustration from streaks. Even fair random sequences contain long runs of bad results. Players notice them.
- Hard testing. A system with random behavior is harder to debug and balance than a deterministic one.
- Lost agency. If outcomes feel unconnected to decisions, players disengage.
Good randomness design is the work of getting the benefits while limiting these costs. The rest of the tutorial gives tools for that.
Seeing randomness work: a quick experiment
Randomness can feel mysterious until you run it. The following program flips a fair coin 100 times and reports the longest run of identical results. The generator is created with a fixed seed so the output is the same every time you run it.
import random
def longest_streak(flips):
best = run = 1
for prev, cur in zip(flips, flips[1:]):
run = run + 1 if cur == prev else 1
best = max(best, run)
return best
rng = random.Random(7)
flips = [rng.choice('HT') for _ in range(100)]
print(longest_streak(flips))longest_streak walks the list in adjacent pairs. If the current flip matches the previous one, the current run grows by one. Otherwise the run resets to 1. The variable best keeps the largest run seen.
Run it, then try changing the seed from 7 to other numbers. In 100 fair flips, the longest run is typically around 5 to 8. Many people expect a "random" sequence to alternate more than that and would call a run of 6 suspicious. It is not. This gap between what real randomness looks like and what players expect is a recurring theme, and a later chapter on variance and streaks explores it in detail.
Randomness as a designer's dial
Think of randomness as a dial with two ends, not a switch. At one end is a fully deterministic game, such as chess. At the other is a game with no meaningful decisions, such as the card game War, where the outcome is decided entirely by the shuffle. Most good games sit between the two, and where they sit depends on the audience and the intended experience.
Moving right on the dial has predictable effects:
- Outcomes become less predictable from skill alone.
- Newer players have better chances against experienced ones.
- Individual results feel less earned, for both wins and losses.
- Games tend to feel shorter-term and more exciting, and less deep.
No position on the dial is correct. A children's game and a competitive tournament game have different goals. The design question is always which position serves the players you are building for.
Randomness and information
A common confusion is that randomness and hidden information are the same thing. They are related but separate.
- Randomness means the result is not determined yet. A die has not been rolled.
- Hidden information means the result is determined, but a player cannot see it. A card already dealt face down is an example.
Poker has both. The shuffle is random. Once cards are dealt, the remaining uncertainty for the player is hidden information. Players reason about it using probability, which is why probability is the main tool of this tutorial.
Common mistakes
- Adding randomness to fix a boring game. If decisions are shallow, dice will make outcomes less predictable but not more interesting. Fix the decisions first.
- Using randomness where players need to plan. If a player makes a long, careful plan and a single roll erases it, the roll feels punishing. Consider when in the sequence the roll happens. The next chapter treats this as input versus output randomness.
- Assuming "random" means "evenly spread". Real random sequences clump. Designing as though they do not leads to games that feel broken.
- Ignoring the stakes of one roll. A 5% failure chance on a trivial action is background noise. The same chance on an action that ends a 40-minute match is a serious design problem.
- Never measuring. Designers often guess how often an outcome occurs. A short simulation gives an actual number, as later chapters show.
Checking whether randomness belongs
Before adding a random element, ask these questions.
- What experience should this randomness create: tension, variety, surprise, or a chance for weaker players?
- How often will players meet it, and what is at stake each time?
- Can players respond to the result with a meaningful choice, or are they just told the outcome?
- What happens in the worst reasonable case, such as three bad results in a row?
- Would a deterministic rule or authored content do the same job more cleanly?
If question 1 has no clear answer, leave the randomness out. If question 4 gives a result that ends the game for a player, add a safeguard. Later chapters on shuffle bags, pity timers, and catch-up mechanics provide these.
Summary
Games use randomness for replayability, tension, fairness between unequal players, surprise, and cheap variety. It costs perceived fairness, mastery, and testability. It is a dial rather than a switch, and the right setting depends on the audience. Randomness is different from hidden information, and real random sequences contain streaks that players often misread as bugs.
Exercise
A designer wants to make a simple duel game more exciting and proposes adding a 10% chance that any attack misses. Using the checklist in this chapter, name two questions the designer should answer before adding it, and say what could go wrong if the duel is a single-attack, winner-takes-all game.
Show answer
Good answers include: (1) What experience should the miss chance create? It should be tension, not just noise. (2) What is at stake each time? In a single-attack, winner-takes-all duel, one 10% miss decides the whole game, so the result can feel unrelated to the players' decisions and skill. Other valid questions are whether players can respond meaningfully to a miss, or what the worst reasonable case is. A safer design would apply the miss chance to a longer exchange of attacks, where results average out, or give the player a decision after a miss.
Exercise
Explain the difference between randomness and hidden information, and give one example of a game element that is hidden information but not random at the moment a player acts on it.
Show answer
Randomness means an outcome has not been determined yet, such as a die before it is rolled. Hidden information means an outcome is already determined but a player cannot see it. An example is a face-down card that was dealt earlier: the shuffle was random, but once dealt, the card is fixed and the player is uncertain only because they cannot see it.
Exercise
Run the longest-streak program with seeds 1 through 5 and record the longest run for each. Is a run of 6 or more heads or tails surprising in 100 flips? Explain what this suggests about player complaints of "rigged" streaks.
Show answer
Results vary by seed, but longest runs typically fall between about 5 and 8, so a run of 6 or more is common in 100 fair flips. This suggests that long streaks are normal in genuinely random data. Players who report a "rigged" streak may be reacting to ordinary variance, so designers should expect such complaints and consider tools like shuffle bags that limit streak length when streaks would harm the experience.