Glitch City Laboratories Forums

Lab γ: Video Games and Glitches Discussion => Pokémon Glitch Discussion => Generation I Glitch Discussion => Topic started by: bbbbbbbbba on February 21, 2019, 10:28:16 pm

Title: Underlying glitch for "NPC and Cable Club lady glitch"
Post by: bbbbbbbbba on February 21, 2019, 10:28:16 pm
Today I was scanning through the Generation I natural glitches list when I realized something fishy about this one. The attached GIF begins at the exact point the NPC starts to move, not a moment earlier. Then I opened the YouTube video and saw that the glitch was reproduced from a specific save file.

After some failed attempts to reproduce this glitch, I realized that this glitch may only work from a save file.

From here it's easy to guess what really happened. The game was saved exactly at the frame when the walking NPC was ready to move, but hadn't decided in which direction yet. When the save file is loaded, both NPCs are loaded, but they are not correctly marked as visible. Since the walking NPC is updated first, if it decides to move up, the collision check isn't going to stop it.

I then found a way to semi-reliably reproduce this in an emulator. With the two NPCs adjacent to each other, begin frame advancing, watching the RAM address $C2x8 ("time until next step") of the walking NPC. When it becomes 0x01, begin holding Start. There is a one-frame delay for the Start menu, so when it pops up, the countdown will go to 0x00 exactly. Saving from this Start menu gives a save file from where this glitch may happen.

Of course, this doesn't only work in the Cerulean Pokémon Center, but in almost any place where two NPCs may go to the same square, and the NPC with lower ID (i.e. that is updated first) can walk. See attachment for an example in Pallet Town.

There is one more small question to ask. Why are the NPCs marked as invisible in the save file? Of course, because they are hidden by the Start menu. At this point I realized that it may not be necessary to have a save file after all. Sure enough, further testing showed that the glitch can also be triggered simply by bringing up the Start menu at the same exact frame to hide the NPCs, and then just closing it.

Presumably, if the "stationary" NPC is not hidden when the game is saved, then this glitch won't work. And this glitch may work in other situations where multiple NPCs are loaded at the same time; I haven't checked yet.


If everyone agrees that this is the same glitch as the current "NPC and Cable Club lady glitch", I'll probably edit the wiki and rename the page in a few days. Of course, if someone else would help me do it, I will be thankful. Further research is also welcome.
Title: Re: Underlying glitch for "NPC and Cable Club lady glitch"
Post by: Evie the Mother Hen ☽ ❤ on February 22, 2019, 06:05:19 am
Wow, great research!

Yeah, this was one of those glitches that was reported by a friend of mine, but I knew nothing about. It's likely then it is the C2x8/Start menu/save glitch you describe. It may be good then to move it to a title such as "NPC walk through people glitch" or similar.

Edit: Please see https://glitchcity.info/wiki/NPC_collision_bypassing_glitches
Title: Re: Underlying glitch for "NPC and Cable Club lady glitch"
Post by: bbbbbbbbba on February 22, 2019, 11:16:19 am
Thanks!

I have edited a little to make the article clearer, and also included some new research about using the PC interface. It may also work with other text boxed, but they are harder to control.

Also, is there a page for the known glitch that NPCs get stuck when they walk upwards too far? (See: https://github.com/pret/pokered/blob/6ba3765c5932996f5da6417ae703794ff10bb1cb/engine/overworld/movement.asm#L644 (https://github.com/pret/pokered/blob/6ba3765c5932996f5da6417ae703794ff10bb1cb/engine/overworld/movement.asm#L644)) This explains why the Cerulean Pokémon Center NPC would be completely stuck behind the Cable Club lady, instead of being able to walk left and right. The place he is stuck at is 4 steps above his initial position, which means that he would only be able to walk up or down, not left or right. (At 5 steps above the initial position, NPCs would only be able to walk up, not in any other direction, until they are completely stuck at 8 steps above the initial position.)
Title: Re: Underlying glitch for "NPC and Cable Club lady glitch"
Post by: Evie the Mother Hen ☽ ❤ on February 22, 2019, 11:25:01 am
Thanks!

I have edited a little to make the article clearer, and also included some new research about using the PC interface. It may also work with other text boxed, but they are harder to control.

Also, is there a page for the known glitch that NPCs get stuck when they walk upwards too far? (See: https://github.com/pret/pokered/blob/6ba3765c5932996f5da6417ae703794ff10bb1cb/engine/overworld/movement.asm#L644 (https://github.com/pret/pokered/blob/6ba3765c5932996f5da6417ae703794ff10bb1cb/engine/overworld/movement.asm#L644)) This explains why the Cerulean Pokémon Center NPC would be completely stuck behind the Cable Club lady, instead of being able to walk left and right. The place he is stuck at is 4 steps above his initial position, which means that he would only be able to walk up or down, not left or right. (At 5 steps above the initial position, NPCs would only be able to walk up, not in any other direction, until they are completely stuck at 8 steps above the initial position.)

You're welcome! :) Thank you!

Ah, I think I remember Crystal_ making a video about NPC movements (https://www.youtube.com/watch?v=9E1nAHmd380). I don't think there is a page, feel free to add one. ^^