Tile behaviour

From ZeldaHacking Wiki
Jump to navigation Jump to search

LynnaLab is capable of editing the basic solidity of tiles, but is incapable of editing tile properties beyond that. You will need to edit the data manually to change these.

This data is mostly located in data/{game}/tile_properties/(ages/seasons).

Background information

There are 6 "collision modes". Each tileset is assigned a collision mode. Most of the tables related to tile behaviour are divided up for each collision mode, meaning that tile properties (aside from solidity) change depending on the collision mode.

Ages:

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

Seasons:

Index Description
0 Overworld
1 Subrosia
2 Maku Tree
3 Indoors
4 Dungeons
5 Sidescrolling

Basic solidity

Each tile in a tileset 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/common/specialCollisionValues.s.

Value $ff is reserved as a "screen boundary" value. The rows and columns just outside the screen boundary are set to this value.

Tables in tile_properties folder

Name Description
tileUpdateRoomFlagsOnBreakTable List of tiles that have some effect on the room flags when broken (ie. remembering a bombable wall is opened).
hazardCollisionTable Lists which tiles count as holes, water, and lava. (This applies to most objects, but not to Link himself...)
warpTileTable List of tiles that cause warps to occur when touched.
invalidTimewarpTileList List of tiles which, despite being traversable normally, can't be timewarped onto. (Includes holes, whirlpools, and deep water (conditionally)).
enemyUnspawnableTilesTable Lists tiles that enemies can't spawn onto. (Solid tiles are automatically exempt, so are not listed here.)
facingDirAfterWarpTable Sets Link's facing direction to particular values when a screen transition puts him on a particular tile (ie. stairs).
landableTileFromCliffExceptions The tiles listed here (raisable floors) can be landed on when jumping down a cliff, even if they're solid.
tileTypesTable Specifies behaviours such as holes, water, lava, currents, conveyors, ice, etc. See data/tileTypeMappings.s.
cliffTilesTable 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 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.
magnetTilesTable Lists the tiles which can be latched on with the magnet gloves. (Seasons only.)
breakableTileCollisionTable List of tiles that can be broken, along with an index for "breakableTileModes".
breakableTileModes 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 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 List of tiles that items can always pass through, regardless of elevation level.
itemConveyorTilesTable Lists conveyor tiles along with what directions they should push items in. Only applies to item objects.
seedDontBounceTilesTable List of tiles which seeds from the seed shooter don't bounce off of. Prevents ember seeds from bouncing off torches, bushes.
pushableTilePropertiesTable 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".

enemyConveyorTilesTable Lists conveyor tiles along with what directions they should push enemies in. Only applies to enemy objects. (Repeated in banks $0d, $0e, $0f, and $10, since it's in "enemyCommon.s".)
itemDrop_conveyorTilesTable: Lists conveyor tiles along with what directions they should move item drop objects in (PART_ITEM_DROP).

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 (ages) Animal companions can't pass through these, but Ricky can hop up and down them like cliffs.
$da SOMARIA_BLOCK (ages)
$db SWITCH_DIAMOND (ages) Hardcoded to not break on using the switch hook
$f3 HOLE
$fc DEEP_WATER (ages) 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/common/tileIndices.s (use these values to search for hardcoded behaviour)