Sub topic 2
Input randomness vs output randomness
This chapter assumes you can read short Python functions, compute simple probabilities such as 1/6 or 35%, and know common mechanics such as dice, card draws, and loot drops. Earlier chapters covered why games use chance. This one covers when in the turn chance should happen, which changes how a game feels more than how much chance it contains.
The core distinction
A turn has a moment where the player decides. Randomness can sit on either side of that moment.
- Input randomness happens before the player decides. It creates the situation: the cards in your hand, the map layout, the next Tetris piece, the enemy's visible armor. The player sees the result, then chooses how to respond.
- Output randomness happens after the player decides. It resolves the choice: whether the attack hits, whether the critical triggers, how much damage a spell rolls. The player commits first, then finds out.
Neither is better in general. They push the player's experience in different directions, as the table shows.
| Property | Input randomness | Output randomness |
|---|---|---|
| Player knows the roll when deciding | Yes | No |
| Typical player reaction to a bad roll | "I have to adapt" | "My choice was punished" |
| Rewards skill | Adapting to what you are given | Choosing good odds |
| Creates tension | Before the decision | After the decision |
| Replayability | High, since each setup differs | Moderate, since outcomes vary but setups do not |
| Risk of feeling unfair | Lower | Higher |
Examples from familiar games
- Input: Tetris deals the next piece. Dominion and deck builders deal a hand. Roguelikes generate a level. In each case you see the situation, then play.
- Output: A tactics game shows "85% to hit," you commit the shot, and then the game rolls. Critical hits, dodge chances, and slot-machine reels also resolve after commitment.
- Both: Many card games use input randomness for the draw and output randomness for effects such as "flip a coin."
Output randomness feels harsher because the player did the right thing and still lost. A well-known case is a tactics game's 95% shot missing. Players remember the miss more than the nineteen hits, a point the chapter on perceived randomness covers in detail.
Why input randomness supports skill
Input randomness gives the player information before they commit, and information is what skilled players use. You can measure this. Take a small game where a die sets the enemy's armor from 1 to 6. The player picks one of two attacks.
- A weak attack always deals 3 damage.
- A strong attack deals
7 - armordamage.
The strong attack averages 3.5 over a uniform roll, so it beats the weak one on average. If the player must choose before the armor is known (output randomness), they should always pick strong. If the armor is shown first (input randomness), they pick whichever is better for that roll.
import random
WEAK = 3
def strong(armor):
return 7 - armor
def expected_input():
# The player sees the armor, then picks the better attack.
return sum(max(WEAK, strong(a)) for a in range(1, 7)) / 6
def expected_output():
# The player must pick before the armor is rolled.
strong_avg = sum(strong(a) for a in range(1, 7)) / 6
return max(WEAK, strong_avg)
def simulate(informed, trials=100000, seed=5):
rng = random.Random(seed)
total = 0
for _ in range(trials):
armor = rng.randint(1, 6)
if informed:
total += max(WEAK, strong(armor))
else:
total += strong(armor) # best blind choice is always strong
return total / trials
print(expected_input()) # 4.0
print(expected_output()) # 3.5
print(round(simulate(True), 2), round(simulate(False), 2))The exact values are 4.0 and 3.5. The simulated values land near them but not exactly on them, because 100,000 trials still carry sampling noise. The gap of 0.5 damage per turn is the value of the information. It is a skill reward that exists only because the roll came first.
Why output randomness creates drama
Output randomness is not a flaw. It produces suspense, because the outcome is unknown at the moment the player cares most. It also lets weaker players win sometimes, and it makes risky options real. A 30% chance of a large payoff is a different choice from a guaranteed small one only if the roll resolves after the choice.
Output randomness also has a tuning problem. The player's decision ends at the commit, so any luck after that point cannot be answered with skill. If a game stacks several output rolls in a chain, such as hit, then dodge, then crit, the final result gets dominated by luck and the early choice matters little. Variance multiplies across the chain.
Edge cases and gotchas
Hidden input is output in disguise. If the game rolls the enemy's armor before your turn but never shows it, the player cannot use it. Mechanically it is input randomness, but the player experiences output randomness. The distinction is about what the player knows at decision time, not when the code calls the generator.
Partial information sits between the two. Showing a range ("armor 4 to 6") or a probability ("70% to hit") gives some information. Displaying odds converts a pure output roll into a decision with known risk, which is why tactics games show hit percentages.
Input randomness can still feel unfair. A bad opening hand, or a level with no useful items, cannot be fixed by good play. Players may blame the game even though they had full information. Designers address this with mitigation, the topic of a later chapter. Common tools are mulligans (redrawing a starting hand), guaranteed starter items, and shuffle bags.
Rerolls blur the line. If a player may reroll an input, the input becomes a choice with a cost, which adds a decision. The same holds for output randomness with a retry, such as a re-attempt after a failed lockpick.
Order within a turn matters. A turn can contain several decision points. Each roll is input for the decisions after it and output for the decisions before it. Map the order, then label each roll against the choice it affects.
Choosing between them
Use these criteria when you decide where a roll belongs.
- Target audience. Competitive and strategic audiences usually prefer input randomness, since it rewards reading the situation. Casual and party audiences often enjoy output randomness, since it keeps upsets possible.
- Game length. In long games, output rolls average out, so a few bad ones hurt less. In short games, one missed roll can end the match, so prefer input randomness or give players ways to recover.
- Cost of a decision. If the decision took time or resources, resolving it with a coin flip wastes that effort. Put the roll earlier.
- Desired emotion. Want puzzles and adaptation? Roll early. Want gambles and drama? Roll late.
- Failure mode. Input randomness fails by producing unplayable setups. Output randomness fails by making good play feel pointless. Design the mitigation for whichever you chose.
Many strong designs mix them: input randomness shapes the board, and a small amount of output randomness resolves moments of tension. The key is that the player can name where the chance lives.
Exercise
A card game shows the top card of the deck to the player before they choose between "play it" and "discard it for 2 coins." The designer proposes hiding the card and revealing it after the player picks. Which type of randomness does each version use, and which one gives the player more room to apply skill? Justify with the idea of information at decision time.
Show answer
The original version uses input randomness: the card is determined and visible before the decision, so the player can compare the card's value to 2 coins. The proposed version uses output randomness: the player commits first and the card's effect is revealed afterward, so they must decide on its average value only. The original gives more room for skill because the information has value. The player can play strong cards and discard weak ones, which earns more on average than any fixed rule applied blind, as in the armor example where the informed choice averaged 4.0 against 3.5.