Jump to content

Out of bounds: Difference between revisions

→‎In Generation I: Massive cleanup.
>Bbbbbbbbba
m ("An area" with no context is ambiguous...)
>Bbbbbbbbba
(→‎In Generation I: Massive cleanup.)
Line 2:
 
==In [[bp:Generation I|Generation I]]==
In [[bp:Generation I|Generation I]], the player's coordinate on the map is represented by two bytes, the X coordinate (horizontal position; east is larger; $D362 in R/B, or $D361 in Yellow) and the Y coordinate (vertical position; south is larger; $D361 in R/B, or $D360 in Yellow). Therefore, the entire "map space" available to the player in theory is a 256*256 square.
Going out of bounds is possible with a [[walk through walls]] glitch or cheat, the [[dokokashira door glitch]] or [[Super Glitch]] via tile corruption, or [[arbitrary code execution]].
 
Since byte operations overflow and underflow normally, the left side and right side are "connected together", and so is the top side and the bottom side, although the player cannot directly step through the boundary without triggering a (possibly invalid) map connection.
In [[bp:Generation I|Generation I]], every map has a boundary for each connection. These include x position (memory address D362 or D361 in Yellow) boundaries that are one tile wide and infinitely tall, and y position (memory address D361 or D360 in Yellow) boundaries that are one tile tall and infinitely wide. The y position increases for more southerly values, unlike other conventions.
 
===Accessing out of bound areas===
Note that these x and y positions are not absolute for the whole game world. Rather, they are specific to an individual map, and when the player enters a new map connection or warp they will be updated.
 
If the player tries to directly step out of bounds by [[walking through walls]], the game will try to load the connecting map when the player goes onto a tile with:
If there is no valid connection and the game tries to load it, the game will place the player in map 255 (hex:FF) when they step on a boundary (known as a 'freeze tile'), and a freeze may happen (or Glitch Hell on emulators running Japanese Red, Green and v1.0 of Yellow).
* X = -1 (0xFF);
* X = map width;
* Y = -1 (0xFF);
* Y = map height.
 
This happens even if there isn't a connecting map in the corresponding direction. In this case the game will try to load map 255 (0xFF), which usually causes a freeze. Therefore, the tiles on those four boundaries are known as "freeze tiles". Since all the conditions are equality checks, the freeze tiles only form a one-tile thick barrier, but it still stops the player from directly stepping out of bounds.
It is possible to appear past the boundary if the player's x position or y position is one tile greater than (for east connections and south connections) or one tile less than (for west connections and north connections) the freeze tile.
 
'''However, it is possible to indirectly use a walk through walls glitch or cheat to go out of bounds, by using valid map connections.''' Since connecting maps may have different sizes, and may align at different coordinates, what is in bound (but not supposed to be accessible) for one map may become out of bound for the connecting map after making the necessary coordinate adjustments.
This is possible through the [[Celadon looping map trick]] (requiring a [[walk through walls]] glitch or cheat), arbitrary code execution or through a [[Glitch City (Red/Blue/Yellow)|Glitch City]], because Glitch Cities can put the player in a place with invalid coordinates.
 
(Instead of walking through walls, the player can also use a tile corruption glitch to remove the "wall" tiles, for example with [[dokokashira door glitch]] or [[Super Glitch]]. Or they can take a wrong warp to a normally inaccessible area, etc.) <!-- Is it possible to take a wrong warp directly to an OOB area (without ACE)? -->
If the player goes beyond an x boundary, the map will loop until x equals the west or east boundary after which the connection will be loaded, and if it was invalid a freeze or Glitch Hell (Japanese Red/Green/Yellow running on emulators) will occur. The 'copies' of the maps are called [[Phantom City|Phantom Cities]], as warps and signs do not work there, and people cannot be found there.
 
Another way to go out of bounds is to '''directly change the player's coordinate''', for example with an [[expanded items pack]], through a [[Glitch City (Red/Blue/Yellow)|Glitch City]], or using [[arbitrary code execution]].
If the player goes beyond a y boundary, they will encounter an [[Glitch City (Red, Blue, Yellow)#Out of bounds Glitch City|out of bounds Glitch City]] for a very high (very southerly) y position, and the same effects described above will happen for entering a north or south boundary.
 
===Properties===
If the boundary was invalid, the game will freeze (or Glitch Hell may appear in Japanese Pokémon Red, Green and Yellow running on emulators). If the boundary was valid, the relevant location will be loaded (e.g. FF in Route 3 loads Pewter City) and the coordinates will be updated.
The map connection tiles or "freeze tiles" divide the entire map space into four quadrants (those names are coined by TheZZAZZGlitch):
* Mainland quadrant (in bound);
* [[Phantom City|Phantom quadrant]] (X coordinate out of bound);
* [[Out of bounds Glitch City (Generation I)|Glitch city quadrant]] (Y coordinate out of bound);
* Phantom glitch city quadrant (both X and Y out of bound).
Note that stepping from the "wrong" side onto a map connection tile still triggers the map connection or freeze. Below, we will use the word "go" liberally even though stepping over the boundary doesn't work.
 
Going east into the ''phantom quadrant'', the map seems to "loop" horizontally, with each copy of the map shifted upwards by two tiles until (for small enough maps) it completely disappears. Those copies are called [[Phantom City|Phantom Cities]], as warps and signs do not work there, and people cannot be found there. The player can step over the boundary between the Phantom Cities without problem, because the actual X coordinates of those boundaries are different from the real boundaries. (Since the map space itself also "loops", the out of bound area "west of" the mainland is just the eastmost part of this quadrant.)
 
Going south into the ''glitch city quadrant'', at first there will be nothing but the "background tile" for the current map. Then the player will encounter an [[Out of bounds Glitch City (Generation I)|out of bounds Glitch City]] for a very high (very southerly) y position. (Going to the area "north of" the mainland directly puts the player into the out of bounds Glitch City.)
 
The ''phantom glitch city quadrant'' works similarly to the phantom quadrant: It contains copies of the "main" out of bounds Glitch City, shifted upwards by two tiles each time.
 
====Technical Explanations====
The properties of the base map in out of bound areas is related to the "tile block map". To save on space, the map data in the ROM is actually not stored as tiles, but as "tile blocks", which are 2*2 block of tiles. Each tile block is represented by a single byte, which are translated into tiles only when they are displayed on screen. The translation rules depend on the current tileset.
 
The tile block map must be loaded into the RAM, because it may be changed by the player cutting down trees. Furthermore, there is a 3 block "padding" in each direction, so that the player doesn't see invalid data when they stand near the boundary of the in bound area. If the there are any map connections, the "preview" of connecting maps are also loaded into the tile block map. Therefore, each row in the tile block map consists of (w/2 + 6) bytes, where w is the width of the map in tiles.
 
Since the rows are stored consecutively in the tile block buffer, this means going east (w/2 + 6) blocks is equivalent to going south one block, as far as the tile block map is concerned. Therefore going east that far gives the player a Phantom City, shifted by two tiles. The Phantom City has no warps, signs, or NPCs, because their positions are recorded as coordinates, and have nothing to do with the tile block map.
 
When the player goes beyond the south boundary of the mainland or a Phantom City, they will first go into the unused part of the 1300-byte tile block map, which is filled by the "background tile". After a while (the exact distance depends on the width of the map), the player goes beyond the tile map buffer and into other areas of the RAM, which undergo the block to tile translation, and display as a Glitch City.
 
{{YouTube|xuEsiyyYwVk|TheZZAZZGlitch}}
 
===Out of bounds Glitch Hell===
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.