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

Underlying glitch for "NPC and Cable Club lady glitch" - Page 1

Underlying glitch for "NPC and Cable Club lady glitch"

Posted by: bbbbbbbbba
Date: 2019-02-21 22:28:16
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.

Re: Underlying glitch for "NPC and Cable Club lady glitch"

Posted by: Torchickens
Date: 2019-02-22 06:05:19
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

Re: Underlying glitch for "NPC and Cable Club lady glitch"

Posted by: bbbbbbbbba
Date: 2019-02-22 11:16:19
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) 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.)

Re: Underlying glitch for "NPC and Cable Club lady glitch"

Posted by: Torchickens
Date: 2019-02-22 11:25:01

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) 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. I don't think there is a page, feel free to add one. ^^