Skip to main content

Bargain Start

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

Overview

This file is a static layout definition for the Bargain world generation mode in DST. It specifies the initial terrain layout and pre-placed objects (e.g., firepits, tents, trees, crops, and decor) that constitute the starting area for players. It is not a component in the ECS sense but rather a Tiled map export (JSON-like table) used by the worldgen system to instantiate the game world. The layout includes background tile layer data and foreground object placements, with no ECS component logic or runtime behavior.

Usage example

This file is loaded by the world generation system via worldgen.lua or related task files and is not instantiated manually by modders. It is consumed as raw static data.

-- Example of how worldgen may consume such layouts (not to be used directly by modders)
local layout = require("map/static_layouts/bargain_start")
print("Layout size:", layout.width, "x", layout.height) -- 32 x 32
print("Number of object layers:", #layout.layers) -- 2 layers: tiles and objects

Dependencies & tags

Components used: None — this is static data, not an ECS component. Tags: None — this file does not manipulate entity tags or runtime systems.

Properties

This is a static Lua table describing a Tiled map export, not an ECS component class.

The top-level table keys are:

PropertyTypeDefault ValueDescription
versionstring"1.1"Tiled map format version
luaversionstring"5.1"Lua version target
orientationstring"orthogonal"Tilemap orientation
widthnumber32Map width in tiles
heightnumber32Map height in tiles
tilewidthnumber16Width of each tile in pixels
tileheightnumber16Height of each tile in pixels
propertiestable{}Map-level metadata (empty here)
tilesetsarraysee sourceArray of tileset definitions
layersarraysee sourceArray of layers (tilelayer or objectgroup)

Tileset Properties

Each tileset entry contains:

PropertyTypeDescription
namestringTileset identifier (e.g., "tiles")
firstgidnumberGlobal ID of first tile
tilewidth, tileheightnumberTile dimensions
imagestringPath to tileset image
imagewidth, imageheightnumberPixel dimensions of tileset image

Layer Types

Two layers are defined:

  1. BG_TILES (type "tilelayer"):
    • Contains a flattened array of tile IDs (32x32 = 1024 entries).
    • Non-zero values correspond to tile IDs in the "tiles" tileset.
  2. FG_OBJECTS (type "objectgroup"):
    • Contains a list of objects with type, x, y, width, height, and optional properties.
    • type maps to prefab names (e.g., "tent", "firepit", "carrot_planted", "evergreen_normal", "berrybush", "flower", "grass", "diviningrodstart", "spawnpoint").
    • All objects have shape = "rectangle" and width/height of 0 (indicating point placement).

Main functions

This file defines no functions — it is a data-only Lua module.

Events & listeners

This file does not define or listen to any events — it is static configuration data used during world initialization.