Roaming Pokémon IV glitch

From Glitch City Wiki
Revision as of 11:08, 22 May 2010 by >Torchickens (→‎Technical explanation)
Miscellaneous glitches of Pokémon Ruby and Sapphire, Pokémon FireRed and LeafGreen and Pokémon Emerald


Bulbapedia also has an article about Roaming Pokémon IV glitch.

The Roaming Pokémon indvidual values issue, sometimes referred to as simply the Roaming Pokémon glitch is an error regarding the possible range of individual value totals of Roaming Pokémon within the first four handheld Pokémon games; namely Pokémon Ruby, Pokémon Sapphire, Pokémon FireRed and Pokémon LeafGreen. It does not exist in the later games, such as Pokémon Emerald. The glitch although perhaps less noticeable to less experienced players, restricts Roaming Pokémon such as Latias, Latios or the Legendary Beasts from having an IV total greater than 38. Specifically, the affected Pokémon would always have 0 IVs in the Special Attack, Special Defence, Defence and Speed stats and a maximum 7 IVs in the Attack stat, the individual value for HP however, remains unchanged.

Technical explanation

Information for the individual values of a Pokémon is read in a qword (a total of 32 ONs in binary) or four bytes. Hence the permutations of the individual values a Pokémon has is denoted by 11111111111111111111111111111111 or a total of 4294967296 possibilities, which includes the unlikely circumstances of a Pokémon having 0 IVs in every stat. When the player encounters a Roaming Pokémon however, an oversight by Nintendo was that only the first byte is defined (the first eight bits). By default, if the other bytes for the individual values are not defined every other bit is taken as 0. Therefore, the permutations are reduced to just 11111111 or 256. HP was the first stat in the data structure so it remains unchanged, but the other stats except Attack remain undefined and the Attack IV can only be an integer between 0 and 7.