Open main menu

Bulbapedia β


Pseudorandom number generation in Pokémon

388 bytes added, 21:53, 18 March 2016
Linear Congruential random number generator (LCRNG)
==In the Pokémon games==
===Linear Congruential random number generator (LCRNG)===
In [[Pokémon Stadium (English)|Stadium]], and in [[Generation III]] and [[Generation IV]], the games use a 32 bit LCRNG.
Let ''Seed'' be a number between 0 and 0xFFFFFFFF or the ''Result'' of a previous call to the equation.
*Pokémon Stadium: ''Result = [(0x41C64E6D * Seed) + 0x60730x303B]'' {{tt|*|Called several times depending on the N64's Count register, then xor'd with another pseudo-random value}}
*Pokémon Colosseum: ''Result = [(0x343FD * Seed) + 0x269EC3]''
*[[Game Boy Advance|GBA]] and [[Nintendo DS|DS]] games: ''Result = [(0x41C64E6D * Seed) + 0x6073]''
ThisIn [[Generation III]] and [[Generation IV]], this algorithm is used for the following:
* Encrypting Pokémon data in the [[Save|save file]].
* Generate the [[personality value]] of a [[Wild Pokémon|wild encountered Pokémon]].