Pokédex data structure (Generation III): Difference between revisions

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
(Corrected units for weight/height based on French versions (which do not use conversions))
(Category)
 
(43 intermediate revisions by 27 users not shown)
Line 1: Line 1:
==Specs==
==Specs==


A '''Pokédex data structure''' is a 37-byte piece of data.
A '''Pokédex data structure''' is a 36-byte (32-byte for Pokémon Emerald) piece of data.


Every [[Pokémon|Pokémon species]] in the [[Generation III]] games has a Pokédex data stored in the game that is used in Pokédex related functions and also by some moves like Low Kick.
Every [[Pokémon species]] in the [[Generation III]] games has data stored in the game that is used in [[Pokédex]] related functions and by certain moves, such as {{m|Low Kick}}.


{| align="center" style="border: 1px solid #88a; background: #f8f8ff; padding: 0.5em;" cellspacing="1"
{| class="roundy" align="center" style="border: 3px solid #{{hoenn color dark}}; background: #{{hoenn color light}}; padding: 0.5em;" cellspacing="1"
|-  
|-  
! colspan="2" style="text-align: center; background: #ccf;" | '''Pokédex Data'''
! colspan="2" style="text-align: center; background: #{{hoenn color}}; {{roundy}}" | '''Pokédex Data'''
|-
|-
| Effect || byte
| Category || 12 bytes
|-
|-
| Padding || byte
| Height (10<sup>-1</sup> m) || 2 bytes
|-
|-
| Species || 12 bytes
| Weight (10<sup>-1</sup> kg) || 2 bytes
|-
|-
| Height (* 10^(-1) m) || 2 bytes
| Description pointer #1 || 4 bytes (See Notes)
|-
|-
| Weight (* 10^(-1) Kg) || 2 bytes
| Description pointer #2 || 4 bytes (See Notes)
|-
|-
| Description pointer start || 4 bytes
| Padding || 2 Bytes
|-
| Description pointer end || 4 bytes
|-
|-
| Pokémon scale || 2 bytes
| Pokémon scale || 2 bytes
|-
|-
| Pokémon offset || byte
| Pokémon offset || 2 bytes
|-
| Offset +/- || byte
|-
|-
| Trainer scale || 2 bytes
| Trainer scale || 2 bytes
|-
|-
| Trainer offset || byte
| Trainer offset || 2 bytes
|-
|-
| Padding || 2 bytes
| Padding || 2 Bytes
|}
|}


==Notes==
==Notes==
<ul>
* '''[[Pokémon category|Category]]''' is 12 bytes long and comes in capital letters. 0x00 fills possible empty bytes.
  <li><b>Species</b> is 12 bytes long and comes in capital letters. 0x00 fills possible empty bytes.</li>
* '''Height''' is measured in decimeters (10<sup>-1</sup> meters), and is then converted to other units in specific versions of games.
  <li><b>Height</b> is actually a word (2 bytes) and comes in decimetres (10^(-1) metres), it is then converted to other unites in some games.</li>
* '''Weight''' is measured comes in hectograms (10<sup>-1</sup> kilograms), and is then converted to other units in specific versions of games.
  <li><b>Weight</b> is actually a word (2 bytes) and comes in hectogrammes (10^(-1) kilogrammes), it is then converted to other unites in some games.</li>
* '''Description pointers''' show the game where the description for the particular Pokémon is. The GBA is Little Endian, and that a ROM file is loaded at an offset of 0x08000000.
  <li><b>Description pointers</b> show to the game where the description for the particular Pokémon is; they are reversed of course (little endian format). The 4th byte is always set to 0x08 (8), so this matches a BRANCH instruction (B) in assembly. For example, if the location is 0x123456, it will appear here as 0x56341208.</li>
:Ruby and Sapphire, being the only games that have two pages of text, are the only games that use both. FireRed and LeafGreen have the second description pointer pointing to an empty string which is never read, and Emerald removed Description pointer #2 entirely.
  <li><b>Offset +/-</b> determines whether the <b>Pokémon offset</b> will be negative or not.</li>
* '''Pokémon offset''' is a signed 16-bit integer; therefore, if the raw value is 0x8000 or greater, then it is negative, with 0x8000 as -32,768 and 0xFFFF as -1.
</ul>


