You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/2024-10-02-Pokemon-Glitches.md
+40-21Lines changed: 40 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@ The following commands are a huge help when we want to debug our actions, pause
76
76
77
77
## Pokemon Yellow
78
78
79
-
In the game you start with one Pokemon, a `Pikachu` at level 2, given by Professor Oak. You also get some $$ from your mother, you should keep it safe because we will need 550$ to buy an `Escape Rope` for one of the glitches below.
79
+
In the game you start with one Pokemon, a `PIKACHU` at level 2, given by Professor Oak. You also get some $$ from your mother, you should keep it safe because we will need 550$ to buy an `Escape Rope` for one of the glitches below.
80
80
81
81
82
82
## Long Range Trainer Glitch
@@ -135,16 +135,16 @@ Now we want to modify another value in memory located at `$CD2D` which correspon
135
135
136
136
At this point in the game you can either go in the grass to find a wild pokemon, but we won't know its SPECIAL stat (unless you print the content of the address in your debugger `ex $CD2D`). Doing the glitch that way will be tedious, and will force us to restart the device every time the value is not the one we want... Or we can initiate a battle against a trainer, they have a fixed pokemon, meaning they always have the same stats.
137
137
138
-
Let's do it with the first trainer in the GYM, he has a Digglet with a special stat of 14 (`0x0e`). This value will have a direct impact on the next pokemon we will encounter.
138
+
Let's do it with the first trainer in the GYM, he has a `DIGGLET` with a special stat of 14 (`0x0e`). This value will have a direct impact on the next pokemon we will encounter (spoiler alert: it will be a `GENGAR`).
139
139
140
140

