Spielerando

Odds and randomness

Learning paths through this topic

A chain attack jumps between enemies, fades out and must never hit the same one twice

Chain lightning, bouncing projectiles and spreading fire all pass from one target to a nearby one. Without care they ping-pong between two close enemies, favour a random neighbour on every machine, or run forever. This entry defines the hop rules so the chain is fair and ends.

A one-in-ten chance is not certain after ten tries, so how many do you need?

Players, and many designers, expect a one-in-ten drop to show up within ten tries. It does not, and the gap is bigger than most people think. This entry works out exactly how likely it is, and how many tries it takes to be nearly sure.

How many hits does it take to kill when each hit does a random amount?

Average damage divided by health gives a number of hits that is wrong for everyone who gets a streak of low or high rolls. The real question is how likely a kill is after each hit. This entry shows how to get that table, plus the average number of hits.

A chest should give three different items, not the same one twice

Drawing several rewards from one weighted table sounds easy, until the common sword shows up three times or the rarest item can never appear together with another. This entry shows how to draw without repeats and keep the odds meaningful.

What is the real chance that a scattered shot hits a round target?

A weapon scatters shots over an area and the enemy covers only part of it. Guessing a percentage by distance feels wrong on the range. The exact answer comes from comparing two areas, and one corner case makes naive code return nonsense or crash.

What share of players clear a level in three lives if they improve with every try?

The usual formula for several attempts assumes every try is as hard as the first, but players learn the layout. A small rule with a rising chance per attempt gives numbers that match tests better, and it shows how many tries a typical player needs.

Discovering every recipe by random combining: how long will the last one take?

When discoveries come at random and some are much rarer than others, the final missing piece can take longer than all the others together. This shows how to estimate the real effort of completing a collection with uneven odds, and why the usual rule of thumb fails.

Crafting that sometimes fails: what does one success really cost?

When a craft can fail and eats materials, the price on the recipe is not the price players pay, and a partial refund makes the real number harder to guess. This shows how to work out the true cost and why a rounding detail in the refund changes it.

A hungry animal should usually eat, but not always, and never freeze up

Letting a creature always pick the most urgent need makes it look like a machine, while picking at random makes it starve beside food. This shows how to turn needs into choice chances that follow urgency, with one setting for how predictable it is.

What should a critical chance over 100 percent do when items keep stacking it?

Build up enough critical bonuses and the chance passes certain. Most games just cap it, and then every further item feels dead. A rule that turns the surplus into something useful keeps the stacking fun, and the average damage stays easy to predict.

Crops that grow in random stages: when can the farmer count on a harvest?

If a seedling needs luck to move to each next stage, adding up the average days gives a date that is wrong for half the farmers, and rain makes it harder still. This shows how to compute the chance that a crop is ripe by a given day, including days that help growth.

Every player should get the same daily level, wherever they live

A daily challenge needs one level that is the same for everyone on the same day and different on the next. Using the device date splits players by time zone, and using the date number directly makes neighbouring days look alike. Here is the date-to-seed step with the rollover handled.