Key Features
- Build mode & placement — enter/exit build mode with a
UBuildableDefinition, trace-based placement with configurable trace distance and collision fallback - Socket-based snapping — finds all valid snap candidates near the desired location, sorted by distance, with support for cycling between candidates (for when several sockets are close together) instead of having to reposition the camera
- Spline placement — a separate workflow for multi-piece runs (walls, fences, palisades): click a start point, add waypoints with the spline updating live, then confirm to batch-place every segment in one server request
- Structural integrity — a world subsystem that tracks clusters of connected buildables, propagates support from grounded/foundation pieces, and collapses unsupported pieces either instantly or in a staggered, delayed sequence with room for VFX
- Permission system — a five-tier permission model (
None < Public < Authorized < Owner < Admin), each mapped to an explicit set of allowed structure actions (Place, Destroy, Repair, Move, Replace, Upgrade, Downgrade, Open/Close, Toggle, Lock/Unlock, Authorize/RevokeAuthorization, ChangePermissionProfile, Custom) - Structure lifecycle events — delegates for destroyed, demolished (with refund hooks), repaired, replaced, and upgraded
- Resource costs — buildable definitions carry a list of resource/quantity costs, resolved through an external cost provider interface
- Save/load hooks — both per-buildable and world-level (
BuildSubsystem) delegates for gathering and applying save data - Multiplayer — placement and spline placement go through
Server/Clientreliable RPCs; state (build mode, current definition) is replicated
Architecture
UBuildingComponent— attach to the player character/pawn; owns build mode, preview spawning, single-piece placement, and snap-candidate search/cyclingUSplinePlacementComponent— companion component (requiresUBuildingComponenton the same actor) for multi-segment spline-based placementABuildableActor— base class for all placed structures; owns health, ownership, and lifecycle delegates (destroyed, demolished, repaired, replaced, upgraded, permission profile changed)ABuildablePreview— the client-side ghost/preview actor shown while placingUBuildableDefinition— data asset describing a placeable piece: sockets, costs, collision box, spline support, etc.UBuildSubsystem— world subsystem for action validation (FActionValidationResult) and world-level save integrationUStructuralIntegritySubsystem— world subsystem for support propagation and collapse (instant or staggered)UBasicStructureHealthComponent— a ready-madeIBuildableHealthimplementationUSocketSnapTester— utility for testing/debugging socket compatibility- Interfaces for integration:
IBuildCostProvider,IBuildPermissionResolver,IBuildPlayerIdentity,IBuildRulesProvider,IBuildUnlockProvider,IBuildableHealth
Multiplayer
Placement requests go throughServer_RequestPlaceBuildable / Server_RequestPlaceSpline (reliable server RPCs), with Client_NotifyPlacementResult / Client_NotifySplinePlacementResult reporting the outcome back. Build-mode state and the current buildable definition are replicated so all clients see consistent state.
Integration
BuildingSystem has no hard dependency on any inventory, permission, or identity plugin — each is resolved through a small interface, implemented by the consuming project:- Costs:
IBuildCostProvider - Permissions:
IBuildPermissionResolver,EBuildPermissionTier+FBuildPermissionProfile - Player identity:
IBuildPlayerIdentity - Placement/build rules:
IBuildRulesProvider, resolved from game mode, game state, or a world subsystem - Unlocks:
IBuildUnlockProvider, resolved from game mode or game state - Health:
IBuildableHealth, withUBasicStructureHealthComponentprovided as a default implementation
