How to Add a Building Piece

This overview explains how a new building piece is represented in the RPG Engine building pipeline using a concrete example: a food-producing building called CoconutPalm. The goal is to show how the building data row, gameplay tags, building actor, recipe, build menu page, and snap connectors work together.

Building Data and Item Data

All building definitions are stored in DT_BuildingData. Building pieces do not use DT_ItemData as their primary data source because buildings themselves are not inventory items and cannot be placed into the player inventory.

DT_ItemData is still used indirectly for the ingredients required to construct a building. For example, components such as sticks, rubber, leaves, iron, and other crafting resources are defined as normal item rows in DT_ItemData, and the building recipe references those item rows through its crafting recipe handle.

Example Building Type

In this example, we create a completely new building subtype called CoconutPalm. This building belongs to a new functional building family for structures that produce food over time.

A new row is added to DT_BuildingData with the row name:

  • CoconutPalm

The basic display fields for the row are then filled in:

  • Name
  • Description
  • Icon

Gameplay Tags

All building tags are organized under the building namespace:

  • World.Items.Buildings.<GlobalType>.<Subtype>

For the coconut palm example, the new subtype tag is:

  • World.Items.Buildings.Producers.CoconutPalm

This means the building uses:

  • GlobalType = World.Items.Buildings.Producers
  • Type = World.Items.Buildings.Producers.CoconutPalm

This keeps the new building aligned with the existing building tag hierarchy while introducing a dedicated family for producer-style structures.

DT_BuildingData Row Setup

The main runtime configuration for the new building is defined in its DT_BuildingData row.

Core identity fields

Use the following values:

  • GlobalTypeWorld.Items.Buildings.Producers
  • TypeWorld.Items.Buildings.Producers.CoconutPalm

Actor class

Actor is the actor class that will be spawned as the final placed building after construction. For this example, create a child blueprint from BP_Building_Master and name it:

  • BP_B_CoconutPalm

Assign this class to the Actor field in the row.

Input actions

For the coconut palm example, set InputActions to:

  • Map<"IA_FastUse" | Activate>

This means the building listens to the IA_FastUse input action and routes it to the Activate building action through the standard InputActions map in DT_BuildingData.

At the moment, the interaction setup for buildings is intentionally simple and uses the existing EBuildingAction flow. In future updates, the interaction system is planned to be reworked into a more flexible model so building-specific interaction logic can be configured in a cleaner and more extensible way.

Recipe handle

The ReceipHandle field points to the crafting recipe used to build the structure. Create a new recipe row named:

  • B_CoconutPalm

Configure that recipe with the following values:

  • Components:
    • COMP_Leaf × 1
    • COMP_Rubber × 2
  • CraftQuantity = 1
  • SpecialCraftCondition = None

After that, assign the B_CoconutPalm recipe row to ReceipHandle.

Upgrade path

This building does not support upgrades, so:

  • NextUpdate = None

Placement restrictions

The coconut palm should only be placed on a square foundation. Use the following setup:

  • AdditionalChecks = MustBeSnappedToCustomActor
  • OnlyOnCustomBuilding = World.Items.Buildings.SquareFoundations

This means the palm can only be placed on supported building actors whose type belongs to the square foundation family.

Snap rule and structural dependency

Use:

  • SnapRule = Base
  • Supporters = World.Items.Buildings.SquareFoundations

This setup means the coconut palm is structurally supported by the square foundation below it. If that supporting foundation is destroyed, the palm should also be destroyed as part of the building support chain.

Health and effects

Set:

  • Health = 100

For presentation and feedback:

  • BuildNiagaraEffect → use the standard shared build effect used by other building rows
  • BuildSoundEffect → use the standard shared build sound used by other building rows
  • DestroyNiagaraEffect → use the standard shared destroy effect used by other building rows
  • DestroySoundEffect → use the standard shared destroy sound used by other building rows

These effects are universal and can remain consistent with the rest of the building database.

Additional data

No extra custom data asset is required in this example, so:

  • AdditionalData = null

Destruction Actor

The DestructibleObject field should point to a destruction actor used when the building is destroyed. In this case, create a child blueprint from BP_GC_Destruction and name it:

  • BP_GC_CoconutPalm

Then assign it to:

  • DestructibleObject = BP_GC_CoconutPalm

For this example:

  • DestructibleObjectAddTransform = null

