Main Menu

Glitches

References/Resources

Affiliates

Technical

Search Wiki

Toolbox

RNG oddities (Generation III)
 Page | Discussion | View source | History

From Glitch City Laboratories

Jump to: navigation, search
Miscellaneous glitches of Pokémon Ruby and Sapphire, Pokémon FireRed and LeafGreen and Pokémon Emerald


While luck manipulation can be considered a class of non-glitch exploits, there are aspects of RNG implementation in the Generation III handheld games that are almost certainly unintentional.

Emerald initial seeding

In Pokémon Emerald, no matter what, the RNG seed is 0 upon bootup, despite the existence of substantial initial seeding algorithms in Pokémon Ruby and Sapphire and Pokémon FireRed and LeafGreen.

VBlank RNG interrupt glitch ("Methods")

In all five games, there exist multiple sets of PIDs and IVs for a given Egg or encounter on any given frame. Even though the effects of this are mostly innocuous and potentially beneficial to the player, it is due to a programming oversight that this is the case.

The GBA's VBlank routine runs roughly once every 16.743 milliseconds. Stat generation is generally much faster than this, making four calls to the RNG returning a halfword each time, two each for the PID and IV spread. These can be predicted for any given current seed by running the LCG on it manually and looking at the upper 16 bits of each value. However, as VBlank is an interrupt and the LCG advances by one every time it's run, an additional call sometimes needs to be made to determine some of the IVs.

These unintended orders have been referred to as "methods" by various sources. Three have been confirmed to occur on official hardware. Each has a counterpart that includes the random encounter nature hunt routine ("Methods H-1, H-2, and H-4"). Method H-1 almost never occurs, as the slowness of the nature hunt almost always causes VBlank to interrupt the four main RNG calls. Method 4 has frequently occurred in Pokémon Box Ruby & Sapphire, and H-1 has been occasionally witnessed in Pokémon Ruby and Sapphire.

Sequential RNG calls
Method PID1 PID2 IV1 IV2
1 1 2 3 4
2 1 2 4 5
4 1 2 3 5