141
141
142
-
For Pokemon Red and Blue, there is a map of trainers and the next pokemon you will get. Small warning, the map is huge, [map by ryumaster](https://puu.sh/257S). You will quickly realize that the pokemons are not ordered using the Pokedex ID, for example: Rydhon is the first one, so if you want a specific pokemon you will need the following list:
142
+
For Pokemon Red and Blue, there is a map of trainers and the next pokemon you will get. Small warning, the map is huge, [map by ryumaster](https://puu.sh/257S). You will quickly realize that the pokemons are not ordered using the Pokedex ID, for example: RYDHON is the first one, so if you want a specific pokemon you will need the following list:
143
143
144
144
*[List of Pokémon by index number in Generation I - Bulbagarden](https://bulbapedia.bulbagarden.net/wiki/List_of_Pokémon_by_index_number_(Generation_I))
But why is the SPECIAL stat impacting the ID of the next Pokemon ? It lies within the `UNION` and `NEXTU` keywords used in the `raù/wram.asm` file to define how the memory is structured.
147
+
But why is the SPECIAL stat impacting the ID of the next Pokemon ? It lies within the `UNION` and `NEXTU` keywords used in the `ram/wram.asm` file to define how the memory is structured.
148
148
149
149
***UNION** is a directive that allows you to overlay multiple structures or data definitions in the same memory space.
150
150
***NEXTU** is used to move to the next structure or field within the same union space
@@ -165,7 +165,7 @@ wEngagedTrainerSet = 6
165
165
166
166
But this is also used for wild Pokemon, the first variable is used to define the **ID**, and the second is the **LEVEL**.
167
167
168
-
For example, the following data is a Gengar level 35.
168
+
For example, the following data is a GENGAR level 35.
169
169
170
170
{% highlight powershell%}
171
171
wEngagedTrainerClass = 14 (0xe)
@@ -190,18 +190,33 @@ In short we can alter the level from a range of 1 to 13. It can be done using th
190
190
* Range from 7 to 1 for down modifier (ATK ⬇️, DEF ⬇️, SPEED ⬇️)
191
191
* Range from 7 to 13 for up modifier (ATK ⬆️, DEF ⬆️, SPEED ⬆️)
192
192
193
+
194
+
Here is a quick example of downgrading the ATK modifier to 1 using the `Growl` ability several times .
Now the memory should look like this, after battling a wild pokemon anywhere between Pewter Gym and the Viridian Forest.
200
+
201
+
{% highlight powershell%}
202
+
wEngagedTrainerClass = 14 (0xe)
203
+
wEngagedTrainerSet = 1
204
+
# Gengar LVL1
205
+
{% endhighlight %}
206
+
207
+
193
208
Quick note: The level can't go below 1 with this technique.
194
209
195
210

196
211
197
212
198
213
## Start Battle & Weird Textbox
199
214
200
-
Now it's time to trigger this battle with our Gengar. Going into the grass and getting attacked by wild Pokemon is not the correct way as it will update the fields `EnemyMonUnmodifiedSpecial` and `MonEnemyAttackMod` in the memory.
215
+
Now it's time to trigger this battle with our GENGAR since we have tailored the memory to be the Pokemon #14 at the level 1. Going into the grass and getting attacked by wild Pokemon is not the correct way as it will update the fields `EnemyMonUnmodifiedSpecial` and `MonEnemyAttackMod` in the memory.
201
216
202
-
Actually it is way easier than that, when we escaped the battle using the « `Escape Rope` », we put the meta-map script ID into an inconsistent state.
217
+
Actually it is way easier than that, when we escaped the battle using the « `Escape Rope` », we put the meta-map script ID into an inconsistent state.`Meta-map scripts` are also called `GameProgressFlags`, its a list of events used to execute code on the current maps, for example, on the first map you can't walk into the grass until you advance further into the story, it is disabled later by changing the ID of the meta-map script.
203
218
204
-
By default the map searches for trainers: `CheckFightingMapTrainers` (0), but we left it with `DisplayEnemyTrainerTextAndStartBattle` (1) when the « ! » mark appeared.
219
+
By default the map of the Viridian forest searches for trainers: `CheckFightingMapTrainers` (0), but we left it with `DisplayEnemyTrainerTextAndStartBattle` (1) when the « `!` » mark appeared before we "escape".
@@ -213,9 +228,9 @@ The textbox you get before the battle is the same ID as the last text box in mem
213
228
214
229
Depending on which choice you made to generate the next pokemon, it will have one of these values.
215
230
216
-
* ID: 09: Talk to sign at the PokeCenter
217
-
* ID: 02: GYM Trainer talk
218
-
* ID: 05: NPC from Pewter City
231
+
***ID: 09**: Talk to sign at the PokeCenter
232
+
***ID: 02**: GYM Trainer talk
233
+
***ID: 05**: NPC from Pewter City
219
234
220
235

221
236
@@ -228,13 +243,13 @@ Capturing the Pokemon is left as an exercise for the reader. Even if it is a lev
228
243
229
244
## Experience Underflow
230
245
231
-
Now we are done with memory manipulations, we have captured our Gengar. Let's talk a bit about **Experience Algorithms**.
246
+
Now we are done with memory manipulations, we have captured our GENGAR. Let's talk a bit about **Experience Algorithms**.
232
247
233
248
In Pokemon Red, Blue and Yellow, there are 6 experience algorithms but only 4 are really used in the code: `Medium Fast`, `Medium Slow`, `Fast` and `Slow`.
In short, if your level 1 Pokemon gains less than 54 XP, its current level will be computed from its previous XP, getting level 100 in one battle !
263
+
In short, if your level 1 Pokemon gains less than 54 XP, its current level will be computed from its previous XP. Do you recall how much it was ? Our pokemon had over 16 777 162 XP, getting level 100 in one battle !
249
264
250
265

251
266

252
267
268
+
**Pro tip**: Don't fight with your level 1 Pokemon, it is mostly likely not strong enough (unless its a METAPOD, they don't do damage).
269
+
253
270
254
-
## BONUS 1 - Mew
271
+
## BONUS 1 - MEW
255
272
256
-
These glitches can be used later in the game to get the event exclusive `Mew`. It's basically using the Long Range Trainer glitch to escape the fight on the **Route 24**, then you engage in a battle with the Kid **Route 25** to have the Slowpoke stats in memory.
273
+
These glitches can be used later in the game to get the event exclusive `MEW`. It's basically using the Long Range Trainer glitch to escape the fight on the **Route 24**, then you engage in a battle with the Kid **Route 25** to have the Slowpoke stats in memory.
257
274
258
275

259
276
@@ -265,23 +282,25 @@ Earlier in this blog, we discovered that Trainer and Pokemon are the same thing.
265
282
*`Special stat < 200` triggers a Pokemon battle
266
283
*`Special stat >= 200` triggers a Trainer battle
267
284
268
-
However you won't find many Pokemon with a special stat over 200. But there is a way to remediate to this problem. The Pokemon `Ditto` have the `Transform` ability which will copy itself into your Pokemon, it will also copy the stats.
285
+
However you won't find many Pokemon with a special stat over 200. But there is a way to remediate to this problem. The Pokemon `DITTO` have the `Transform` ability which will copy itself into your Pokemon, it will also copy the stats.
269
286
270
-
Did you know that Prof Oak is not available in the game story, but he is coded and can be battled using a combination of the previous glitches. His index number is **226**, which is also the default value of Mewtwo SPECIAL stat.
287
+
Did you know that Prof Oak is not available in the game story, but he is coded and can be battled using a combination of the previous glitches. His index number is **226**, which is also the default value of MEWTWO SPECIAL stat.
271
288
272
289
This glitch requires 2 long range trainer because you won’t have the NPC from Pewter City to reset the « NPC is moving » value. Also you need a Pokemon with Growl to set one of the 3 teams attributed to him.
273
290
274
291
Here are the steps to battle him:
275
292
276
293
* Fly to **Lavender City**, go to Route 8, trigger the Long Range Trainer
277
294
* Fly to **Cerualean City**, go to Route 24, trigger the second Long Range Trainer, but you have to defeat him, to reset the « `NPC is moving` » value
278
-
* Fly to **Cinnabar Island**, and go to the Pokemon Mansion and find a `Ditto` (you have to go to a specific room)
279
-
* Wait for `Ditto` to copy your Pokemon with SPECIAL at 226
280
-
* Then switch to a Pokemon knowing `Growl`, use it 4 times (Blastoise), 5 times (Venusaur), 6 times (Charizard)
295
+
* Fly to **Cinnabar Island**, and go to the Pokemon Mansion and find a `DITTO` (you have to go to a specific room)
296
+
* Wait for `DITTO` to copy your Pokemon with SPECIAL at 226
297
+
* Then switch to a Pokemon knowing `Growl`, use it 4 times (BLASTOISE), 5 times (VENUSAUR), 6 times (CHARIZARD)
281
298
* Then run away from the battle, use an `Escape Rope`, then fly back **Lavender City**, go to Route 8 to trigger the battle with `Prof Oak`.
I hope you liked these glitches, here are some saves to have every requirements met in order to reproduce them. Some saves are from a finished run where the long trainers have been re-enabled, use them to get Mew or fight Prof Oak.
0 commit comments