30,354
edits
Jmchambers90 (talk | contribs) mNo edit summary |
Tiddlywinks (talk | contribs) m (direct link) |
||
(28 intermediate revisions by 15 users not shown) | |||
Line 1: | Line 1: | ||
The '''Pokémon data structure''' in the [[Generation I]] games stores most information about the current state of a {{player}}'s [[caught Pokémon]]. It has a length of 44 bytes for Pokémon in the player's [[party]] and 33 bytes for Pokémon in boxes on [[Pokémon Storage System|Bill's PC]]. The information lost when depositing a Pokémon in Bill's PC is its [[level]], {{stat|HP}}, {{stat|Attack}}, {{stat|Defense}}, {{stat|Speed}} and {{stat|Special}}; this allows the [[box trick]] to work by recalculating the lost information upon withdrawing the Pokémon again. | |||
The '''Pokémon data structure''' in the [[Generation I]] games stores most information about the current state of a {{player}}'s [[caught Pokémon]]. It has a length of 44 bytes for Pokémon in the player's [[party]] and 33 bytes for Pokémon in boxes on [[Bill's PC]]. The information lost when depositing a Pokémon in Bill's PC is its [[level]] | |||
===The structure=== | ===The structure=== | ||
Line 10: | Line 8: | ||
! style="text-align: center; background: #ccf;" | '''Size''' | ! style="text-align: center; background: #ccf;" | '''Size''' | ||
|- | |- | ||
| 0x00 || [[List of Pokémon by index number ( | | [[#Species|0x00]] || [[List of Pokémon by index number (Generation I)|Index number of the Species]] || 1 byte | ||
|- | |- | ||
| | | [[#Remaining HP|0x01]] || Current {{stat|HP}} || 2 bytes | ||
|- | |- | ||
| 0x03 || Level | | [[#Level|0x03]] || {{tt|Level|as represented while viewed from inside the PC}} || 1 byte | ||
|- | |- | ||
| 0x04 || [[Status | | [[#Status conditions|0x04]] || [[Status condition]] || 1 byte | ||
|- | |- | ||
| 0x05 || [[ | | [[#Type|0x05]] || [[Type|Type 1]] || 1 byte | ||
|- | |- | ||
| 0x06 || Type 2 || | | [[#Type|0x06]] || Type 2 || 1 byte | ||
|- | |- | ||
| 0x07 || [[Catch rate]]/[[Held item]] || | | [[#Catch rate/Held item|0x07]] || [[Catch rate]]/[[Held item]] || 1 byte | ||
|- | |- | ||
| 0x08 || [[List of moves#Generation I|Index number of | | 0x08 || [[List of moves#Generation I|Index number of move 1]] || 1 byte | ||
|- | |- | ||
| 0x09 || Index number of | | 0x09 || Index number of move 2 || 1 byte | ||
|- | |- | ||
| 0x0A || Index number of | | 0x0A || Index number of move 3 || 1 byte | ||
|- | |- | ||
| 0x0B || Index number of | | 0x0B || Index number of move 4 || 1 byte | ||
|- | |- | ||
| 0x0C || [[Trainer ID number|Original Trainer ID number]] | | | 0x0C || [[Trainer ID number|Original Trainer ID number]] || 2 bytes | ||
|- | |- | ||
| 0x0E || [[Experience]] | | | [[#Experience|0x0E]] || [[Experience|Experience points]] || 3 bytes | ||
|- | |- | ||
| 0x11 || {{stat|HP}} [[ | | [[#Stat experience|0x11]] || {{stat|HP}} [[effort values|EV data]] || 2 bytes | ||
|- | |- | ||
| 0x13 || {{stat|Attack}} | | [[#Stat experience|0x13]] || {{stat|Attack}} EV data || 2 bytes | ||
|- | |- | ||
| 0x15 || {{stat|Defense}} | | [[#Stat experience|0x15]] || {{stat|Defense}} EV data || 2 bytes | ||
|- | |- | ||
| 0x17 || {{stat|Speed}} | | [[#Stat experience|0x17]] || {{stat|Speed}} EV data || 2 bytes | ||
|- | |- | ||
| 0x19 || {{stat | | [[#Stat experience|0x19]] || {{stat|Special}} EV data || 2 bytes | ||
|- | |- | ||
| 0x1B || [[Individual values]] || {{tt| | | 0x1B || [[Individual values|IV data]] || {{tt|2 bytes|4 bits for each IV excluding HP}} | ||
|- | |- | ||
| 0x1D || {{PP}} | | [[#PP|0x1D]] || Move 1's {{PP}} values || {{tt|1 byte|2 bits for applied PP Ups, 6 bits for current PP}} | ||
|- | |- | ||
| 0x1E || | | [[#PP|0x1E]] || Move 2's PP values || {{tt|1 byte|2 bits for applied PP Ups, 6 bits for current PP}} | ||
|- | |- | ||
| 0x1F || | | [[#PP|0x1F]] || Move 3's PP values || {{tt|1 byte|2 bits for applied PP Ups, 6 bits for current PP}} | ||
|- | |- | ||
| 0x20 || | | [[#PP|0x20]] || Move 4's PP values || {{tt|1 byte|2 bits for applied PP Ups, 6 bits for current PP}} | ||
|- | |- | ||
| 0x21 || [[Level]] || | | 0x21 || [[Level]] || 1 byte | ||
|- | |- | ||
| 0x22 || Maximum HP | | | [[#Maximum HP|0x22]] || Maximum HP || 2 bytes | ||
|- | |- | ||
| 0x24 | | [[#Attack, Defense, Speed, and Special|0x24]] || {{stat|Attack}} || 2 bytes | ||
|- | |- | ||
| 0x26 | | [[#Attack, Defense, Speed, and Special|0x26]] || {{stat|Defense}} || 2 bytes | ||
|- | |- | ||
| 0x28 | | [[#Attack, Defense, Speed, and Special|0x28]] || {{stat|Speed}} || 2 bytes | ||
|- | |- | ||
| 0x2A | | [[#Attack, Defense, Speed, and Special|0x2A]] || {{stat|Special}} || 2 bytes | ||
|} | |} | ||
Notably missing from this structure are the Pokémon's nickname and the original Trainer's name, which are stored elsewhere. | Notably missing from this structure are the Pokémon's nickname and the original Trainer's name, which are stored elsewhere. | ||
Pokémon stored in Bill's PC use a form of this structure that stops after the PP data for the fourth move, at 0x20. | Pokémon stored in Bill's PC use a form of this structure that stops after the PP data for the fourth move, at 0x20. | ||
Line 77: | Line 75: | ||
==Explanation of fields== | ==Explanation of fields== | ||
===Species=== | ===Species=== | ||
The [[List of Pokémon by index number ( | The [[List of Pokémon by index number (Generation I)|index number]] for the Pokémon's species. | ||
===Remaining HP=== | ===Remaining HP=== | ||
Line 85: | Line 83: | ||
Though it appears to be the level of the Pokémon, it seems effectively redundant: it exists as a Pokémon's level when said Pokémon is stored in a PC box, yet is overwritten as part of the recalculation that takes place when the Pokémon is withdrawn. If the Pokémon is deposited back into a box, this value is set to the Pokémon's level again. This value's purpose is currently unknown. | Though it appears to be the level of the Pokémon, it seems effectively redundant: it exists as a Pokémon's level when said Pokémon is stored in a PC box, yet is overwritten as part of the recalculation that takes place when the Pokémon is withdrawn. If the Pokémon is deposited back into a box, this value is set to the Pokémon's level again. This value's purpose is currently unknown. | ||
===Status | ===Status conditions=== | ||
The [[status | The [[status condition]]s of the Pokémon, as a bit field. | ||
{| style="border: 1px solid #88a; background: #f8f8ff; padding: 0.5em; border-collapse: collapse; margin: 0 0 0.5em 0.5em;" cellspacing="1" cellpadding="2" | {| style="border: 1px solid #88a; background: #f8f8ff; padding: 0.5em; border-collapse: collapse; margin: 0 0 0.5em 0.5em;" cellspacing="1" cellpadding="2" | ||
Line 92: | Line 90: | ||
! style="text-align: center; background: #ccf;" | '''Bit''' | ! style="text-align: center; background: #ccf;" | '''Bit''' | ||
! style="text-align: center; background: #ccf;" | '''Value''' | ! style="text-align: center; background: #ccf;" | '''Value''' | ||
! style="text-align: center; background: #ccf;" | '''Status | ! style="text-align: center; background: #ccf;" | '''Status condition''' | ||
|- | |- | ||
| 3 || 0x04 || Asleep | | 3 || 0x04 || Asleep | ||
Line 105: | Line 103: | ||
|} | |} | ||
Since being | Since being {{status|poison|badly poisoned}} is a temporary condition in [[Pokémon battle|battles]], it is not stored here. Confusion is also not stored here. 0x00 means that the Pokémon is not affected by any major status condition. | ||
===Type=== | ===Type=== | ||
The [[ | The [[type]] of the Pokémon. If the Pokémon has only one type, both values are the same. It seems redundant, as there is no way a Pokémon can change type in Generation I besides [[Evolution|evolving]], and through the use of Conversion. | ||
{| style="border: 1px solid #88a; background: #f8f8ff; padding: 0.5em; border-collapse: collapse; margin: 0 0 0.5em 0.5em;" cellspacing="1" cellpadding="2" | {| style="border: 1px solid #88a; background: #f8f8ff; padding: 0.5em; border-collapse: collapse; margin: 0 0 0.5em 0.5em;" cellspacing="1" cellpadding="2" | ||
Line 152: | Line 148: | ||
The [[catch rate]] for the species. This does not change when the Pokémon evolves, even if its evolution has a different catch rate. | The [[catch rate]] for the species. This does not change when the Pokémon evolves, even if its evolution has a different catch rate. | ||
When trading with {{3v2|Gold|Silver|Crystal}}, this field is co-opted for storing the Pokémon's [[held item]]. | When trading with {{3v2|Gold|Silver|Crystal}}, this field is co-opted for storing the Pokémon's [[held item]]. Items are preserved when traded from Generation II to Generation I and back, but some catch rates from Generation I do not have corresponding items in Generation II. In these cases, the value in this field is translated to a different value the first time it is traded to Generation II. | ||
The following catch rates correspond with bad items in Generation II (usually [[Teru-sama]]), and are converted into other items upon trading, as follows: | |||
{| style="margin:auto; background: #{{crystal color dark}}; {{roundy}}; border: 5px solid #{{silver color}};" | |||
|- | |||
| | |||
{| border="1" style="background: #fff; border: 1px solid #{{crystal color dark}}; border-collapse:collapse;" | |||
|- style="background:#{{crystal color dark}};" | |||
! style="background:#{{gold color}}; {{roundytl|5px}};" | {{color|{{gold color dark}}|Old #}} | |||
! style="background:#{{gold color}};" | {{color|{{gold color dark}}|Old Hex}} | |||
! style="background:#{{gold color}};" | {{color|{{gold color dark}}|Old Item}} | |||
! style="background:#{{gold color}};" | {{color|{{gold color dark}}|New #}} | |||
! style="background:#{{gold color}};" | {{color|{{gold color dark}}|New Hex}} | |||
! style="background:#{{gold color}};" | {{color|{{gold color dark}}|New Item}} | |||
|- style="text-align: center;" | |||
|025||0x19||[[Teru-sama]]||146||0x92||[[Leftovers]] | |||
|- style="text-align: center;" | |||
|045||0x2D||Teru-sama||083||0x53||{{DL|Berry (Generation II)|Bitter Berry}} | |||
|- style="text-align: center;" | |||
|050||0x32||Teru-sama||174||0xAE||{{DL|Berry (Generation II)|Gold Berry}} | |||
|- style="text-align: center;" | |||
|090||0x5A||Teru-sama||173||0xAD||[[Berry]] | |||
|- style="text-align: center;" | |||
|100||0x64||Teru-sama||173||0xAD||Berry | |||
|- style="text-align: center;" | |||
|120||0x78||Teru-sama||173||0xAD||Berry | |||
|- style="text-align: center;" | |||
|127||0x7F||[[Card Key]]||173||0xAD||Berry | |||
|- style="text-align: center;" | |||
|190||0xBE||Teru-sama||173||0xAD||Berry | |||
|- style="text-align: center;" | |||
|255||0xFF||[[Cancel]]||173||0xAD||Berry | |||
|} | |||
|} | |||
For example, a wild [[Snorlax (Pokémon)|Snorlax]] caught in Generation I has a catch rate of 25. However, this is a [[Teru-sama]] in Generation II, so the value is automatically converted into 146, [[Leftovers]]. | |||
A value of <code>0x00</code> in this field represents no held item. | |||
===Original Trainer ID number=== | ===Original Trainer ID number=== | ||
Line 178: | Line 212: | ||
==Storage== | ==Storage== | ||
The following are | The following are RAM offsets for the beginning of the party structure while walking around: | ||
* Red (en): | * Red (en): 0xD163 | ||
* Blue (en): 0xAF2C | * Blue (en): 0xAF2C | ||
* Yellow (en): | * Yellow (en): 0x2F2C | ||
During battle, on the other hand, the party structure is moved to the following offsets: | During battle, on the other hand, the party structure is moved to the following offsets: | ||
* Green (jp): 0xD123 | |||
* Red (en): Unknown | * Red (en): Unknown | ||
* Blue (en): 0xD163 | * Blue (en): 0xD163 | ||
Line 191: | Line 226: | ||
====6- | ====6-Pokémon Party Structure==== | ||
{| style="border: 1px solid #88a; background: #f8f8ff; padding: 1.0em; border-collapse: collapse; margin: 0 0 0.5em 0.5em;" cellspacing="1" cellpadding="3" | {| style="border: 1px solid #88a; background: #f8f8ff; padding: 1.0em; border-collapse: collapse; margin: 0 0 0.5em 0.5em;" cellspacing="1" cellpadding="3" | ||
Line 199: | Line 234: | ||
! style="text-align: center; background: #ccf;" | '''Size''' | ! style="text-align: center; background: #ccf;" | '''Size''' | ||
|- | |- | ||
| 0x00 || Number of | | 0x00 || Number of Pokémon in party || 1 Byte | ||
|- | |- | ||
| 0x01 || List Party | | 0x01 || List Party Pokémon Index values || 7 Bytes | ||
|- | |- | ||
| 0x08 || 1st | | 0x08 || 1st Pokémon structure || 44 Bytes | ||
|- | |- | ||
| 0x34 || 2nd | | 0x34 || 2nd Pokémon structure || 44 Bytes | ||
|- | |- | ||
| 0x60 || 3rd | | 0x60 || 3rd Pokémon structure || 44 Bytes | ||
|- | |- | ||
| 0x8C || 4th | | 0x8C || 4th Pokémon structure || 44 Bytes | ||
|- | |- | ||
| 0xB8 || 5th | | 0xB8 || 5th Pokémon structure || 44 Bytes | ||
|- | |- | ||
| 0xE4 || 6th | | 0xE4 || 6th Pokémon structure || 44 Bytes | ||
|- | |- | ||
| 0X110 || | | 0X110 || x 0x000B's to terminate || x Words | ||
|} | |} | ||
The list of party index values ends with FF, which is followed by 00s through the rest of the section. | The list of party index values ends with FF, which is followed by 00s through the rest of the section; however, if the party contains only 1 Pokémon, the FF may or may not be there. Finally, the terminating 0x000B's vary in number, and other information appears to follow, but its significance is not yet clear. | ||
Also of note is that the storage of the current | Also of note is that the storage of the current Pokémon's information during battle. The internal index of the current is stored at 0xCF91, and the full Pokémon data structure begins at 0xCF98. | ||
{{ | {{Data structure}}<br> | ||
{{Project Games notice|data structure}} | {{Project Games notice|data structure}} |