Please remember to follow the manual of style and code of conduct at all times.
Check BNN and Bulbanews for up-to-date Pokémon news and discuss it on the forums or in our IRC channel #bulbagarden on irc.systemnet.info.

Pokémon data structure in Generation III

From Bulbapedia, the community-driven Pokémon encyclopedia.
Revision as of 20:02, 19 January 2013 by Yvnr (Talk | contribs)

Jump to: navigation, search

Pokémon in the Pokémon Ruby and Sapphire, FireRed and LeafGreen, and Emerald Versions are all stored the same way in a 100-byte structure.

Notes

Pokémon
type offset
Personality dword 0
OT ID dword 4
Nickname 10 bytes 8
Language word 18
OT name 7 bytes 20
Mark byte 27
Checksum word 28
 ???? word 30
Data 48 bytes 32
Status ailment dword 80
Level byte 84
Pokérus remaining byte 85
Current HP word 86
Total HP word 88
Attack word 90
Defense word 92
Speed word 94
Sp. Attack word 96
Sp. Defense word 98

Personality value

The personality value controls many things, including gender, Unown's letter, Spinda's dots, any Pokémon's Nature, and others.

OT ID

The Original Trainer's ID Number. Part of the XOR encryption key for the data section, also used in Shiny determination and the lottery.

Nickname

The Pokémon's nickname, limited to 10 characters.

Language

Determines the language of the game the Pokémon comes from. Valid values are:

  • 0201 = Japanese
  • 0202 = English
  • 0203 = French
  • 0204 = Italian
  • 0205 = German
  • 0207 = Spanish

OT name

The name of the original Trainer of the Pokémon.

Mark

The marks seen in the storage Box. These marks serve only to aid in organizing large collections of Pokémon.

Bit Mark
0 Circle
1 Square
2 Triangle
3 Heart

Checksum

The checksum is of the 48-byte data section in the structure. It is computed by simply adding all the unencrypted values one word at a time. If this value does not match the real checksum, the Pokémon is interpreted as a Bad Egg.

Padding

Any entry marked (Padding) is not used and usually set to either 0 or -1 of the respective data type.

Status ailment

The Pokémon's status ailments are stored as follows:

  • 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

Location

A Trainer's team starts at the following addresses in the GBA's RAM (for US games?):

  • Ruby: 0x03004360
  • Sapphire: 0x03004360
  • Emerald: 0x02024190, 0x020244EC for US games
  • FireRed: 0x02024284
  • LeafGreen: 0x020241e4

Additionally, a wild Pokémon or an opponent's Pokémon will begin at:

  • Emerald: 0x02024744


There are 6 Pokémon per team, so the whole team continues for 600 bytes afterward.

This structure is used to save data on Pokémon stored in the player's team. The structure for Pokémon saved in the PC stops after the data field, making it only 80 bytes long.

This explains why Pokémon injured by status ailment will cure themselves when put in the PC. It also applies to stats and level, which are recalculated based on Experience.

Thus, there are also 33600 (14*30*80) bytes stored somewhere else in the GBA's RAM to save data on Pokémon in the PC.

When the GBA's saved state (including memory contents) are unzipped into a 740,000+ byte file and viewed, the 14 Boxes of 420 Pokémon are stored in the general region of $038000 $040000.

See also

Links


Data structure in the Pokémon games
Generation I Pokémon data structurePokémon base stats data structureSave data structure
Generation II Pokémon data structurePokémon base stats data structureTrainer data structureSave data structure
Generation III Pokémon data structurePokémon data substructuresPokémon base stats data structureMove data structure
Contest data structureContest move data structureItem data structurePokédex data structureBattle Frontier data structures
Trainer Tower data structuresPokémon evolution data structureType Chart data structureSave data structure
Generation IV Pokémon data structureSave data structure

Project Games logo.png This data structure article is part of Project Games, a Bulbapedia project that aims to write comprehensive articles on the Pokémon games.