Skip to main content

Cave Exit

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

Overview

This file (cave_exit.lua) is a static layout definition used by Don't Starve Together's world generation system. It describes the tile and object configuration for the cave exit region using Tiled Map Editor format (JSON-compatible Lua table structure). It is not an ECS component — rather, it is a data asset consumed by the map generation pipeline to construct physical and environmental features in the Caves biome. The layout includes background tile data, foreground object placement (e.g., spawn points, lighting, flora), and metadata such as tile dimensions and layer ordering.

Usage example

Static layouts like this are not instantiated manually by modders. They are referenced in worldgen tasksets (e.g., in map/tasksets/caves.lua) and loaded automatically during world generation.

Dependencies & tags

Components used: None (this is a pure data structure). Tags: None identified.

Properties

PropertyTypeDefault ValueDescription
versionstring"1.1"Tiled map format version.
luaversionstring"5.1"Lua compatibility version.
orientationstring"orthogonal"Map rendering orientation.
widthinteger24Map width in tiles.
heightinteger24Map height in tiles.
tilewidthinteger16Width of each tile in pixels.
tileheightinteger16Height of each tile in pixels.
propertiestable{}Global map properties (currently empty).
tilesetsarray of tablesSee codeArray of tileset definitions (contains 1 tileset named "tiles").
layersarray of tablesSee codeArray of layer definitions: "BG_TILES" (tile layer) and "FG_OBJECTS" (object group).

Tileset details (tilesets[1])

PropertyTypeDefault ValueDescription
namestring"tiles"Tileset name.
firstgidinteger1First global tile ID.
tilewidth/tileheightinteger64Tile dimensions in the tileset image.
imagestring"../../../../tools/tiled/dont_starve/tiles.png"Relative path to tileset image.

Layer details

  • Layer "BG_TILES" (tilelayer)
    • data: Flat array of 576 (24x24) integer tile IDs (mostly 0, with some 14).
  • Layer "FG_OBJECTS" (objectgroup)
    • Contains 20 named objects with type, position (x, y), and optional shape/properties. Notable object types include:
      • "spawnpoint_multiplayer" (player spawn point)
      • "cave_exit" (exit marker)
      • "cavelight" / "cavelight_small" (lighting fixtures)
      • "evergreen" / "grass" / "sapling" (decorative flora)

Main functions

This file returns a table and does not define any functions or logic. It is consumed by the map generation system to instantiate in-game geometry and objects.

Events & listeners

No events or listeners are defined — this is a static data definition.