This article is from Proof Positive, our friendly math newsletter that’s delivered to your inbox every Tuesday afternoon. Sign up today and read it first.
As a teenager, I spent countless hours playing Pokémon on the Game Boy. One of the game’s most popular goals is to collect as many coveted creatures as possible. Back then there were 151 of them—but some were extremely rare and almost impossible to find. You needed a lot of luck (or patience) to catch the most sought-after Pokémon. But you could give fate a little nudge with a few tricks.
On supporting science journalism
If you’re enjoying this article, consider supporting our award-winning journalism by subscribing. By purchasing a subscription you are helping to ensure the future of impactful stories about the discoveries and ideas shaping our world today.
For instance, in the early 2000s it was possible to team up with other players and trade Pokémon. If you wanted to fill out your Pokédex, you had to: some Pokémon weren’t available depending on the version of the game you played, so you needed a friend to trade with to catch those version-specific ones. Because Game Boys weren’t Internet-enabled, this was done via cable. The Pokémon trade was processed sequentially: first, I selected which Pokémon to send, and only then could the other player choose and transfer theirs. If I unplugged the cable after the first Pokémon had been transferred, the second part of the transaction didn’t happen. As a result, I still had my sent Pokémon, and the other person had it as well. This process allowed players to duplicate Pokémon as often as they liked.
Today, of course, you no longer need cables to trade, but there are other ways to influence the course of the game. One method exploits the weaknesses of a game’s random number generator (RNG) to obtain specific Pokémon; it’s appropriately known as RNG manipulation.
In fact, it’s random numbers that determine which Pokémon you encounter at seemingly random times during a game. Most experts prick up their ears as soon as randomness is involved because, surprisingly, generating random numbers is extremely difficult.
How to Generate a Random Number
In everyday life, we perceive many things as random, but generating true randomness solely through a deterministic process like an algorithm is impossible. Instead we use what are called pseudorandom number generators. The number sequences they produce follow a fixed and theoretically predictable pattern, but their output is indistinguishable from a truly random sequence.
Pseudorandom number generators use values called seeds to achieve this: these are the starting values from which a seemingly random sequence of numbers is built. If the seed is known, however, the sequence of numbers can be predicted—which is where RNG manipulation in Pokémon comes into play. There are now dozens of different versions of the game, and each differs in its internal programming. Some contain pseudorandom number generators with rather simple seeds. In Pokémon Emerald Version, for example, the seed always has the value zero. In the fourth generation Pokémon games Pokémon Diamond Version, Pokémon Pearl Version and Pokémon Platinum Version, by contrast, the seed is derived from the date and time set on the console being used, as well as the time that has elapsed between booting up the game and hitting “Continue” on a save file.
The underlying algorithm that generates the random numbers in these third- and fourth-generation games is called a linear congruential generator. Such programs belong to the most common class of pseudorandom number generators. They are based on a linear equation and the principle of recursion. This means that the seed is initially used to calculate the first random number output by the linear equation. This output value is then substituted back into the linear equation to determine the next number in the sequence. In this way, a progressively increasing sequence of numbers is generated.
To ensure that the generated numbers only fall within a specific interval (for example, between zero and nine), a modulo operation is performed at the end of the equation: the result is divided by a number, such as 10, and only the integer remainder is retained. In this way, pseudorandom numbers can be generated, which, in the best case, are indistinguishable from truly random numbers.
Lava Lamps for Chance
Because the Emerald version of Pokémon always uses the same seed, the pseudorandom values can always be predicted. To prevent direct exploitation, the random numbers tick away in the background like an ultrafast clock, changing their value approximately 60 times per second. Therefore, as soon as a supposedly random event occurs—a player encounters a wild Pokémon, for example—where the generated random number is meant to determine the outcome, the rapid timing makes the action appear unpredictable.
Theoretically, if the same event occurs at the exact same time after the start of a game, the outcome will be the same. And this pattern can be exploited.
If you want to influence the random events of a game, you need, among other things, a precise stopwatch to execute an action at the right time. Furthermore, you need to know which random value is calculated within which time period and what that value encodes. Lists containing these data can be found online. These lists allow you to see which Pokémon can be expected to appear in which time frame after which actions.
Of course, you can also make things much easier for yourself and look for ready-made programs that perform such RNG manipulations. There are entire Internet forums where players discuss this topic extensively.
The Pokémon developers did eventually switch to more secure random number generators. Traditional RNG manipulation is now virtually impossible for newer versions of the game such as Pokémon Scarlet and Pokémon Violet. The exact method the developers used for their random number generators remains unclear.
On the Internet forum Reddit, a user wrote that the program’s seed is likely determined by the hardware of the device on which the Pokémon game is played. For example, the Nintendo Switch has a built-in, hardware-based random number generator. For this purpose, some devices use an electrical circuit’s pulse fluctuations, a quantity that is difficult to predict realistically.
The methods used to generate practical random seeds are sometimes extremely creative. For example, the Internet service provider Cloudflare, a major operator of content delivery networks, uses a wall full of lava lamps at its San Francisco location to derive a value that is as random as possible. At some locations, the company uses precise data packet arrival times, while other locations use wave machines or pendulums. Still other ways to generate random numbers involve relying on movements in fish tanks or of cloud recordings. There are virtually no limits to the imagination.
Sadly for some Pokémon fans, the improvements in random number generators have spoiled the fun they found in the game: finding and exploiting a hidden order in (seeming) randomness.
This article originally appeared in Spektrum der Wissenschaft and was reproduced with permission. It was translated from the original German version with the assistance of artificial intelligence and reviewed by our editors.
