PK1 and PK2 Classes
PK1 and PK2 represent the earliest Pokémon data formats from Generation 1 (Red/Blue/Yellow) and Generation 2 (Gold/Silver/Crystal).PK1 Class
Namespace:PKHeX.Core
File: PKHeX.Core/PKM/PK1.cs
Format Specifications
| Property | Value |
|---|---|
| SIZE_STORED | 33 bytes |
| SIZE_PARTY | 44 bytes |
| Generation | 1 |
| Context | EntityContext.Gen1 |
| Games | Red, Blue, Yellow |
Key Features
Special Stat System
- Uses Special stat (no split between Sp. Atk and Sp. Def)
- Both
Stat_SPAandStat_SPDreturn the sameStat_SPCvalue - DVs (Determinant Values) instead of IVs, stored as 4 bits each
Catch Rate System
Gen 1 Pokémon store catch rate data instead of held items:- The actual catch rate of the species
- A held item when transferred to Gen 2
Data Encoding
- Big-endian byte order
- No encryption
- Species stored as internal Gen 1 index (not National Dex)
Important Properties
Species Management
Stats (Stored Format - 33 bytes)
0x00: Species (internal)0x01-0x02: Current HP0x03: Level (box)0x04: Status Condition0x05-0x06: Type 1 & Type 20x07: Catch Rate0x08-0x0B: Moves 1-40x0C-0x0D: TID0x0E-0x10: EXP (24-bit)0x11-0x1A: EVs (HP, ATK, DEF, SPE, SPC)0x1B-0x1C: DVs (IVs)0x1D-0x20: PP for moves 1-4
Party Stats (+11 bytes)
0x21: Level0x22-0x2B: Max HP, Attack, Defense, Speed, Special (party stats)
Conversion Methods
Convert to PK2
- Converts catch rate to held item
- Preserves DVs, moves, and experience
Convert to PK7 (Virtual Console)
- Generates random IVs with minimum 3 perfect (5 for Mew)
- Hidden Ability based on transfer rules
- Sets transfer location and memories
PK2 Class
Namespace:PKHeX.Core
File: PKHeX.Core/PKM/PK2.cs
Format Specifications
| Property | Value |
|---|---|
| SIZE_STORED | 32 bytes |
| SIZE_PARTY | 48 bytes |
| Generation | 2 |
| Context | EntityContext.Gen2 |
| Games | Gold, Silver, Crystal |
Key Features
New Gen 2 Features
- Held Items: First generation with held items
- Gender: Determined from DVs
- Shininess: Based on DV values
- Friendship: Introduced happiness/friendship system
- Time of Day: Crystal adds time-of-day encounter data
Crystal-Exclusive Data
Crystal version introduced met location tracking:Important Properties
Data Structure (Stored - 32 bytes)
0x00: Species0x01: Held Item0x02-0x05: Moves 1-40x06-0x07: TID0x08-0x0A: EXP (24-bit)0x0B-0x14: EVs (HP, ATK, DEF, SPE, SPC)0x15-0x16: DVs0x17-0x1A: PP for moves 1-40x1B: Friendship0x1C: Pokérus state0x1D-0x1E: Caught data (Crystal)0x1F: Level
Party Stats (+16 bytes)
0x20: Status Condition0x22-0x2F: Current HP, Max HP, ATK, DEF, SPE, SPA, SPD
Pokérus System
Korean Version Support
PK2 includes support for Korean Gold/Silver:Conversion Methods
Convert to PK1
- Converts held item back to catch rate
- Removes Gen 2-specific data
Convert to PK7 (Virtual Console)
- Preserves gender and OT from Crystal data
- Special handling for Celebi and other event Pokémon
- Minimum 3 perfect IVs (5 for Mew/Celebi)
Convert to SK2 (Stadium 2)
String Encoding
Gen 1-2 use custom character encodings:- Japanese: 5-character names
- International: 7-character trainer names, 10-character nicknames
- Korean: Unique encoding for Korean GS
Limitations
Gen 1 Limitations
- Maximum 151 species
- No abilities, natures, or held items
- No gender or shininess (determined on transfer)
- 8-bit stats (max 255)
- Big-endian encoding
Gen 2 Limitations
- Maximum 251 species
- No abilities or natures
- DV-based gender and shininess
- Limited met location data (Crystal only)
- No encryption
Code Examples
Creating a Gen 1 Pokémon
Converting Gen 2 to Gen 7
See Also
- Format Overview
- PK3, PK4, PK5 Classes
- String converters for Gen 1-2 text encoding