Structures in Eldertal
Introduction (OLD DOCUMENT / OLD RESEARCH STUFF)
In Eldertal, structures are fundamental elements that define pre-built objects within the game world. These structures are stored as entries or arrays of blocks, which are resolved by ID or name and placed according to their relative coordinates.
How Structures Work
Structures in Eldertal follow a simple pattern:
- They consist of blocks with assigned coordinates.
- They are conditionally placed based on defined rules (e.g., height constraints).
- They can extend beyond chunk boundaries, allowing for large-scale constructions.
Example: A 4x4 Wall
The following example defines a 4x4 stone wall:
COND: POS = HEIGHT {
{STONE, 0, 0,0},
{STONE, 1, 0,0},
{STONE, 2, 0,0},
{STONE, 3, 0,0},
{STONE, 0, 0,4},
{STONE, 1, 0,4},
{STONE, 2, 0,4},
{STONE, 3, 0,4},
{STONE, 0, 0,0},
{STONE, 0, 0,1},
{STONE, 0, 0,2},
{STONE, 0, 0,3},
{STONE, 3, 0,0},
{STONE, 3, 0,1},
{STONE, 3, 0,2},
{STONE, 3, 0,3},
}
COND: POS = HEIGHT
→ Defines a condition for structure placement.- Each entry contains:
- Block type (e.g.,
STONE
) - X, Y, Z coordinates (relative positioning)
- Block type (e.g.,
Structure Generation Process
Structures in Eldertal are placed through an automated process:
- Parsing Structure Files
- Structure data is loaded and stored in a Structure-Chunk-Array.
- Chunk Generation and Structure Selection
- After terrain generation, the Structure-Chunk-Array is processed.
- Each structure is checked against its placement conditions.
- Placement and World Integration
- If a condition is met, the structure is written into the global structure array.
- The structure is then placed into the world.
- Chunk Optimization
- If a structure already exists within a chunk, it is used instead of re-processing.
- This prevents duplicate structures and ensures efficient world generation.
Randomization and Variants
To create variability, Eldertal supports:
- Placeholder values like
[HEIGHT]
for dynamic positioning. - Random block selection, such as:
[20:STONE, 30:COBBLE, 70:SANDSTONE]
20%
chance of STONE30%
chance of COBBLESTONE70%
chance of SANDSTONE