Glitch City Laboratories Archives

Glitch City Laboratories closed on 1 September 2020 (announcement). This is an archived copy of a thread from Glitch City Laboratories Forums.

You can join Glitch City Research Institute to ask questions or discuss current developments.

You may also download the archive of this forum in .tar.gz, .sql.gz, or .sqlite.gz formats.

Generation I Glitch Discussion

Interesting glitch Trainer AIs in Generation I - Page 1

Interesting glitch Trainer AIs in Generation I

Posted by: Torchickens
Date: 2018-08-24 16:42:32
Some interesting glitch Trainer AIs. :) No pictures at the moment sorry, but may add them later.

Unfortunate most of these require Game Genie so far, but perhaps you can access them with ACE, maybe even RAM address D031 (which can be used to partially modify the Trainer).

Not sure whether the AIs here can be matched to a D031 value, does anyone know?

Red/Blue:

https://glitchcity.info/wiki/TrainerDex/RB:113 - on opponent's turn brings up an adjustable cursor
Various, e.g. https://glitchcity.info/wiki/TrainerDex/RB:112 - restarts a battle
https://glitchcity.info/wiki/TrainerDex/RB:094 - X Defend or glitch text box
https://glitchcity.info/wiki/TrainerDex/RB:092 - Super Potion use every turn
https://glitchcity.info/wiki/TrainerDex/RB:088 - At DA80 I still have offgao's memory editor on my Red cartridge. This executed it, but I wasn't able to replicate the effect afterwards. There is ACE potential here!
https://glitchcity.info/wiki/TrainerDex/RB:054 - Prints tiles, available with Trainer escape glitch w/ Special stat of 254
https://glitchcity.info/wiki/TrainerDex/RB:052 - ACE (as discovered by TheZZAZZGlitch, and I've confirmed it on my save too as it brought up the offgao editor), but there may be an error in the current documentation as when I changed $FA60 to $C9 it didn't work; unless the stack is corrupted or something.  Available with Trainer escape glitch, Special stat of 252 needed.

Re: Interesting glitch Trainer AIs in Generation I

Posted by: GlitchedPokemonStudent
Date: 2018-08-26 14:50:12
Wow, Trainers outside the $C8-$FF range exist?

Re: Interesting glitch Trainer AIs in Generation I

Posted by: Torchickens
Date: 2018-08-26 15:49:02

Wow, Trainers outside the $C8-$FF range exist?


That's right! However generally it would seem you need to have to make a custom routine to get them. The game subtracts 200 (in decimal) from the ID, so $C8-$FF are actually trainers $00-$37, and the rest are usually impossible to see.

I looked into this a while ago and asked Wack0 about it, he said to modify a routine in the ROM to bypass the process and this is how I got the Game Genie codes XXF-549-C49 and 3EF-539-B31 (because Game Genie unlike GameShark creates temporary ROM patches basically), where XX is the actual ID (so $38-$FF) are the 'impossible' ones.

I never created an 8F setup to do it though so may come back to that eventually.

I wonder now though, what would happen if you used 010257D0, changed D031 and used glitch item 9F (hex:5E) to restart the battle.
Edit: Tried it. It seems the battle restart effect is due to D059 being a non-00 value, basically it ejects you into the overworld and the instant encounter happens again, but this Trainer Rhydon (D059=01) I'm encountering is interesting, it has no name and has an 'M (FF).

Re: Interesting glitch Trainer AIs in Generation I

Posted by: Guy
Date: 2018-08-29 13:42:32
Do trainer AIs each correspond to a trainer class, like the one here, or are they unrelated arrays?

Re: Interesting glitch Trainer AIs in Generation I

Posted by: Torchickens
Date: 2018-08-29 14:10:50

Do trainer AIs each correspond to a trainer class, like the one here, or are they unrelated arrays?


When I tested an artificial Trainer class, it had the matching D031 value (e.g. Trainer class 0x38 from the Game Genie code and D031 value 0x38). You can change D031 to another Trainer class (e.g. 0x15) and afterwards they take that Trainer's AI (Juggler in example's case). So it appears each Trainer class indeed correspond with their own AIs. I haven't fully tested whether it moves both the basic AI pointer and the move modification pointers though.

Re: Interesting glitch Trainer AIs in Generation I

Posted by: Guy
Date: 2018-08-29 14:28:45
Thanks, that makes sense.

Re: Interesting glitch Trainer AIs in Generation I

Posted by: Torchickens
Date: 2018-08-29 16:31:48

Thanks, that makes sense.


You're welcome! :)

Re: Interesting glitch Trainer AIs in Generation I

Posted by: Kelvinv
Date: 2018-08-30 06:51:17
Is that Move Modification address also responsible for the fact that one of Lance's pokémon  is has a move that isn't legal for that Pokémon? or is something else responsible for that?

Re: Interesting glitch Trainer AIs in Generation I

Posted by: Torchickens
Date: 2018-08-30 09:21:38

Is that Move Modification address also responsible for the fact that one of Lance's pokémon  is has a move that isn't legal for that Pokémon? or is something else responsible for that?


Something else. The name is a little confusing in that respect, and how I understand it, move modifications are just like choices of which moves to use (so "do I use my existing Gust or Whirlwind?" etc.) but as these are just regular subroutines, glitch ones can execute unrelated code.

The special moves are determined by wLoneAttackNo (D05C), which also enables the Gym Leader music, not sure if this covers all lone attacks but at least some of them. The game assigns one (not sure if it can assign more) moves the enemy Pokémon can use in addition to the default ones, with the value determined by what's in D05C.