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))
mNo edit summary
Line 13: Line 13:
| Padding || byte
| Padding || byte
|-
|-
| Species || 12 bytes
| Name || 12 bytes
|-
|-
| Height (* 10^(-1) m) || 2 bytes
| Height (10<sup>-1</sup> m) || 2 bytes
|-
|-
| Weight (* 10^(-1) Kg) || 2 bytes
| Weight (10<sup>-1</sup> kg) || 2 bytes
|-
|-
| Description pointer start || 4 bytes
| Description pointer start || 4 bytes
Line 25: Line 25:
| 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
Line 37: Line 35:


==Notes==
==Notes==
<ul>
* '''Name''' 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 decimetres (10<sup>-1</sup> metres), and is then converted to other units in some 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 hectogrammes (10<sup>-1</sup> kilogrammes), it is then converted to other units in some games.</li>
  <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 to the game where the description for the particular Pokémon is; remember the GBA is little endian. The MSB 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 0x08123456 (56 34 12 08).
  <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>
* '''Pokémon offset''' is a signed 16-bit integer - if the raw value is greater 0x8000, then it is negative, with 0x8000 as -32,767 and 0xFF as -1.
  <li><b>Offset +/-</b> determines whether the <b>Pokémon offset</b> will be negative or not.</li>
</ul>


==Size compare function==
==Size compare function==


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:
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/>
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).
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.
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).


[[Category:Structures]]
[[Category:Structures]]
[[Category:Game mechanics]]
[[Category:Game mechanics]]

Revision as of 11:41, 19 March 2005

Specs

A Pokédex data structure is a 37-byte piece of data.

Every 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.

Pokédex Data
Effect byte
Padding byte
Name 12 bytes
Height (10-1 m) 2 bytes
Weight (10-1 kg) 2 bytes
Description pointer start 4 bytes
Description pointer end 4 bytes
Pokémon scale 2 bytes
Pokémon offset 2 bytes
Trainer scale 2 bytes
Trainer offset byte
Padding 2 bytes

Notes

  • Name is 12 bytes long and comes in capital letters. 0x00 fills possible empty bytes.
  • Height is measured in decimetres (10-1 metres), and is then converted to other units in some games.
  • Weight is measured comes in hectogrammes (10-1 kilogrammes), it is then converted to other units in some games.
  • Description pointers show to the game where the description for the particular Pokémon is; remember the GBA is little endian. The MSB 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 0x08123456 (56 34 12 08).
  • Pokémon offset is a signed 16-bit integer - if the raw value is greater 0x8000, then it is negative, with 0x8000 as -32,767 and 0xFF as -1.

Size compare function

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:

x = (y × 256/z) pixels

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).

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).