Tilegroups
Based on game build 714014 | Last updated: 2026-03-10
Overview
The TileGroupManager is a utility system that categorizes world tiles into logical groups (e.g., land, ocean, impassable) and provides predicate functions to query tile types. It is primarily used during world generation and by systems (like undertile components) that need to reason about terrain placement and collision. The script defines and configures global TileGroups table entries referencing prebuilt or custom tile groups, enabling modders to extend or query tile classifications consistently.
Usage example
-- Check if a tile belongs to a specific group
if TileGroupManager:IsLandTile(tile_id) then
print("This is a land tile.")
end
-- Access predefined tile groups for placement logic
local dock_tile_group = TileGroups.DockTiles
-- Use tile_group_id with undertile or worldgen APIs as needed
Dependencies & tags
Components used: None identified
Tags: None identified
Properties
| Property | Type | Default Value | Description |
|---|---|---|---|
TileGroupManager | table | (global) | A singleton-like manager table containing predicate methods and group management functions (inherited via metatable). |
TileGroups | table | (global) | A table populated with tile group identifiers (e.g., LandTiles, OceanTiles, InvalidTiles) used as arguments for TileGroupManager functions. |
Main functions
IsLandTile(tile)
- Description: Returns
trueiftilefalls within the defined land tile ranges (legacy or current). - Parameters:
tile(number) — A tile ID constant (e.g.,WORLD_TILES.LAND_GRASS). - Returns:
trueif tile is land; otherwisefalse.
IsOceanTile(tile)
- Description: Returns
trueiftilefalls within the defined ocean tile ranges (legacy or current). - Parameters:
tile(number) — A tile ID constant. - Returns:
trueif tile is ocean; otherwisefalse.
IsImpassableTile(tile)
- Description: Returns
trueiftileis impassable, includingWORLD_TILES.IMPASSABLEor within defined impassable ranges. - Parameters:
tile(number) — A tile ID constant. - Returns:
trueif tile is impassable; otherwisefalse.
IsInvalidTile(tile)
- Description: Returns
trueiftileis invalid (WORLD_TILES.INVALID) or impassable. - Parameters:
tile(number) — A tile ID constant. - Returns:
trueif tile is invalid or impassable; otherwisefalse.
IsNoiseTile(tile)
- Description: Returns
trueiftilefalls within the noise tile ranges (used for procedural textures). - Parameters:
tile(number) — A tile ID constant. - Returns:
trueif tile is a noise tile; otherwisefalse.
IsTemporaryTile(tile)
- Description: Returns
trueiftileis a temporary tile (used to prevent collisions with undertile components). - Parameters:
tile(number) — A tile ID constant. - Returns:
trueifGROUND_ISTEMPTILE[tile]is truthy; otherwisefalse.
IsShallowOceanTile(tile)
- Description: Returns
trueiftileis one of the explicitly defined shallow ocean tile types. - Parameters:
tile(number) — A tile ID constant. - Returns:
trueif tile is shallow ocean (WORLD_TILES.OCEAN_COASTAL_SHORE,OCEAN_COASTAL, orOCEAN_WATERLOG); otherwisefalse.
Events & listeners
None identified