AtlasPreview
Mechanics

Shiny Pokémon

The exact rule in each generation, and why it is 1 in 8192.

Generation 2: it is all in the DVs

In Gold, Silver and Crystal a Pokémon is shiny when its DVs (hidden values from 0 to 15) meet four conditions: Defense = 10, Speed = 10, Special = 10, and bit 1 of Attack set — an Attack of 2, 3, 6, 7, 10, 11, 14 or 15. HP does not count: its DV is derived from the other four.

Eight Attacks out of sixteen, then one in sixteen three times: 8/16 × 1/16 × 1/16 × 1/16 = 1/8192.

Generation 1 has no shinies, but its Pokémon already carry these DVs: traded to Generation 2, a Pokémon whose DVs meet the rule shows up shiny there.

Sources : pokecrystal engine/gfx/color.asm : CheckShininess (SHINY_ATK_MASK %0010, SHINY_DEF_DV 10, SHINY_SPD_DV 10, SHINY_SPC_DV 10)

Generation 3: four numbers and an exclusive or

From Ruby and Sapphire on, the game combines four 16-bit numbers: the Trainer ID, the Secret ID, and both halves of the Pokémon's personality value (PID). It mixes them with exclusive or (XOR); if the result is below 8, the Pokémon is shiny.

There are 65,536 possible results and 8 winners: 8/65,536 = 1/8192, the same odds as before.

Sources : pokeemerald include/pokemon.h : GET_SHINY_VALUE ; include/constants/pokemon.h : SHINY_ODDS 8 ; src/pokemon.c