Odds and randomness
Learning paths through this topic
Fishing bites feel fake: every wait is about the same length
Picking a random wait between two numbers makes every cast feel like a timer, while real waiting has quick bites, long lulls and no memory. This shows what shape of waiting time feels natural and how to keep it from dragging on forever.
Backstab bonuses fire from the wrong side because angles wrap around
A bonus for hitting an enemy from behind sounds easy until the enemy faces nearly straight right and the attacker stands just above it. The numbers say they are far apart, but they are not. This entry covers the angle comparison and how the bonus changes the hit chance.
Food that goes bad a little more likely each day: what is it worth?
Fresh meat should be fine for a day or two and a gamble by the end of the week, but a single flat chance cannot give that shape. This shows how to build a day-by-day risk, read off the odds that a piece is still good, and tell the player a fair figure.
Weak hits keep rounding to zero or to one, so armor or bonuses stop mattering
Damage multipliers produce numbers like 2.4, but health is counted in whole points. Rounding that to the nearest whole number erases small bonuses, and a minimum of one makes weak attacks too strong. There is a way to round that keeps the true average without ever showing a fraction.
Gathering 1.4 wood per swing always gives one, so the bonus is lost
Upgrades and multipliers produce fractional amounts, but items come in whole pieces, and the usual rounding quietly throws away or invents a lot of resources over a session. This shows two ways to keep the long-run total exactly right.
Random gear stats should add up to the same total, with no stat at zero
Rolling each stat on its own gives some pieces far stronger than others, and scaling them afterwards leaves odd leftovers and a bias towards even splits. This shows how to hand out a fixed number of points among the stats so that every split is equally likely.
Haggling with a random yes: find the lowball offer players will spam
If a trader accepts an offer with a chance that grows as the offer rises, someone will find the offer that earns the most per try and use it all day. This shows how to calculate that offer for your curve, and how to set the curve so the trick pays little.
Health pickups should show up when the player is hurting, but not as a flood
A flat chance for health drops means the player is flooded when healthy and starved when almost dead. Scaling by how hurt they are fixes that, but it opens a new exploit that lets players farm their way back to full health. A rest period closes it.
Herds average 2.3 animals per area, but rounding makes them all the same size
Picking a herd size close to the average makes every area feel the same, while real clusters are sometimes empty and sometimes crowded. This shows how to draw a count with a given average from one random number, keeping the natural mix of empty and crowded places.
Breeding two animals that both look normal: how likely is a rare-trait offspring?
Some traits skip a generation and show up only when both parents secretly carry them, so the odds depend on how common the trait is in the herd and not only on the parents' looks. This shows how to work out the chance for random pairs and for known parents.
The tooltip says 100 percent, yet the player fails, or shows 0 percent but wins
Rounding a chance for display can promise something the game does not keep, and players remember every time it happened. This shows how to print chances in plain words that never claim certainty or impossibility, even when the numbers are very close to it.
Short join codes for worlds: how many can exist before two clash?
Short codes are easy to read out loud, but with a few hundred worlds the chance of two worlds sharing one is much higher than it feels, and players join the wrong world. This shows how to size a code for the number of worlds and how to hand out new ones.