Game Design

Weighted Random Tables in Game Design

How designers set weights in outcome tables, convert them to probabilities, check expected value and rare-event chances, and verify the table behaves as intended.

On this page
  1. What a weighted table is
  2. From weights to probabilities
  3. How a program picks an outcome
  4. Checking the expected value
  5. Checking rare events
  6. Verifying the table in practice
  7. Design considerations
  8. Transparency and responsibility

What a weighted table is

A weighted random table lists possible outcomes, each with a number called a weight. The bigger the weight, the more often the outcome should appear. Designers use them for loot, enemy spawns, events, random encounters and anything else where outcomes should be unequal.

Weights are not themselves probabilities. They become probabilities when divided by the sum of all weights. Using weights rather than percentages is practical: a designer can add or change an entry without rebalancing everything else to total 100.

From weights to probabilities

Here is an illustrative reward table. The numbers are invented for the example.

Outcome Weight Probability
Small reward 50 50%
Medium reward 30 30%
Large reward 15 15%
Jackpot reward 5 5%

The weights add up to 100, so each weight is also its percentage. The weights need not total 100, though. A table with weights 6, 3 and 1 totals 10, giving probabilities of 60%, 30% and 10%. The calculation is always weight divided by total.

How a program picks an outcome

A common method uses cumulative ranges. For the table above, lay the weights end to end: small covers 1 to 50, medium covers 51 to 80, large covers 81 to 95 and jackpot covers 96 to 100. The program generates a random whole number from 1 to the total, here 100, and selects the entry whose range contains it. The widths of the ranges are the weights, so each entry’s chance matches its share.

The random number comes from a pseudo-random generator, and it should be uniform across the range. A typical mistake is a range that is off by one, which quietly changes the odds. Another is using a method that is slightly biased toward lower numbers when the range does not divide evenly into the generator’s output. Neither is visible in a single draw, which is why checking matters.

Checking the expected value

If outcomes have numeric values, the expected value shows the average reward per draw. Suppose the four outcomes above give 10, 25, 60 and 200 gold respectively. These are illustrative figures.

  • Small: 0.50 × 10 = 5
  • Medium: 0.30 × 25 = 7.5
  • Large: 0.15 × 60 = 9
  • Jackpot: 0.05 × 200 = 10

Total: 5 + 7.5 + 9 + 10 = 31.5 gold per draw on average.

This number is useful in two ways. First, it can be compared with the game’s economy: if players take a draw 100 times a day, the average inflow is about 3,150 gold, and the designer can judge whether that is too much or too little. Second, it shows which entries contribute most. Here the rare jackpot supplies 10 of the 31.5, about 32%, even though it appears one time in twenty. Changing a weight on a rare entry can have a large effect on the average.

Keep in mind that the average hides the spread. Individual players will see wide variation in a short session, and the jackpot may not appear for a long time.

Checking rare events

Designers often need to know how likely a player is to see a rare outcome within some number of attempts. It is usually easier to calculate the chance of never seeing it and subtract from one, an application of the complement rule.

For the 5% jackpot, the chance of not seeing it in one draw is 0.95. Over 10 independent draws, the chance of none is 0.95 to the power 10, about 0.599, so the chance of at least one is about 40%. Over 20 draws, the chance of none is about 0.358, so at least one appears about 64% of the time. That means a little over one player in three goes twenty draws without it.

These figures are why designers sometimes add controls, such as a shuffle bag or a guarantee after repeated misses, when long droughts would be frustrating. A weighted table by itself gives independent draws, and past results do not affect the next one.

Verifying the table in practice

Reading the table is not enough, and there are several useful checks.

  1. Sum the weights. Make sure the total matches the number you think it does, particularly after editing.
  2. Convert to probabilities. Write them out and confirm the proportions look right.
  3. Compute expected value. Compare to the design target.
  4. Simulate. Use a Monte Carlo simulation to draw many times and compare observed frequencies to expected ones. A spreadsheet simulation is enough for small tables.
  5. Choose enough trials. With 1,000 draws, the 5% outcome is expected about 50 times, with a typical variation of around 7 either way (the square root of 1,000 × 0.05 × 0.95, roughly 6.9). Seeing 45 or 56 is normal; seeing 20 would be a warning sign. How many trials a simulation needs depends on how precise you need to be.
  6. Look at edge cases. What happens if a weight is zero, negative or missing?

Design considerations

Tiers rather than a continuous spread. Tables with a few clear tiers are easier for players to understand than ones with dozens of tiny differences.

Context-sensitive weights. Weights may change with level, location or progress. When they do, the expected value changes too, so recheck.

Weighted draws without replacement. If an item should not repeat until others appear, a table needs additional logic. This is where a shuffle bag or a similar tool replaces independent draws.

Combining tables. A first roll can pick a category, and a second roll picks within it. The chance of a final outcome is the product of the two stages, so a 20% category containing a 10% entry gives a 2% overall chance. Nested tables are flexible but easy to get wrong without checking.

Transparency and responsibility

For games where players can spend real money for random rewards, such as loot boxes, the weights are exactly what players need to know. Publishing the actual odds helps people judge value, and in some places it is required. Unclear odds, pressure to spend and rare-item hooks can lead to overspending. Players should set a firm limit on money and time beforehand and stop when they reach it. If spending on random rewards or gambling is causing difficulty, a local support service can help.

The complete guide to game design

Probability and Game Design: A Guide
Read the guide

Keep exploring

Guides from other topics

All topics →