Pseudorandom number generation: Difference between revisions

m
no edit summary
m (Spell check)
mNo edit summary
Line 1: Line 1:
== What is a Pseudo-Random Number Generator ==
== What a pseudo-random number generator is ==
A pseudo-random number generator is an electronic device or software's attempt at creating a sufficiently random number.  There are limitless ways of accomplishing this.  The degree of sufficient randomness depends on the ability to predict the next result of the algorithm.
A pseudo-random number generator is an electronic device or software's attempt at creating a sufficiently random number.  There are limitless ways of accomplishing this.  The degree of sufficient randomness depends on the ability to predict the next result of the algorithm.


Line 8: Line 8:
'''More information on this topic can be found at: {{wp|Pseudo-random_number}}
'''More information on this topic can be found at: {{wp|Pseudo-random_number}}


== How are Pseudo-Random Numbers Generated in Pokemon ==
== How pseudo-random numbers are generated in Pokémon ==


Let ''Seed'' be a number between 0 and 0xFFFFFFFF or the ''Result'' of a previous call to the equation.
Let ''Seed'' be a number between 0 and 0xFFFFFFFF or the ''Result'' of a previous call to the equation.
Line 14: Line 14:


This algorithm is used for the following:
This algorithm is used for the following:
* Encrypting Pokemon Data in the save file.
* Encrypting Pokémon data in the save file.
* Generate the [[Personality value]] of a wild encountered Pokemon.
* Generate the [[personality value]] of a wild encountered Pokémon.
* Generate the [[Individual Values]] of a wild encountered Pokemon.
* Generate the [[individual values]] of a wild encountered Pokémon.
* Determining the species of a wild Pokemon.
* Determining the species of a wild Pokémon.
* Determining the lottery number.
* Determining the lottery number.


== Alternative Pseudo-Random Number Generator ==
== Alternative pseudo-random 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:
Line 27: Line 27:


This algorithm is used for the following:
This algorithm is used for the following:
* Shiny Pokemon Ranger {{p|Manaphy}} egg restriction.
* Shiny Pokémon Ranger {{p|Manaphy}} egg restriction.
* Determining the species of a Pokemon swarm.
* Determining the species of a Pokémon swarm.
* Determining the Pokemon in the [[Safari Zone]].
* Determining the Pokémon in the [[Safari Zone]].
* Mystery Gift shiny restriction for Type 1.
* Mystery Gift shiny restriction for Type 1.
4,430

edits