64 door hierarchy glitch

250px|right|The glitch in action
64 door hierarchy glitch exists in the original Super Nintendo Entertainment System versions of Final Fantasy IV (Final Fantasy II in North America).
There are two types of map/room changes in Final Fantasy IV: "Go" types and "Return" types. "Go" types save the player's location, and "Return" types go back to a saved location. Locations without a clear cut "Go" or "Return" purpose are "Go" types, whether coming or going. The player's "Room Level" is set to 0 on any world map. It increments every time one enters a room and decrements each time one exits something. The glitch can be performed in places where one can continually increment the Room Level, due to a transition between two maps being treated as a "Go" type in both directions, instead of a paired "Go" and "Return". The stairs to the Lali-Ho Pub in the Dwarven Castle are an example.
If the Room Level would increment from 63 to 64, it overflows and is reset to 0, despite the party not being outside on the world map. If the player then uses a "Return" method (by exiting a Return door, or using Warp), their Room Level will be set to -1, which causes glitches. By continuing to use "Return" methods, one can further decrease Room Level to negative integers of greater magnitude (-2, -3, -4, etc).
Whenever the Room Level is negative, the game is unable to go back to a saved location because it has never saved a location matching that Room Level; instead, it will determine the map and the party's location on it by accessing memory locations that are storing data intended for other things in the game, like the positions of vehicles, in-game time, gil and the order of spells in a caster's magic list. As a result, by doing seemingly innocuous things like moving the airship or changing the menu color, the player can choose what in-game locations to visit when reaching negative Room Levels. Combining this technique with the Sealed Cave glitch and other bugs, it is possible to bypass almost the entire game and access the ending within about half an hour after fighting Golbez in the Dwarven Castle.
==External links==
*Detailed write-up of the glitch, how to use it, what does what, and what to do where. (Japanese)
*The original (Japanese) video explaining the glitch.
*Explanation of the glitch in English at letsplayforum.net (archived)
Category:Bugs in Final Fantasy IV