Prerequisites
A reward with a 25% chance need not appear once every four attempts. A short session can differ considerably from the average across many runs.
The principle
Before implementation, name the event, its probability and dependencies between attempts. Game Balance Concepts helps distinguish a probability model from one outcome. If you change the distribution for the player experience, update the rule’s description too.
Independent rolls do not suit every design. You can limit failure streaks, but the next outcome then depends on history. That choice is not automatically fair: define whose experience and which behavior matter.
Practical example
Expedition batteries
In this teaching model, each crate independently contains a battery with probability 0.25. Across five crates, the expected battery count is 5 × 0.25 = 1.25. The probability of finding none is 0.75^5 ≈ 23.73%. An average above one coexists with a substantial chance of getting no batteries.
An alternative is to shuffle a bag of four tokens, one representing a battery. Each complete bag provides exactly one. Order is random, but outcomes are dependent. A battery at the beginning of one bag and at the end of the next permits six empty crates in a row. A four-token bag does not guarantee a reward in every sliding window of four attempts.
If a battery is required to finish the level, provide recovery from a poor outcome separately. A guarantee or fallback route changes the design, not just the random-number generator.
Common mistakes
- Testing 25% with four rolls and declaring the generator broken.
- Applying independent-event formulas to dependent outcomes.
- Saving only the seed (the generator’s initial value) while losing the order of generator calls.
Verify it
- Recalculate the empty-streak probability analytically.
- In simulation, record reward frequency and streak-length distribution, not only the mean.
- For bags, check every position of the single battery in two adjacent bags.
- Save the seed, algorithm version and event sequence to reproduce a failure.
Prompt for an AI agent
Compare independent rolls and bags over equal crate counts. Show assumptions, a reproducible run and the worst possible bag streak. Do not replace a guarantee calculation with a random simulation result.
Test the choice in Weather Window and through the Chance lens.