Trainer Tower data structures (Generation III)

There are a number of data structures in the international releases of Pokémon FireRed and LeafGreen that govern Trainer Tower.

All memory addresses refer to the addresses used in the US version of the games.

Overview

In the Japanese release of Pokémon FireRed and LeafGreen, players could scan in e-Reader cards from the Battle-e FireRed and LeafGreen series to customize the layout of Trainer Tower. In the international releases, the data from all 32 of the regular cards are folded into the game ROM; none of the Japanese promotional cards are present. The four battle modes (Single, Double, Knockout, and Mixed) each have a hard-coded order of eight Trainers, exactly as if their corresponding cards have been scanned.

Note that not all 32 cards are used in international releases; notably, all 8 of the Knockout battle cards are used in the Knockout mode, some of which are reused in Mixed mode. A few singles and doubles cards are also reused in Trainer Tower.

The card data is stored in memory location 0x0847ABAC (FireRed) and 0x0847A488 (LeafGreen).

Cards

Each Trainer Card is stored as a 992-byte structure, laid out as follows:

OffsetSizeTypeName
0x001uint8_tCard Number
0x011Currently unknown
0x021uint8_tBattle Type - 0 for Single Battles, 1 for Double Battles, and 2 for knockout battles
0x031uint8_tReward Item - This is the reward item that is obtained when players defeat Trainer Hill, provided that this card represents the first Trainer. The values are indices in a special 15-entry array.
0x04984Trainer Data[3]The data for up to three Trainers and their Pokémon.
0x3DC4Currently unknown

Trainer Data is a 328-byte structure, laid out as follows:

OffsetSizeTypeName
0x0011char[11]Trainer Name
0x0B3Currently unknown
0x0E48Easy Chat Quote[3]Challenge, win, and lose quotes (in that order) - each of these are built in accordance to the easy chat system.
0x3E2Padding bytes resulting from alignment
0x40264Trainer's Pokémon[6]Trainer's Pokémon Lineup

Trainer's Pokémon is a 44-byte structure, laid out as follows:

OffsetSizeTypeName
0x002uint16_tSpecies - see List of Pokémon by index number (Generation III) for values.
0x022uint16_tHeld Item - see List of items by index number (Generation III) for values.
0x048uint16_t[4]Moves - see List of moves for values.
0x0C20Currently unknown
0x2011char[11]Nickname - Note that none of the Pokémon on any of these cards are actually nicknamed; the species name is placed here instead.
0x2B1Currently unknown

If a Trainer is unused (the second and third Trainers in a Single Battle card, or the third Trainer in a Double battle card), the entire structure, with the exception of the easy chat quotes, is zeroed out; the easy chat quote area is filled with 0xFF instead.

Floor Plan

The floor plan is simply a list of eight pointers to the various cards that will be used in each mode. There are four such lists, one for each mode. Their locations are as follows:

ModeFireRedLeafGreen
Single0x084827B40x08482090
Double0x084827D40x084820B0
Knockout0x084827F40x084820D0
Mixed0x084828140x084820F0

Reward Items

The reward items used on each card corresponds to indices in an array of 15 items (as indices to the master item list). This array is stored in location 0x0847A2B4 (FireRed) and 0x08479B90 (LeafGreen). For convenience, it is reproduced here.

0123
0 HP UpProteinIronCarbos
4 CalciumZincBrightPowderWhite Herb
8 Mental HerbChoice BandKing's RockScope Lens
C Metal CoatDragon ScaleUp-Grade


Data structure in the Pokémon games
Generation I Pokémon speciesPokémonPoké MartCharacter encodingSave
Generation II Pokémon speciesPokémonTrainerCharacter encodingSave
Generation III Pokémon species (Pokémon evolutionPokédexType chart)
Pokémon (substructures) • MoveContestContest moveItem
Trainer TowerBattle FrontierCharacter encodingSave
Generation IV PokémonSave
TCG GB and GB2 Character encoding


This data structure article is part of Project Games, a Bulbapedia project that aims to write comprehensive articles on the Pokémon games.
This article is issued from Bulbagarden. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.