pokemon-showdown-client/pokemonshowdown.com/pages/rng.md
Pac n cheese ce516b75ce
Update the broken bulbapedia link in the rng page, update contact and format-suggestions pages (#2596)
* Update the broken bulbapedia links in the rng page

Replaced former https://bulbapedia.bulbagarden.net/wiki/Pseudorandom_number_generation_in_Pokémon with https://bulbapedia.bulbagarden.net/wiki/Pseudorandom_number_generation
since the old one led to a blank bulbapedia page

* Update contact and format-suggestions pages

Updated the bugs report link in contact page to point to the smogon bug reports thread https://www.smogon.com/forums/forums/ps-bug-reports.876/

Updated the formatsuggestions page to point to the most recent resources for OM(Other metas)
https://www.smogon.com/forums/forums/other-metagames.733/ - for the general forum (last one pointed to a thread/forum in cyro)
https://www.smogon.com/forums/posts/9374053/ - for guide to submit an OM format

---------

Co-authored-by: Guangcong Luo <guangcongluo@gmail.com>
2026-03-14 23:28:38 -07:00

2.4 KiB
Raw Blame History

RNG

Why correct RNGs seem "wrong"

With every game with randomness, people will complain that the Random Number Generator (RNG) is bad, or giving them bad numbers. And there's a huge list of reasons why, if you play Pokémon on a simulator, it's even worse:

  1. Games go way faster on a simulator than on the Switch or 3DS, so you play more often and encounter more randomness.

  2. There are more people playing. We get over 500,000 battles every day. A one-in-a-million event happens every other day! Even if it's incredibly unlikely, it'll still happen all the time, just because of the numbers.

  3. Humans are bad at understanding randomness. Numerous scientific studies show that humans think random distributions work completely differently from how they actually work.

How PS's RNG works

Pokémon Showdown uses the exact same type of RNG as the actual Pokémon games on the Switch and 3DS use. You can see the source code right here:

https://github.com/smogon/Pokemon-Showdown/blob/master/sim/prng.ts

And there are many pages documenting this is the same random number generator used on the Switch or 3DS:

https://bulbapedia.bulbagarden.net/wiki/Pseudorandom_number_generation

And many pages documenting that this is a completely normal RNG to use:

https://en.wikipedia.org/wiki/Linear_congruential_generator

If you think we're using different source code than the code above, you can always test it yourself:

After a battle has ended, saving its replay will also save its input log containing its random seed. For random battles, you can get the log directly from the HTML source of the replay page. For battles with non-random teams, seeds are not visible for privacy reasons you will need to get permission from your opponent and then use the /exportinputlog command.

Once you have the log, you can replay it using the publicly available source code from GitHub, which proves that it's the same RNG as in the source code, which you can read to see that it's the same RNG as the Switch and 3DS.

Side note

It's possible to design games with randomness without an RNG! Think about rock-paper-scissors itself: It's still "random", but there's no RNG you can blame all the randomness comes from the players!

Unfortunately, Pokémon wasn't designed like this you'll have to blame Game Freak, not me. :p