Skip to main content

Livingtree

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

Overview

This file defines the static layout for the Livingtree map room in Don't Starve Together. It is not a component in the Entity Component System (ECS) sense; rather, it is a Tiled JSON-compatible Lua data structure that encodes tile layer and object group information for procedural map generation. Specifically, it describes the visual background tiles and in-world entities (such as flower_evil and evergreen) placed in the Livingtree room, used by the worldgen system to construct the room during level generation.

The layout uses a 20x20 grid with 16x16 pixel tiles. The room includes an FG_OBJECTS object group listing multiple flower_evil and evergreen prefabs as placement markers, and a BG_TILES tile layer containing background tile IDs. This structure is consumed by the map generation system (e.g., map/rooms/ loaders) to instantiate the room in-game.

Usage example

While this file is not an ECS component and is not instantiated directly, it is referenced and loaded by the map generation system. An example of how such a layout is typically used within the game is shown below:

-- In map generation code (e.g., a room loader), the layout is loaded as data:
local layout = require "map/static_layouts/livingtree"

-- Then used to spawn objects and set tiles:
for _, obj in ipairs(layout.layers.FG_OBJECTS.objects) do
if obj.type == "flower_evil" then
local inst = ents:CreateEntity(obj.type)
inst.Transform:SetPosition(obj.x / 32, 0, obj.y / 32)
end
end

Dependencies & tags

Components used: None. This file is pure data and does not reference or use any ECS components at runtime. Tags: None identified.

Properties

The file is a top-level table with no self context. Its structure mirrors standard Tiled JSON export format.

PropertyTypeDefault ValueDescription
versionstring"1.1"Tiled version used for export.
luaversionstring"5.1"Lua version compatibility.
orientationstring"orthogonal"Map orientation type.
widthnumber20Map width in tiles.
heightnumber20Map height in tiles.
tilewidthnumber16Width of each tile in pixels.
tileheightnumber16Height of each tile in pixels.
propertiestable{}Global map properties (currently empty).
tilesetsarray(see structure)Array of tileset definitions used in the map.
layersarray(see structure)Array of layers, including tile layers and object groups.

tilesets item fields

PropertyTypeDefault ValueDescription
namestring"ground"Tileset name.
firstgidnumber1First global tile ID in the tileset.
filenamestring(path)Relative path to .tsx file.
tilewidth / tileheightnumber64Pixel dimensions of each tile in this tileset.
imagestring(path)Relative path to the tileset image.
imagewidth / imageheightnumber512Image dimensions in pixels.

layers item fields

PropertyTypeDescription
typestringLayer type ("tilelayer" or "objectgroup").
namestringLayer name ("BG_TILES" or "FG_OBJECTS").
width / heightnumberLayer dimensions (same as map unless overridden).
visiblebooleanVisibility flag.
opacitynumberLayer opacity (0 to 1).
dataarrayFor tile layers: flattened array of tile GIDs (0 = empty).
objectsarrayFor object groups: array of placement objects.

objects item fields (in object groups)

PropertyTypeDescription
namestringObject name (empty by default).
typestringPrefab name to spawn (e.g., "livingtree", "flower_evil", "evergreen").
shapestringGeometry shape (always "rectangle" in this file).
x, ynumberCoordinates in pixels (relative to map origin).
width / heightnumberGeometry dimensions (0 means "marker-only").
visiblebooleanVisibility flag.
propertiestableCustom properties (empty here).

Main functions

This file contains no executable functions. It is a static data definition only.

Events & listeners

This file does not register or push any events.