Go back to Table of Content
A Building is made of Elements. Each element occupies one or more cells of 1 cubic metre, so the position of an element can easily be deduced by the world position of the first element in the building (coordinates 0;0;0), integers 3D coordinates, and a list of cells.
Elements can also occupy a side of the cell: Centre, Top, Bottom, Front, Left, Back, Right.
Constraints determine what are the requirements for adding an element into a building. It might requires an empty cell, an empty side, a certain type of element as a neighbour, etc
Elements are based on Templates that determine most of its characteristics:
- Prefab: what prefab 3D model to use when showing the element in-game
- CentreOffset: The vector between the prefab's centre and the element's cell centre
- Cells: All cells the element occupies, starting from its centre
- Tags: A list of tags used to fulfill other elements' requirements. Allows elements to have any element with a tag as a requirement, not a specific template
- Constraint: a constraint that can be itself composed of other constraints and determines if a
- SnapTargets: To what tags, what side, and by an offset of how many cells can an Element snap to another (e.g. a Floor can snap to:
- A foundation in the centre side directly under it
- or A wall 3 cells under it that's in the front, left, back or right
- or Another floor in the bottom side which is one cell away in the X or Z direction
- In all cases the floor must be in the bottom side
- Anchors: Special points used by the BaseIn constraint to ensure the Element is anchored to the Terrain
A template also contains the list of requirements to build it:
- Materials: list of materials that will be used
- Tools: list of tools that are needed
- Skills: What skills are needed. This includes minimum skill levels as well as the effect of higher skill on building time
- Blueprints: Basic buildings require skill only but more advanced buildings need to have their blueprint known before they can be built
- Time: How much time is needed to build the Element. Modifiers are applied based on skills & tool levels (e.g. power drill faster than hand drill)
- Steps: An element often requires steps of different kind to be built (like build, dry, adjust, etc). In reality, most requirements are split out between steps
A template provides a list of characteristics the Element will have once built. Those can be Structural Integrity, Flammability, Insulation, Air-tightness, Damage resistance, etc
Variants:
A template can indicate whether it has variants (which are optional). Variants include the ability to build the template with different materials, tools, and skills, to give it different characteristics, or simply because a specific requirements is not available.
For example, a wall could have an option to add insulation, which adds a step that requires insulation material & a cutter, but adds thermal insulation to the Element.
Or a windowed-wall could have an option to have bullet proof-glass, which modifies step 4 of the requirements by removing the need for glass and adding the need for bullet-proof glass