Pseudorandom number generation: Difference between revisions

Fixed broken Smogon links pertaining to Generation 4 and 5 PRNG abuse; added numerous links to other articles.
m (SnorlaxMonster moved page Pseudo-random number generation in Pokémon to Pseudorandom number generation in Pokémon: It is a proper word, so the article title should not hyphenate when unnecessary)
(Fixed broken Smogon links pertaining to Generation 4 and 5 PRNG abuse; added numerous links to other articles.)
Line 2: Line 2:


==Mechanics==
==Mechanics==
First the generator must have a seed, a number to start with. This number is usually a date and time referring to the first time the algorithm is called during the usage of the device or the software's active session. Seeds are also occasionally derived from user input, as it is highly improbable to do the exact same thing more than once, making it appear 'random'.
First, the generator must have a ''seed'', a number to start with. This number is usually a date and time referring to the first time that the algorithm is called during the usage of the device or the software's active session. Seeds are also occasionally derived from user input, as it is highly improbable to do the exact same thing more than once, making it appear 'random'.


This number is put through a complex algorithm and the result is formatted according to the needed context.  The raw result then becomes the seed for any subsequent uses of the random generator.  Therefore the nature of the generator is a recursive algorithm.
This number is put through a complex algorithm, and the result is formatted according to the needed context.  The raw result then becomes the seed for any subsequent uses of the random generator.  Therefore, the nature of the generator is a recursive algorithm.


==In the Pokémon games==
==In the Pokémon games==
Line 12: Line 12:


This algorithm is used for the following:
This algorithm is used for the following:
* Encrypting Pokémon data in the save file.
* Encrypting Pokémon data in the [[Save|save file]].
* Generate the [[personality value]] of a wild encountered Pokémon.
* Generate the [[personality value]] of a [[Wild Pokémon|wild encountered Pokémon]].
* Generate the [[individual values]] of a wild encountered Pokémon.
* Generate the [[individual values]] of a wild encountered Pokémon.
* Determining the species of a wild Pokémon.
* Determining the species of a wild Pokémon.
Line 19: Line 19:


==Alternative pseudorandom number generator==
==Alternative pseudorandom number generator==
The game also uses a different algorithm to alternate, reroll, or modify a previously randomly generated value.  The algorithm works in the same nature, however the equation changes to:
The game also uses a different algorithm to alternate, reroll, or modify a previously randomly generated value.  The algorithm works in the same nature; however, the equation changes to:


''Result = [(0x6C078965 * Seed) + 0×1]''
''Result = [(0x6C078965 * Seed) + 0×1]''


This algorithm is used for the following:
This algorithm is used for the following:
* Shiny Pokémon Ranger {{p|Manaphy}} egg restriction.
* Shiny [[Pokémon Ranger (game)|Pokémon Ranger]] {{p|Manaphy}} [[egg]] restriction.
* Determining the species of a Pokémon swarm.
* Determining the species of a [[Pokémon outbreak|Pokémon swarm]].
* Determining the Pokémon in the [[Great Marsh]].
* Determining the Pokémon in the [[Great Marsh]].
* Determining the Pokémon in the Trophy Garden.
* Determining the Pokémon in the [[Trophy Garden]].
* [[Mystery Gift]] shininess restriction for Type 1 [[Wonder Card]] Pokémon (currently all released with variable natures).
* [[Mystery Gift]] shininess restriction for Type 1 [[Wonder Card]] Pokémon (currently all released with variable [[Natures]]).


==RNG Abuse==
==RNG Abuse==
'''RNG abuse''', also referred to as '''RNG manipulation,''' is a procedure that manipulates the pseudorandom number generator in the main series games to obtain a desired Pokémon. It is commonly used to obtain [[Shiny Pokémon]] or Pokémon with high [[individual values]].
'''RNG abuse''', also referred to as '''RNG manipulation,''' is a procedure that manipulates the pseudorandom number generator in the main series games to obtain a desired Pokémon. It is commonly used to obtain [[Shiny Pokémon]], Pokémon with high [[individual values]], Pokémon with a specific set of individual values that yield a particular {{m|Hidden Power}} output (regarding [[Type]] and/or move [[Power]]), or Pokémon with certain Natures.


