Skip to content

Build Mode — Dynamic Floor Plugin

Build Mode

This page explains how to integrate the Dynamic Floor Plugin into a game’s construction mode — for example, a Sims-style building system where players place floors, switch materials, and toggle between different building tools.


Architecture overview

The plugin is designed so that you can slot it into any game structure. The key pieces on your side are:

  1. Your Player Controller — manages the active tool and forwards input
  2. Your HUD / UI — lets the player trigger placement with a chosen material
  3. Your boundaries — actors that define rooms/walls via the node network
  4. A renderer in the level — a Blueprint that implements IFloorPolygonChangeListener

The plugin provides example implementations for all of these. You can use them directly or create your own.


Activating and deactivating floor placement

FloorPlacementControllerComponent has two lifecycle functions:

FunctionDescription
ActivateComponentEnables the component — input forwarding to the active tool is live
DeactivateComponentDisables the component — input events are ignored

Use these to switch between build mode and play mode in your game. For example:

  • Player clicks Build Mode button → ActivateComponent
  • Player presses EscapeDeactivateComponent

Switching between tools

SetActiveTool on FloorPlacementControllerComponent sets the currently active placement tool.

The intended workflow per placement action:

  1. Player selects a floor type and material in the HUD.
  2. HUD calls PlaceFloor(FloorType, FloorMaterial) on the controller (via UiToControllerInterface).
  3. The controller spawns a new tool actor and passes it to SetActiveTool.
  4. The player places the floor.
  5. After the tool is finished (or aborted), the component destroys the tool automatically.

Each tool has its own lifecycle — spawned fresh for each placement session, destroyed on completion or abort.


The PlaceFloor entry point

The recommended way to trigger tool spawning from a HUD is to implement UiToControllerInterface on your Player Controller and call PlaceFloor from your HUD Button click event.

Required parameters:

ParameterTypeDescription
FloorTypeEFloorTypeWhich floor layer to place (Default, Border, Invisible)
FloorMaterialint32Material ID to apply to the placed polygon

The example HUD is at: DynamicFloorPlugin/Blueprints/ExampleGameplay/HUD

Use it as a reference, or build your own HUD that replicates the PlaceFloor button behaviour.


FloorType layering for multi-layer build systems

EFloorType allows you to operate multiple independent floor layers without them interfering with each other:

Layer use caseEFloorType value
Visible floor tilesDefault
Wall boundary polygonsBorder
Invisible logic/pathfinding layersInvisible

This means you can, for example, have a system where placing a wall creates a Border-type polygon, and placing floor tiles creates Default-type polygons — and neither affects the other’s database state or rendering.


Input forwarding

In your Player Controller, forward these inputs to FloorPlacementControllerComponent each frame/event:

Input eventComponent function
Left mouse clickHandleLeftClick
Right mouse clickHandleRightClick
Modifier key (e.g. Shift)HandleShift
Tick (cursor position)Forward cursor hit result on tick

Combining with other build tools (e.g. a wall plugin)

Because the plugin uses EFloorType and FloorPlacementControllerComponent.DeactivateComponent, it is designed to coexist with other building systems (e.g. a separate wall placement plugin).

  • When floor placement is active: ActivateComponent on FloorPlacementControllerComponent
  • When wall placement is active: DeactivateComponent on FloorPlacementControllerComponent, activate your wall tool instead

Each system stays isolated via these activation flags.


See also