Pokémon data structure (Generation IV): Difference between revisions

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
(I think Encounter Type a better wording =*)
Line 33: Line 33:
* 34-37 Move PP Ups
* 34-37 Move PP Ups
* 38-3B [[Individual values]]
* 38-3B [[Individual values]]
* 3C-3F ''Unknown''
* 3C-3F Ribbons 2
* 40 Gender
* 40 Gender
* 41-47 ''Unknown''
* 41-47 ''Unknown''
Line 53: Line 53:
* 83 Poké Ball
* 83 Poké Ball
* 84 Met At Level
* 84 Met At Level
* 85 Specific Location
* 85 Encounter Type
* 86-87 ''Unknown''
* 86-87 ''Unknown''


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

Revision as of 04:00, 27 June 2008

Pokémon in the games Diamond and Pearl are all stored the same way in a 136-byte structure.

  • Need to figure out how checksum is computed
  • Need to figure out the encryption algorithm for bytes 08-87

The Pokémon data structure is divided into four 32-byte blocks, A through D. The personality value and checksum are stored into the save data, and the remaining 128 bytes are encrypted in a never-before-seen complex method using some combination of the PV and checksum as the encryption key. (It is no longer as simple as XOR'ing the 2 values.) Then, something (not PV mod 24 as in the GBA games) determines which order the data gets stored in, i.e. BACD or CABD or one of the 22 other possible permutations. This algorithm needs to be figured out.

Everything is stored in little endian

Unencrypted bytes

Block A

  • 08-09 Species ID
  • 0A-0B Held Item
  • 0C-0D OT ID
  • 0E-0F OT Secret ID
  • 10-13 Experience points
  • 14 Friendship/Egg Steps to Hatch
  • 15 Ability
  • 16 Markings
  • 17 Country of Origin
  • 18-1D Effort values
  • 1E-23 Contest stats
  • 24-27 Ribbons

Block B

  • 28-2F Moveset
  • 30-33 Move PP
  • 34-37 Move PP Ups
  • 38-3B Individual values
  • 3C-3F Ribbons 2
  • 40 Gender
  • 41-47 Unknown

Block C

  • 48-5D Nickname
  • 5E Unknown
  • 5F Hometown
  • 60-62 Contests
  • 63-67 Unknown

Block D

  • 68-77 OT Name
  • 78-7A Date Egg Received
  • 7B-7D Date Met
  • 7E-7F Egg Location
  • 80-81 Met At Location
  • 82 Poké Rus
  • 83 Poké Ball
  • 84 Met At Level
  • 85 Encounter Type
  • 86-87 Unknown