As the initial seed is predictable, the "random" numbers are predictable as well. {{game|Emerald}}'s initial seed is always 0. The Generation IV and V games use the [[Nintendo DS]]'s date, time, and delay between starting the game and pressing "Continue" to generate the initial seed.
As the initial seed is predictable, the "random" numbers are predictable as well. {{game|Emerald}}'s initial seed is always 0. The [[Generation IV]] and {{Gen|V}} games use the [[Nintendo DS]]'s [[Days of the week|date]], [[time]], and delay between starting the game and pressing "Continue" to generate the initial seed.


The random number generator is used to determine a Pokémon's [[personality value]] and individual values when it is encountered or received. After the initial seed is discovered, the player can control a Pokémon's characteristics with frame precise timing. There are several methods used to create a Pokémon's characteristics—for instance, a bred Pokémon and a stationary Pokémon's characteristics are generated through different methods.
The random number generator is used to determine a Pokémon's [[personality value]] and individual values when it is encountered or [[Pokémon Egg|rece]][[Gift Pokémon|ived]]. After the initial seed is discovered, the player can control a Pokémon's characteristics with frame-precise timing. There are several methods used to create a Pokémon's characteristics — for instance, a bred Pokémon and a stationary wild Pokémon's characteristics are generated through different methods.


There are some limitations. As a player's Trainer ID and Secret ID determine a Pokémon's shininess, Shiny Pokémon generated through certain methods can only have certain individual values. Also, it is not possible to manipulate the nature of a Pokémon obtained through a [[Wonder Card]].
There are some limitations. As a player's [[Trainer ID|Trainer ID and Secret ID]] numbers determine a Pokémon's shininess, Shiny Pokémon generated through certain methods can only have certain individual values. Also, it is not possible to manipulate the Nature of a Pokémon obtained through a [[Wonder Card]].


In the Pokémon fandom, RNG abuse is slightly controversial. Proponents note that RNG abuse does not require a third-party device and that the Pokémon obtained through RNG abuse can be obtained through normal gameplay. In addition, Pokémon obtained through RNG abuse have been used at the {{DL|Play! Pokémon|Video Game Championships}}, an official tournament. However, some players believe that RNG abuse is cheating, as the action of picking a Pokémon's characteristics is similar to using a [[cheating]] device.
In the Pokémon fandom, RNG abuse is slightly controversial. Proponents note that RNG abuse does not require a third-party device and that the Pokémon obtained through RNG abuse can be obtained through normal gameplay. In addition, Pokémon obtained through RNG abuse have been used at the {{DL|Play! Pokémon|Video Game Championships}}, an official tournament. However, some players believe that RNG abuse is cheating, as the action of picking a Pokémon's characteristics is similar to using a [[cheating]] device.
Line 44: Line 44:
* [[wp:Pseudorandom number generator|Pseudorandom number generator on Wikipedia]]
* [[wp:Pseudorandom number generator|Pseudorandom number generator on Wikipedia]]
* [http://www.smogon.com/ingame/rng/emerald_rng_intro Smogon's explanation and guide on Pokémon Emerald RNG Abuse]
* [http://www.smogon.com/ingame/rng/emerald_rng_intro Smogon's explanation and guide on Pokémon Emerald RNG Abuse]
* [http://www.smogon.com/ingame/rng/dpp_rng_intro Smogon's explanation and guide on Generation IV RNG Abuse]
* [http://smogon.com/ingame/rng/dpphgss_rng_intro Smogon's explanation and guide on Generation IV RNG Abuse]
* [http://www.smogon.com/forums/showthread.php?t=83057 Smogon's explanation and guide on Generation V RNG Abuse]
* [http://smogon.com/ingame/rng/bw_rng_intro Smogon's explanation and guide on Generation V RNG Abuse]


{{Project Games notice|game mechanic}}
{{Project Games notice|game mechanic}}
1,520

edits