Pokémon data structure (Generation III)
Pokemon in the games Ruby, Sapphire, FireRed, LeafGreen, and Emerald are all stored the same way in a 100-byte structure.
ADVPOKEMON | |
personality | DWORD |
trainer id | DWORD |
nickname | TBYTE |
font | WORD |
trainer name | BYTE[7] |
mark | BYTE |
crc16 | WORD |
[x] | WORD |
[data] | BYTE[48] |
status | BYTE |
[x] | BYTE[3] |
level | BYTE |
[x] | BYTE |
HP meter | WORD |
HP total | WORD |
attack | WORD |
defense | WORD |
speed | WORD |
special attack | WORD |
special defense | WORD |
Synopsis
- Personality
Controls many things, including sex, unown letter, Spinda's dots, nature, and others.
- Trainer ID
Part of the weak XOR-encryption key in the data section, also used in shiny determination.
- Nickname
The pokemon's nickname, limitted to 10 characters.
- Font
Determines which character set is used for the nickname (?).
- Trainer Name
The name of the trainer whose corresponding ID is in Trainer ID.
- Mark
The marks you see in the storage box. Heart, circle, square, and triangle.
- CRC16
CRC16 value of the 48-byte data section in the middle of the structure. Computed by simply adding all the unencrypted values one word at a time. This value is what makes bad eggs.
- [x]
Any entry marked [x] is not used and usually set to either 0 or -1 of the respective data type.
- [data]
Data section.
- Status
The status byte. A pokemon's status is flagged by the bits:
0-2: Sleep bits. Indicates turns of sleep, so 111b = 7 turns, 101b = 5 turns, etc.
3: Poison
4: Burned
5: Frozen
6: Paralysis
7: Bad poison
- Level
Single byte indicating level.
- HP Meter
HP remaining.
- HP Total
Maximum HP attainable, your HP stat.
- Attack
Attack stat.
- Defense
Defense stat.
- Speed
Speed stat.
- Special Attack
Special Attack stat.
- Special Defense
Special Defense stat.
Location
A trainer's team starts at the following addresses in the GBA's RAM:
Sapphire: 0x03004360
Ruby: 0x03004360
Fire: 0x02024284
Leaf: 0x020241e4
Emerald: 0x02024190
Six pokemon per team, so the whole team continues for 600 bytes afterward.