How Random Numbers Work in Games
Computers cannot roll dice. They run a formula that produces numbers which look random, and nearly every game outcome you see is built on that.
Pseudorandom, not random
A pseudorandom number generator is an algorithm that produces a sequence of numbers whose properties approximate those of a truly random sequence. The sequence is completely determined by a starting value called the seed. Give the same generator the same seed and it will produce the same numbers again. The reference is Wikipedia's article on pseudorandom number generators.
Why that is good enough
For a game, what matters is that the next number cannot be predicted by the player and that, over many draws, every outcome appears as often as it should. A well-chosen generator with a seed the player cannot know satisfies both.
From a number to an outcome
The generator outputs a large number. The game maps it onto something meaningful: a card, a critical hit, a reel position. The mapping is where the odds live. If one outcome is assigned ten of every thousand numbers, it occurs one percent of the time.
Three things that follow
- Each draw is independent. The generator does not know or care what it produced last time. Nothing is ever "due".
- Timing is not a skill. Generators typically run continuously, so pressing a button a moment earlier or later gives a different number, but not one you can aim for.
- Looking random and being fair are different. Fairness depends on the mapping and on whether anyone has audited it.
Where designers bend it on purpose
Many video games deliberately make their randomness less random. Some guarantee a rare item after a fixed number of failures. Others quietly raise the chance each time you miss. These systems exist because true randomness feels unfair to players in short runs. In regulated gambling products that kind of adjustment is generally not allowed, and each round is expected to be independent.