Skip to main content

Cave Base 2

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

Overview

cave_base_2 is a static layout definition used by the game's world generation system to place a predefined cave chamber. It specifies the tiling for the background layer (BG_TILES) and the placement of world objects (FG_OBJECTS) such as treasure chests, furniture, flora, tools, and structures. This file conforms to the Tiled Map Editor format (JSON-like structure serialized as Lua) and is consumed by DST's map loading and instance spawning systems—not an ECS component in the traditional sense.

Usage example

This file is loaded procedurally by the worldgen system and is not typically instantiated manually. A representative usage pattern (simplified for illustration) would be:

local layout = require("map/static_layouts/cave_base_2")

-- The layout data is passed to a room instancer that interprets layers and objects:
-- inst:SpawnObjectsFromLayout(layout, "FG_OBJECTS")
-- or internally via map/task system:
-- world:SpawnStaticRoom("cave_base_2")

Dependencies & tags

Components used: None directly (this is a data file, not an ECS component). The objects defined in FG_OBJECTS (e.g., treasurechest, researchlab) rely on their own prefabs and components at runtime.

Tags: None identified. Object types are declared as string metadata (e.g., "type": "treasurechest"), but no AddTag/HasTag calls occur within this file.

Properties

This is a pure data structure; it has no instance properties or methods. However, the top-level table contains the following constant fields:

PropertyTypeDefault ValueDescription
versionstring"1.1"Tiled format version
luaversionstring"5.1"Lua interpreter version used
orientationstring"orthogonal"Map orientation type
widthnumber24Width in tiles
heightnumber24Height in tiles
tilewidthnumber16Width of each tile (in pixels)
tileheightnumber16Height of each tile (in pixels)
propertiestable{}Global properties (unused)
tilesetstableSee sourceTileset definitions
layerstableSee sourceMap layers (tile and object layers)

Main functions

This file exports a static data table and contains no functions.

Events & listeners

This file contains no event logic or listeners.