Trainer ID number: Difference between revisions

much simpler explanation with less math
(moving from the Gen 3 location index numbers articles)
(much simpler explanation with less math)
Line 9: Line 9:
From [[Generation III]] onward, in addition to their regular ID numbers, Trainers and Pokémon are also assigned a second, unseen ID number different from the visible one. This number exists to reduce the chances of the games erroneously identifying a Pokémon from another Trainer as not being an [[outsider Pokémon]], since even if two Trainers share the exact same name, gender and Trainer ID number, the game will still recognize their Pokémon as coming from different Trainers should their secret ID numbers be different. A Pokémon's secret ID number is also used along with its main ID number and [[personality value]] in determining if it is {{Shiny}}. Although a secret ID number cannot be viewed without [[Cheating|cheating devices]], it is possible to calculate it.
From [[Generation III]] onward, in addition to their regular ID numbers, Trainers and Pokémon are also assigned a second, unseen ID number different from the visible one. This number exists to reduce the chances of the games erroneously identifying a Pokémon from another Trainer as not being an [[outsider Pokémon]], since even if two Trainers share the exact same name, gender and Trainer ID number, the game will still recognize their Pokémon as coming from different Trainers should their secret ID numbers be different. A Pokémon's secret ID number is also used along with its main ID number and [[personality value]] in determining if it is {{Shiny}}. Although a secret ID number cannot be viewed without [[Cheating|cheating devices]], it is possible to calculate it.


Secret IDs of Pokémon obtained prior to [[Generation VII]] are five digits long; those of Pokémon obtained in Generation VII onwards are four digits long. Pokémon [[transfer]]red to [[Pokémon Bank]] from the [[Virtual Console]] releases of [[Generation]]s {{Gen|I}} and {{Gen|II}} are given a secret ID of 00000.
Secret IDs of Pokémon obtained prior to [[Generation VII]] are five digits long; those of Pokémon obtained in Generation VII onwards are four digits long. Pokémon [[transfer]]red to [[Pokémon Bank]] from the [[Virtual Console]] releases of [[Generation]]s {{Gen|I}} and {{Gen|II}} are given a secret ID of 0.


If two different Trainers have the same [[Original Trainer|Trainer name]] and gender, as well as identical ID numbers and secret ID numbers (a 1 in 4,294,967,296 chance), the games will recognize the two Trainers as the same and will not consider their Pokémon to be [[outsider Pokémon]], which can cause minor bugs related to [[List of locations by index number|met location]]. For example, [[Pokémon Colosseum]] and {{Pokémon XD}} use location index numbers that conflict with each other, so if one player has a Pokémon from the other game yet that Pokémon is not an outsider, it will likely display the wrong met location rather than the fallback "distant land" normally used for outsider Pokémon. Conversely, {{game|Ruby and Sapphire|s}} (not Emerald) and {{game|FireRed and LeafGreen|s}} use location index numbers that are incompatible but do not overlap, so if one player has a Pokémon from the other game that is not an outsider, it will display the otherwise-unreadable text "Met somewhere." rather than the correct "Met in a trade."
If two different Trainers have the same [[Original Trainer|Trainer name]] and gender, as well as identical ID numbers and secret ID numbers (a 1 in 4,294,967,296 chance), the games will recognize the two Trainers as the same and will not consider their Pokémon to be [[outsider Pokémon]], which can cause minor bugs related to [[List of locations by index number|met location]]. For example, [[Pokémon Colosseum]] and {{Pokémon XD}} use location index numbers that conflict with each other, so if one player has a Pokémon from the other game yet that Pokémon is not an outsider, it will likely display the wrong met location rather than the fallback "distant land" normally used for outsider Pokémon. Conversely, {{game|Ruby and Sapphire|s}} (not Emerald) and {{game|FireRed and LeafGreen|s}} use location index numbers that are incompatible but do not overlap, so if one player has a Pokémon from the other game that is not an outsider, it will display the otherwise-unreadable text "Met somewhere." rather than the correct "Met in a trade."


==Alterations in Generation VII==
==Alterations in Generation VII==
From [[Generation VII]] onward, the ID number is a six-digit number, rather than a five-digit number as it previously was. A five-digit Trainer ID and a five-digit secret ID are still generated, but are then used to calculate the final ID number by using the following formula: <code>ID<sub>final</sub> = ID<sub>trainer</sub> + (ID<sub>secret</sub> × 65536)</code>. The last six digits of the resulting number are used as the ID number.
From [[Generation VII]] onward, the Trainer ID is a six-digit number instead of a five-digit number. Instead of generating two 16-bit numbers (between 0 and 65535), one for Trainer ID and one for Secret ID, the game instead generates one 32-bit number (between 0 and 4,294,967,295), then takes the last six digits as the Trainer ID. The first four digits then essentially become the Secret ID, ranging from 0 to 4294.  


For example, consider a new save file in which the player's assigned Trainer ID and secret ID are 00033 and 34262, respectively. The ID number will be 33 + (34262*65536) = 2245394465. However, only the last six digits are used, so the final ID number will be 394465.
If a Pokémon is [[transfer]]red to Generation VII or later from a previous generation, its Trainer ID and Secret ID will both remain 5 digits long.
 
If a Pokémon is [[transfer]]red to Generation VII or later from a previous generation, its Trainer ID number will remain 5 digits long.


==Special ID numbers==
==Special ID numbers==
2,613

edits