EarthBound/Map Data/Tile Arrangement Collision Data

From Data Crystal
Jump to navigation Jump to search

This is a sub-page of EarthBound/Map Data.

Map Data: Tile Arrangement Collision Data
Game EarthBound
Start Address 0x180200
End Address 0x18914F
# of Entries 2293
Entry Length 16 bytes (0x10)
Total Length 36688 bytes (0x8F50)
Back to the ROM map

Data block storing collision data and other player/NPC interaction data for map tile arrangements. Collision data for all tilesets is stored together, each entry reusable within and between tilesets. Data is referenced by the Tileset Tile Arrangement Collision Pointer Tables.

Format

Each entry contains 16 tile subentries, each 1 byte. The 16 subentries collectively represent data for a 4x4 grid of background tiles (same as map tile arrangements) with each row in left-to-right order, followed by the next row, etc. Thus, within an entry, the collision data for a tile at a given 0-3/0-3 x/y coordinate can be found using the formula subentry_offset = x + y * 4.

Tile Subentry Format

Each 1-byte subentry is a bitmap of flags that apply to the associated map tile.

S00MWDAB

  • S (bit 10000000): Tile is solid and blocks normal movement.
  • 00 (bits 01100000): Unused bits. Always zero in an unmodified ROM and no known effect.
  • M (bit 00010000): Tile contains a special map object (door/stairway/ladder/etc). Earthbound will only look for such objects on tiles with this flag set.
  • W (bit 00001000): Water tile. Players/NPCs moving through the tile will have their appearance, speed, and sound modified accordingly.
  • D (bit 00000100): Damaging tile. Players will be susceptible to heatstroke status effects while standing on this tile. Alternately, if combined with flag W (bit 00001000), designates a deep-water tile where the whole player/NPC will be submerged and take damage.
  • A (bit 00000010): Upper sprite priority drop. If a player/NPC is positioned on this tile, sprites from the upper half of the entity will have lowered priority and be rendered behind any map foreground tiles (see Tileset Character Data). Typically combined with flag B (bit 00000001) to designate that a player/NPC standing on the tile will be entirely behind and hidden or obscured by some map object rendered in front, e.g. a building or a tree.

    Alternately, if combined with flag S (bit 10000000), designates that players can interact with NPCs on the other side of the tile. Used to implement tables, desks, etc.

  • B (bit 00000001): Lower sprite priority drop. If a player/NPC is positioned on this tile, sprites from the lower half of the entity will have lowered priority and be rendered behind any map foreground tiles (see Tileset Character Data). If not combined with flag A (bit 00000010), can be used to create advanced layering effects where a player/NPC appears behind one map object but in front of another.

See Coilsnake Wiki for explanations of the most common flag combinations.