Worldtiledefs
Based on game build 714014 | Last updated: 2026-03-10
Overview
worldtiledefs defines static tile property configurations for ground and wall types, along with utilities for tile lookup and footstep sound playback. It serves as a central registry for world tile metadata (e.g., walk sounds, snow/mud compatibility) used by the locomotor and rider components during entity movement. Tile info is cached at startup for efficient runtime access via GetTileInfo, and the module exposes the PlayFootstep function to trigger platform-specific or surface-specific audio.
Usage example
-- Ensure tile info is cached before use (typically done once at startup)
TheWorld:StartThread(function() require "worldtiledefs" end)
-- Retrieve tile properties
local tileinfo = GetTileInfo(WORLD_TILES.DIRT)
if tileinfo and tileinfo.walksound then
print("Default walk sound for dirt:", tileinfo.walksound)
end
-- Play footstep for an entity
local player = TheWorld.entities["player"]
PlayFootstep(player, 1.0, false)
Dependencies & tags
Components used: locomotor, rider
Tags: Checks "gelblobbed", "player", "smallcreature", "largecreature".
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
assets | table | {} | List of required asset declarations (IMAGE and FILE) for tile textures and atlases. |
ground | table | {} | Alias for internal GROUND_PROPERTIES (deprecated; use Initialize instead). |
wall | table | {} | Deprecated wall property definitions. |
underground | table | {} | Deprecated underground layer definitions. |
minimap, turf, falloff, creep, minimapassets | table | {} | Reserved placeholders; currently unused. |
Main functions
GetTileInfo(tile)
- Description: Returns cached tile property data for a given tile type after
Initializehas been called. Fast O(1) lookup. - Parameters:
tile(number) – AWORLD_TILES.*constant. - Returns:
table– Tile properties (e.g.,walksound,snowsound,nogroundoverlays) ornilif no info exists. - Error states: Returns
nilif called beforeInitialize().
LookupTileInfo(tile)
- Description: Legacy fallback performing a linear search over
GROUND_PROPERTIES. Slower thanGetTileInfo; use only for debugging or tooling. - Parameters:
tile(number) – AWORLD_TILES.*constant. - Returns:
table– Tile properties ornil. - Error states: O(n) complexity; not recommended for runtime use.
PlayFootstep(inst, volume, ispredicted)
- Description: Triggers platform-specific or surface-specific footstep sounds for an entity, accounting for special states (e.g., riding, snow/mud, webbing, size).
- Parameters:
inst(Entity) – The entity producing the footstep.
volume(number) – Optional volume multiplier (default:1).
ispredicted(boolean) – Whether the sound is client-predicted (for networking). - Returns: Nothing.
- Error states: Silently does nothing if
instlacks aSoundEmittercomponent.
Events & listeners
None identified.