Skip to main content

Cave Test Start

Based on game build 714014 | Last updated: 2026-02-28

Overview

This file defines a static layout for the cave test start area, used for testing, tutorials, or demonstration scenarios in the Caves dimension. It specifies a 16x16 grid (with 64x64 px tiles) for background tiles and an object group containing critical gameplay fixtures such as spawn points, entrance markers, a treasure chest, a research lab, and a cookpot. The layout uses Tiled map format version 1.1 and is authored in Lua for integration with DST's world generation system.

This file is not a component in the ECS sense—it is a static data structure returned as a table, intended for consumption by the world generation or map loading system to instantiate entities and tile content. It does not define or interact with runtime ECS components directly.

Usage example

This file is loaded by the engine during world generation when the cave_test_start layout is referenced. Modders rarely instantiate it directly; instead, it is used by map/room/task systems:

-- Example: referencing this layout from a taskset or room file (pseudo-code)
local cave_test_start = require "map/static_layouts/cave_test_start"

-- In a room script, the layout might be used like:
room:SetLayout(cave_test_start)
room:PlaceObjects() -- internally processes tile layer and object group

Dependencies & tags

Components used: None. This file is a static data descriptor and does not directly access or depend on ECS components.

Tags: None. It does not tag entities—it provides the blueprint for where entities (e.g., treasurechest, researchlab2) will be placed, and those prefabs themselves may define tags.

Properties

This is a data-return file, not a constructor. It defines a top-level table with the following structure:

PropertyTypeDefault ValueDescription
versionstring"1.1"Tiled map format version.
luaversionstring"5.1"Lua version for the file.
orientationstring"orthogonal"Tilemap orientation.
widthnumber16Map width in tiles.
heightnumber16Map height in tiles.
tilewidthnumber16Logical tile width (not used directly; actual visual tile is 64x64).
tileheightnumber16Logical tile height (not used directly).
propertiestable{}Map-level custom properties (empty here).
tilesetsarray<table>(see source)Contains tileset definitions for rendering background layers.
layersarray<table>(see source)Contains layer definitions (tile layer and object group).

Tileset (tilesets[1])

PropertyTypeDefault ValueDescription
namestring"ground"Tileset name.
firstgidnumber1First global tile ID.
filenamestringPath to .tsx fileTileset definition source.
imagestringPath to .pngTileset image path.
imagewidthnumber512Width of tileset image in pixels.
imageheightnumber256Height of tileset image in pixels.
tilewidthnumber64Width of a single tile in pixels.
tileheightnumber64Height of a single tile in pixels.

Layers (layers)

Two layers defined:

layers[1] — BG_TILES (tile layer)

PropertyTypeDefault ValueDescription
typestring"tilelayer"Layer type.
namestring"BG_TILES"Layer name.
widthnumber16Layer width in tiles.
heightnumber16Layer height in tiles.
dataarray<number>16x16 gridRow-major tile IDs (0 = empty, 3, 6 = ground tile IDs).

layers[2] — FG_OBJECTS (object group)

PropertyTypeDefault ValueDescription
typestring"objectgroup"Layer type.
namestring"FG_OBJECTS"Layer name.
objectsarray<table>(see source)List of placement objects.

Objects (layers[2].objects)

Each object defines a placement marker:

PropertyTypeDefault ValueDescription
namestring""Object name (unused).
typestring"spawnpoint", etc.Object type—interpreted by engine to spawn a specific prefab.
x / ynumbere.g. 176, 80Screen coordinates in pixels (tilesize 64 → coords align to 2.75x, 1.25x tile units).
width / heightnumber0Typically 0 for point markers.
propertiestable{}Optional extra data (e.g., ["scenario"] = "chest_cave").

Main functions

This file does not define any functions. It is a static data descriptor returning a table.

Events & listeners

This file does not register or fire any events, as it is not an ECS component. Event logic resides in the prefabs or systems that consume this layout (e.g., treasurechest prefab logic on instantiation).