Tile behaviour

From ZeldaHacking Wiki
Jump to: navigation, search

The behaviour of tiles is difficult to edit. LynnaLab can edit their basic solidity, but beyond that, their behaviour is hardcoded, or spread across dozens of different tables in the rom. This page will attempt to list those locations.

See the tile behaviour list if you just want to see the "end result".

Background information

There are 6 "collision modes". Each area is assigned a collision mode. Most of the tables related to tile behaviour are divided up for each collision mode, so certain tiles can behave differently depending on the context.

Index Description
0 Overworld
1 Indoors
2 Dungeons
3 Sidescrolling
4 Underwater
5 ?

Basic solidity

Each tile in an area has a byte associated with it, which is typically between $00-$0f. This byte is editable in LynnaLab, but not in ZOLE.

$00 means no solidity, $0f means full solidity, and values in-between will set each quarter of the tile's solidity separately.

Values between $10-$1f have special behaviour associated with them. See constants/specialCollisionValues.s.

Tables in the code

Name Ages address Description
tileUpdateRoomFlagsOnBreakTable 00:1184 List of tiles that have some effect on the room flags when broken (ie. remembering a bombable wall is opened).
hazardCollisionTable 00:2408 Lists which tiles count as holes, water, and lava. (This applies to most objects, but not to Link himself...)
warpTileTable 01:6238 List of tiles that cause warps to occur when touched.
invalidTimewarpTileList 01:6317 List of tiles which, despite being traversable normally, can't be timewarped onto. (Includes holes, whirlpools, and deep water (conditionally)).
enemyUnspawnableTilesTable 02:791f Lists tiles that enemies can't spawn onto. (Solid tiles are automatically exempt, so are not listed here.)
facingDirAfterWarpTable 05:4a88 Sets Link's facing direction to particular values when a screen transition puts him on a particular tile (ie. stairs).
@doorTiles 05:4de7 Part of a bugged function which doesn't do anything, but which is supposed to center Link on door tiles after warping through time.
landableTileFromCliffExceptions 05:61bf The tiles listed here (raisable floors) can be landed on when jumping down a cliff, even if they're solid.
tileTypesTable 05:7c6e Specifies behaviours such as holes, water, lava, currents, conveyors, ice, etc. See data/tileTypeMappings.s.
cliffTilesTable 05:7d09 Lists the tile indices that count as cliffs that Link can jump off of, as well as the angle required for that to happen.
interactableTilesTable 06:43b2 Deals with things that should happen when Link is touching the tile; open a keydoor, push a block, spawn a ghini, open a chest, etc.
breakableTileCollisionTable 06:7818 List of tiles that can be broken, along with an index for "breakableTileModes".
breakableTileModes 06:78dd Each index in "breakableTileCollisionTable" refers to an index here; this specifies in what ways it can be broken, what kind of animation to play, and more.

See also constants/breakableTileSources.s.

itemPassableCliffTilesTable 07:4c50 List of cliff tiles that items can pass through from particular directions. Passing through these tiles will increase or decrease their "elevation level". The elevation level allows projectiles to pass both ways through cliff tiles, if they're high enough.
itemPassableTilesTable 07:4cc9 List of tiles that items can always pass through, regardless of elevation level.
itemConveyorTilesTable 07:4c3b Lists conveyor tiles along with what directions they should push items in. (Only applies to item objects.)
seedDontBounceTilesTable 07:5134 List of tiles which seeds from the seed shooter don't bounce off of. Prevents ember seeds from bouncing off torches, bushes.
pushableTilePropertiesTable 08:452d Defines what should go underneath a pushable block, and what the block should turn into when pushed (possibly a different tile that looks the same but is not pushable).

Each block here should have a corresponding entry in "interactableTilesTable".

Fully hardcoded behaviours

Tile index Tile name Comments
$6e MYSTICAL_TREE_TL Game searches for this tile to place seed objects on
$d4-$d6 VINE_TOP/MIDDLE/BOTTOM Animal companions can't pass through these, but Ricky can hop up and down them like cliffs.
$db SWITCH_DIAMOND Hardcoded to not break on using the switch hook
$f3 HOLE
$fc DEEP_WATER Game checks this tile value to allow diving to underwater areas

In dungeons

Tile index Tile name Comments
$40-$47 Tiles $40-$43 correspond to staircase tiles $44-$47; they are automatically replaced when bit 7 of the room flags are set.

See also

constants/tileIndices.s (use these values to seach for hardcoded behaviour in main.s)