Methods & Lead
Last updated: 2026-03-18 UTCPrerequisite
Having read Methods 1-4 and VBlanksPokémon Wild Encounter (Simplified version)
Here's a simplified example of the code executed on a wild encounter:| Step | Cycles | Total Cycles |
|---|---|---|
| 1- Update audio & visual | + 50K | 50K |
| 2- Miscellaneous updates | + 5K | 55K |
| 3- Prepare wild encounter | + 15K-115K | 70K-170K |
| 4- Generate valid PID | + 10K | 80K-180K |
| 5- Create Pokémon without IVs | + 115K | 195K-295K |
| 6- Generate Def, Atk, HP IVs | + 1K | 196K-296K |
| 7- Assign Def, Atk, HP IVs | + 39K | 235K-335K |
| 8- Generate SpD, SpA, Spe IVs | + 1K | 236K-336K |
| 9- Assign SpD, SpA, Spe IVs | + 39K | 275K-375K |
| Step | Fastest Lead Wild-1 | Fast Lead Wild-4 | Slow Lead Wild-2 |
|---|---|---|---|
| 1- Update audio & visual | 50K | 50K | 50K |
| 2- Miscellaneous updates | 55K | 55K | 100K |
| 3- Prepare wild encounter | 70K (fastest) | 120K (fast) | 170K (slow) |
| 4- Generate valid PID | 80K | 130K | 180K |
| 5- Create Pokémon without IVs | 195K | 245K | 295K (VBlank) |
| 6- Generate Def, Atk, HP IVs | 196K | 246K | ... |
| 7- Assign Def, Atk, HP IVs | 235K | 285K (VBlank) | ... |
| 8- Generate SpD, SpA, Spe IVs | 236K ... | ... | ... |
Determining if a lead is slow or fast
There are 2 factors that determine if a lead is slow or fast:- Whether it's an egg
- Its PID
- The fastest possible modulo operation is 18 cycles when the lead PID is below 25.
- The slowest is 900 cycles (ex: for PID 59999995).
- In average, it takes 775 cycles.
- The total difference between the fastest and the slowest lead PID is ~71K cycles.
- The total difference between an egg and the slowest lead PID is ~100K cycles.
Lead PID Speed Calculator
Pokémon Wild Encounter (Complete version)
In reality, the wild encounter logic is more complex than the simplified version above, because most steps take a variable number of cycles. Fortunately, in most cases, the number of cycles taken by each step can be precalculated.| Step | Cycles | Type | Depends on |
|---|---|---|---|
| 1- Update audio & visual | 45K-65K | Unpredictable | Audio frame |
| 2- Miscellaneous updates | 5K | Precalculable | - |
| 3- Prepare wild encounter | 15K-115K | Controllable | Lead |
| 4- Generate valid PID | 1K-1000K | Precalculable | RNG state (# PID rerolls) |
| 5- Create Pokémon without IVs | 36K-125K | Precalculable | Generated Pokémon PID |
| 6- Generate Def, Atk, HP IVs | 1K | Precalculable | - |
| 7- Assign Def, Atk, HP IVs | 11K-43K | Precalculable | Generated Pokémon PID |
| 8- Generate SpD, SpA, Spe IVs | 1K | Precalculable | - |
| 9- Assign SpD, SpA, Spe IVs | Doesn't matter |
VBlank when generating a valid PID
A VBlank occurring during the step "4- Generate valid PID" would result in either Wild-3 or Wild-5. Those methods will be covered in the next article.Credits
- RainingChain for the article.
- mGBA team for providing the emulator for cycle research.
- pret team for providing the decompil projects.
- El Terapagos Mexicano for the Spanish translation.
- Chinese translation: Hakuhiro.