==Size compare function==
==Size compare function==
In [[Generation III]], there is a size page on the Pokédex, which uses data from the Pokédex to create a silhouette of the Pokémon standing next to the Trainer. The size of both the Trainer and Pokémon are determined by this formula:


In the [[Generation III]], there's a size page on the Pokédex, which uses data from the Pokédex to create a silhouette of the Pokémon standing next to the trainer. The size of both the trainer and Pokémon are determined by this formula:
<br/>
<code>
<code>
x = (y &times; 256/z)  pixels
x = (y &times; 256/z)  pixels
</code>
</code>
<br/>
Where y is the sprite size (64 pixels in our case) and z is the appropriate scale in hex and x rounded down is the size of silhouette. The game then resized the sprite in a way similar a computer would do (without anti-aliasing of course).<br/>
The offset determines where exactly the silhouette will be placed. For example if <b>Pokémon offset</b> = 10 then the silhouette of the Pokémon will be 10 pixels from the top and 10 pixels from the left. (for some reason, that cannot be exactly simulated outside of the game).<br/>
If <b>Offset +/-</b> is equal to 0xFF then the actual <b>Pokémon offset</b> will be equal to -(256 - <b>Pokémon offset</b>), otherwise the actual <b>Pokémon offset</b> stays the same.


[[Category:Structures]]
Where y is the sprite size (64 pixels in this case) and z is the appropriate scale in hex and x rounded down is the size of silhouette. The game then resizes the sprite in a way similar a computer would do (without anti-aliasing).
[[Category:Game mechanics]]
 
The offset determines where exactly the silhouette will be placed. For example if '''Pokémon offset''' = 10 then the silhouette of the Pokémon will be 10 pixels from the top and 10 pixels from the left. (For some reason, that cannot be exactly simulated outside of the game).
 
==Offsets==
Ruby: 0x083B1858<br />
Sapphire: 0x083B18B0<br />
Emerald: 0x0856B5B0<br />
FireRed: 0x0844E850<br />
LeafGreen: 0x0844E270
 
==Fingerprint==
 
For Ruby/Sapphire:
<pre>
cf c8 c5 c8 c9 d1 c8 ff 00 00 00 00 00 00 00 00 59 04 3a 08 a2 04 3a 08 00 00 00 01 00 00 00 01 00 00 00 00  // -
cd bf bf be ff 00 00 00 00 00 00 00 07 00 45 00 d5 04 3a 08 24 05 3a 08 00 00 64 01 11 00 00 01 00 00 00 00  // BULBASAUR
cd bf bf be ff 00 00 00 00 00 00 00 0a 00 82 00 67 05 3a 08 d5 05 3a 08 00 00 4f 01 0d 00 00 01 00 00 00 00  // IVYSAUR
cd bf bf be ff 00 00 00 00 00 00 00 14 00 e8 03 4a 06 3a 08 c0 06 3a 08 00 00 00 01 00 00 84 01 06 00 00 00  // VENUSAUR
c6 c3 d4 bb cc be ff 00 00 00 00 00 06 00 55 00 01 07 3a 08 73 07 3a 08 00 00 bc 01 12 00 00 01 00 00 00 00  // CHARMANDER
c0 c6 bb c7 bf ff 00 00 00 00 00 00 0b 00 be 00 be 07 3a 08 26 08 3a 08 00 00 2e 01 09 00 00 01 00 00 00 00  // CHARMELEON
c0 c6 bb c7 bf ff 00 00 00 00 00 00 11 00 89 03 8c 08 3a 08 f0 08 3a 08 00 00 00 01 01 00 2e 01 03 00 00 00  // CHARIZARD
...
</pre>
 
{{data structure}}<br>
{{Project Games notice|data structure}}

Latest revision as of 15:44, 9 March 2021

Specs

A Pokédex data structure is a 36-byte (32-byte for Pokémon Emerald) piece of data.

Every Pokémon species in the Generation III games has data stored in the game that is used in Pokédex related functions and by certain moves, such as Low Kick.