BP_GC_Destruction is described as a child of GeometryCollectionActor. In Unreal Engine, AGeometryCollectionActor is the Chaos Destruction actor type used to represent destructible geometry through a GeometryCollectionComponent, while the underlying Geometry Collection asset stores fractured geometry and break hierarchy used at runtime for destruction simulation. This makes it the correct base concept for breakable building destruction actors in a Chaos-based destruction workflow.

Building Actor Setup

Open BP_B_CoconutPalm and configure its building data link.

Set:

  • BuildingRow → the CoconutPalm row from DT_BuildingData
  • Set the coconut palm model on the actor’s StaticMesh component so the placed building uses the correct visual mesh in the world

This connects the placed building actor back to its database definition and allows the actor to use the data-driven building pipeline.

Also add the components required for detecting where the system should trace during building mode to check whether there is a valid building underneath that this object can be placed on.

For this setup:

  • Add a SceneComponent and name it SnapActorDetectors
  • Add the component tag ActorToSnapDetectorsContainer to this component
  • Add a child ChildActor under this component and name it SnapActorDetector
  • Set ChildActorClass to BP_B_SnapsDetector

Configure the detector settings as follows:

  • CustomDetector — this is the global building type tag that the detector will search for; set it to World.Items.Buildings.SquareFoundations
  • FinishLocation — this is the end point of the box trace; the trace starts from the BP_B_SnapsDetector actor location and ends at BP_B_SnapsDetector.GetActorLocation() - FinishLocation; set it to (0, 0, -15)
  • CriticalImportance — if this is set to true, and there are multiple BP_B_SnapsDetector actors, then if at least one critical detector returns false, the whole placement check also returns false; set it to true
  • SnapDetectorMode — set it to Supporters

Available SnapDetectorMode options:

  • Default — the search uses the building types listed in the OnlyOnCustomBuilding property of the building Data Asset
  • Ground — the search checks for either a Landscape actor or any object tagged with Landscape
  • Custom — the search uses the building types listed in the CustomDetector variable
  • Supporters — the search checks against the building types listed in the Supporters property of the building Data Asset

Building Menu Page Setup

The building construction UI is configured inside BP_BuildingComponent through the Building Pages parameter. This parameter is an array of gameplay tag containers, where each array element represents one page of the building menu.

For example, one page may contain wood building subtypes, and another page may contain stone building subtypes. To make food-producing structures appear in their own category, add a new page to the array and place the new subtype tag there:

  • World.Items.Buildings.Producers.CoconutPalm

This gives producer buildings their own dedicated build page instead of mixing them with wood or stone structural pieces.

Snap Targets and Connectors

The coconut palm can only be placed on buildings from the OnlyOnCustomBuilding family:

  • World.Items.Buildings.SquareFoundations

Because of that, every target building actor that should accept this palm needs connector data for it. In this example, square foundations are represented by a shared parent blueprint:

  • BP_B_SquareFoundation

This parent is inherited by building variants such as:

  • BP_B_SquareFoundation_M
  • BP_B_SquareFoundation_W

To support palm placement, add the connector setup to the shared parent BP_B_SquareFoundation.

Connector root component

Add a new SceneComponent and name it:

  • Producers

In the component tags for this component, add:

  • BuildingConnector

This tag is critical because the building system uses it to identify valid connector groups.

Child connector actors

Under the Producers component, add one or more ChildActor components in the positions where the palm should snap when the player aims at the foundation.

Use any naming convention you want, but a clear pattern is recommended. For example:

  • ProducersCoconutPalm_0

For each child actor:

  • ChildActorClass = BP_B_Connector

Then configure that connector with:

  • BuildingGlobalType = World.Items.Buildings.Producers
  • BuildingSubType = World.Items.Buildings.Producers.CoconutPalm

Optionally, enable:

  • DebugMode = true

When enabled, this helps visualize how the building will be placed on that connector.

Result

After these parts are configured, the new building piece is integrated into the building system:

  • it exists as a row in DT_BuildingData
  • it has its own gameplay tag family entry
  • it uses a dedicated building actor derived from BP_Building_Master
  • it consumes resources through a recipe in the crafting database
  • it appears on its own building menu page
  • it can only snap to supported foundation actors that expose matching building connectors
  • it can use a Chaos-based destruction actor through a GeometryCollectionActor-derived destruction pipeline

This is the full data-driven path for introducing a new producer-style building such as CoconutPalm.