Trainer data structure (Generation II): Difference between revisions

From Bulbapedia, the community-driven Pokémon encyclopedia.
Jump to navigationJump to search
(navtemplate)
m (Text replacement - "}}<br>↵{{Project Games notice" to "}} {{Project Games notice")
 
(13 intermediate revisions by 12 users not shown)
Line 2: Line 2:
{{cleanup}}
{{cleanup}}


Length: unknown.
==NPC Trainer data==


Start: 0x15C7?
{|style="text-align: left; margin: auto; border: 1px solid #88a; background: #f8f8ff; padding: 0.5em; border-collapse: collapse; float: right; width: 250px; padding-left:5px;" cellspacing="1" cellpadding="2"
! style="text-align: center; background: #{{johto color}};" | Name
! style="text-align: center; background: #{{johto color}};" | Length
|-
| Name
| 2-8 bytes
|-
|style="padding-left:20px;"| Name string
|style="padding-left:10px;"| 1-7 bytes
|-
|style="padding-left:20px;"| Terminator
|style="padding-left:10px;"| 1 byte
|-
| Custom move marker
| 1 byte
|-
| Pokémon
| 2-6 bytes
|-
|style="padding-left:20px;"| Level
|style="padding-left:10px;"| 1 byte
|-
|style="padding-left:20px;"| Species
|style="padding-left:10px;"| 1 byte
|-
|style="padding-left:20px;"| Moveset
|style="padding-left:10px;"| 4 bytes
|-
| Terminator
| 1 byte
|}


The in-game Trainer data is remarkably compressed.


0x15C7: ID number, 2 bytes. Raw hex.
====Name====
This is a {{OBP|Character encoding|Generation II|string}} going anywhere from 2 to 8 bytes, containing the Trainer's name and ending in a 0x50 terminator. The rival's name is represented by a single byte - 0xE6.


0x15C9: Name, 8 bytes. Uses special text format (0x80 is A, 0xA0 is a). Terminated with 0x50. If the name is shorter than 7 characters, the end will be padded with 0x00 bytes.
====Custom move marker====
This is one byte marking whether the Pokémon in the party have custom moves or not. If not, it is set to 0 - if so, it is set to 1.


0x15D1: padding, 3 bytes. All 0x00.
====Pokémon====
Depending on whether the custom move marker was set or not, each Pokémon's data is either 2 or 6 bytes long. If the move marker was set to 0, the Pokémon's data simply contains the Pokémon's level and species, in that order. Otherwise, it contains the full moveset after the level and species - 1 byte per move.


{{gamestub}}
====Terminator====
This is a single byte (0xFF) which tells the processor to stop reading data.
 
{{Stub|Game}}
{{data structure}}
{{data structure}}
{{Project Games notice|data structure}}

Latest revision as of 17:32, 16 September 2024

050Diglett.png This article is incomplete.
Please feel free to edit this article to add missing information and complete it.

0572Minccino.png This article does not yet meet the quality standards of Bulbapedia. Please feel free to edit this article to make it conform to Bulbapedia norms and conventions.

NPC Trainer data

Name Length
Name 2-8 bytes
Name string 1-7 bytes
Terminator 1 byte
Custom move marker 1 byte
Pokémon 2-6 bytes
Level 1 byte
Species 1 byte
Moveset 4 bytes
Terminator 1 byte

The in-game Trainer data is remarkably compressed.

Name

This is a string going anywhere from 2 to 8 bytes, containing the Trainer's name and ending in a 0x50 terminator. The rival's name is represented by a single byte - 0xE6.

Custom move marker

This is one byte marking whether the Pokémon in the party have custom moves or not. If not, it is set to 0 - if so, it is set to 1.

Pokémon

Depending on whether the custom move marker was set or not, each Pokémon's data is either 2 or 6 bytes long. If the move marker was set to 0, the Pokémon's data simply contains the Pokémon's level and species, in that order. Otherwise, it contains the full moveset after the level and species - 1 byte per move.

Terminator

This is a single byte (0xFF) which tells the processor to stop reading data.

Red EN boxart.png This game-related article is a stub. You can help Bulbapedia by expanding it.


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 (EvolutionPokédexType chart)
Pokémon (substructures) • MoveContestContest moveItem
Trainer TowerBattle FrontierCharacter encoding (GameCube) • Save
Generation IV Pokémon species (EvolutionLearnsets)
PokémonSaveCharacter encoding (Wii)
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.