Pokédex Data
Category 12 bytes
Height (10-1 m) 2 bytes
Weight (10-1 kg) 2 bytes
Description pointer #1 4 bytes (See Notes)
Description pointer #2 4 bytes (See Notes)
Padding 2 Bytes
Pokémon scale 2 bytes
Pokémon offset 2 bytes
Trainer scale 2 bytes
Trainer offset 2 bytes
Padding 2 Bytes

Notes

  • Category is 12 bytes long and comes in capital letters. 0x00 fills possible empty bytes.
  • Height is measured in decimeters (10-1 meters), and is then converted to other units in specific versions of games.
  • Weight is measured comes in hectograms (10-1 kilograms), and is then converted to other units in specific versions of games.
  • Description pointers show the game where the description for the particular Pokémon is. The GBA is Little Endian, and that a ROM file is loaded at an offset of 0x08000000.
Ruby and Sapphire, being the only games that have two pages of text, are the only games that use both. FireRed and LeafGreen have the second description pointer pointing to an empty string which is never read, and Emerald removed Description pointer #2 entirely.
  • Pokémon offset is a signed 16-bit integer; therefore, if the raw value is 0x8000 or greater, then it is negative, with 0x8000 as -32,768 and 0xFFFF as -1.

Size compare function

In Generation III, there is a size page on the Pokédex, which uses data from the Pokédex to create a silhouette of the Pokémon standing next to the Trainer. The size of both the Trainer and Pokémon are determined by this formula:

x = (y × 256/z) pixels

Where y is the sprite size (64 pixels in this case) and z is the appropriate scale in hex and x rounded down is the size of silhouette. The game then resizes the sprite in a way similar a computer would do (without anti-aliasing).

The offset determines where exactly the silhouette will be placed. For example if Pokémon offset = 10 then the silhouette of the Pokémon will be 10 pixels from the top and 10 pixels from the left. (For some reason, that cannot be exactly simulated outside of the game).

Offsets

Ruby: 0x083B1858
Sapphire: 0x083B18B0
Emerald: 0x0856B5B0
FireRed: 0x0844E850
LeafGreen: 0x0844E270

Fingerprint

For Ruby/Sapphire:

cf c8 c5 c8 c9 d1 c8 ff 00 00 00 00 00 00 00 00 59 04 3a 08 a2 04 3a 08 00 00 00 01 00 00 00 01 00 00 00 00  // -
cd bf bf be ff 00 00 00 00 00 00 00 07 00 45 00 d5 04 3a 08 24 05 3a 08 00 00 64 01 11 00 00 01 00 00 00 00  // BULBASAUR
cd bf bf be ff 00 00 00 00 00 00 00 0a 00 82 00 67 05 3a 08 d5 05 3a 08 00 00 4f 01 0d 00 00 01 00 00 00 00  // IVYSAUR
cd bf bf be ff 00 00 00 00 00 00 00 14 00 e8 03 4a 06 3a 08 c0 06 3a 08 00 00 00 01 00 00 84 01 06 00 00 00  // VENUSAUR
c6 c3 d4 bb cc be ff 00 00 00 00 00 06 00 55 00 01 07 3a 08 73 07 3a 08 00 00 bc 01 12 00 00 01 00 00 00 00  // CHARMANDER
c0 c6 bb c7 bf ff 00 00 00 00 00 00 0b 00 be 00 be 07 3a 08 26 08 3a 08 00 00 2e 01 09 00 00 01 00 00 00 00  // CHARMELEON
c0 c6 bb c7 bf ff 00 00 00 00 00 00 11 00 89 03 8c 08 3a 08 f0 08 3a 08 00 00 00 01 01 00 2e 01 03 00 00 00  // CHARIZARD
...


Data structure in the Pokémon games
General Character encoding
Generation I Pokémon speciesPokémonPoké MartCharacter encodingSave
Generation II Pokémon speciesPokémonTrainerCharacter encoding (Korean) • Save
Generation III Pokémon species (Pokémon evolutionPokédexType chart)
Pokémon (substructures) • MoveContestContest moveItem
Trainer TowerBattle FrontierCharacter encodingSave
Generation IV Pokémon species (Pokémon evolutionLearnsets)
PokémonSaveCharacter encoding
Generation V–present Character encoding
Generation VIII Save
TCG GB and GB2 Character encoding


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.