Vents
Based on game build 714014 | Last updated: 2026-02-27
Overview
This file defines procedural room templates for generating vent-themed cave areas in Don't Starve Together. It uses AddRoom calls to specify room layouts containing vent-specific prefabs such as cave_vent_rock, tree_rock1, tree_rock2, and withered flora. The file also includes helper functions (RandomVentRockState and RandomRockTreeState) to assign randomized states to prefabs—such as mineability and loot tables—during world generation.
This file is part of the world generation system and contributes to dynamic map layout creation by populating cave sections with thematic content and loot distribution patterns.
Usage example
The file itself is not directly instantiated as a component; it is evaluated at game startup to register room templates. To use these rooms, the world generator references them via the AddRoom calls shown.
Example (conceptual) integration in a worldgen taskset:
-- Inside a taskset or worldgen configuration file
task:AddStaticLayout("BGVentsRoom")
task:AddStaticLayout("VentsRoom")
-- ... then at runtime, the generator uses these registered rooms to populate cave maps
Dependencies & tags
Components used: None (this file operates at the room generation layer; no runtime components are accessed via inst.components.X).
Tags: The rooms created include the tag "fumarolearea" for categorization in world generation logic.
Properties
No properties are defined. This is a script that registers static room definitions, not an entity component.
Main functions
The following helper functions are defined for use during room generation:
RandomRockTreeState()
- Description: Returns a table describing the state of a
tree_rock1ortree_rock2instance—including whether it is a boulder and if it is mineable with initial work remaining—based on configured probabilities. Used as aprefabdatacallback during room generation. - Parameters: None.
- Returns:
tableornil— a table with optional keysboulderandworkable(containingworkleft), ornilif the rock is generated as a full-state boulder without additional properties. - Error states: May return
nilif the random roll falls below the threshold for minimal state.
RandomVentRockState()
- Description: Returns a table describing the state of a
cave_vent_rockinstance—including mineability and a loot table to use when worked—based on weighted probabilities. Used as aprefabdatacallback during room generation. - Parameters: None.
- Returns:
tableornil— a table with keysworkable(containingworkleft) and/orset_loot_table, ornilif no specific state is required. - Error states: Returns
nilwith probability 1/3, indicating full/default state.
Events & listeners
None. This is a world generation script and does not register event listeners or push events during runtime.