Underlying glitch for "NPC and Cable Club lady glitch"
Posted by: bbbbbbbbba
Date: 2019-02-21 22:28:16
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.