Placement and rules

Placement modes

The Placement of a piece (instanced struct FPulseBuildPlacementMode) turns the player’s aim into a transform on the client (ComputePlacement) and checks a transform a client sent on the server (ValidatePlacement).

Mode Properties Use
Free bAlignToSurface (tilt to the surface normal), bFaceBuilder (look at the builder before turns) Decoration, furniture, campfires
Grid CellSize (zero: UPulseBuildSettings::GridCellSize; Z = floor height), Footprint (cells, unrotated), bSnapHeight (floors instead of the ground) Factory halls, city building, tiles
Sockets SnapRadius (how far from the aim a socket may be), bAllowGround (stand on the ground without a socket) House kits: foundation, wall, ceiling, roof, stairs
Spline settings in the Spline trait Fences, roads, walls, pipes (see Splines)

RotationStep of the piece is the step for RotatePreview; AddHeightOffset raises or lowers the preview.

Rules

Rules (FPulseBuildRule) run after the mode, first the piece’s Rules, then the settings’ DefaultRules and the rules bridges registered (Pulse::Build::Registry::RegisterRule; both unless bUseDefaultRules is off). The first rule that fails decides the result and the text the player sees: each rule answers with an FPulseResult, a reason (Pulse.Result.Failure.Build.<code>) whose text a project can replace (Project Settings > Pulse > Foundation > Result Texts), and for a single case a message (“You cannot build more than 3 of these.”).

Rule Properties Fails with
No Overlap Tolerance (boxes shrink, so pieces may touch), BlockingObjectTypes (players, physics objects; the ground never blocks) Overlapping
Max Slope MaxAngle (degrees of the surface) TooSteep
Surface RequiredActorTags, BlockedActorTags, AllowedMaterials (physical materials) InvalidSurface
Needs Support bGroundCounts, SupportPieceTags NeedsSupport
Limit MaxCount, bPerPlayer, CountedPieces LimitReached
Min Distance Distance, OtherPieces TooClose
Conditions Conditions (Pulse conditions: a skill rank, an item, a finished quest, a team, …), FailText Pulse.Result.Failure.Conditions (PulseFoundation)
In Own Claim bClaimPiecesAnywhere (on), ExemptPieces, bAllowTeam, bAllowGroup Pulse.Result.Failure.Build.OutsideClaim
Spline Shape bUseShaper (on: the steps of the Octilinear shaper), AngleStep (45), Slopes (0, 15, 30), Tolerance Pulse.Result.Failure.Build.SplineAngle, SplineSlope (see Splines)
Integrity (PulseBuildIntegrity) MinStability, bTintPreview NeedsSupport

The Conditions rule checks Pulse conditions (PulseFoundation) with the builder’s pawn as Player and Instigator, the piece definition as Source, its category and tags as Tags and the place as Location. What a client cannot check passes in the preview; the server decides. Without FailText the player reads “Needs” and the conditions that fail.

The In Own Claim rule lets a piece stand only in a claim of the builder: a claim piece or a claim zone whose owner the builder is, or whose team or group (a party of PulseBuildOnlineBridge, a faction of PulseBuildFactionTerritoryBridge) the builder belongs to. Pieces with the Claim trait may stand anywhere while bClaimPiecesAnywhere is on, so the first totem can go down; the zones still keep claims apart. ExemptPieces lets further pieces (by tags and category) stand anywhere. It is no default rule: put it on pieces, or let the optional Set Up step Build only inside own claims add it to the Default Rules, so every piece of the game needs a claim.

A mode can fail on its own (no socket in reach, too steep a spline); then the rules are skipped.

After the rules, permissions and zones and the costs are checked. The preview shows all of it: green or red, the reason text, and the cost lines with what is missing.

Tools

Tool What Confirm does
Place Places the selected piece (spline pieces: sets the next point)
Remove Removes the piece under the crosshair (with refund; construction sites give back what they took, dismantle time if the piece has one)
Move Picks the piece up and places it at the new spot (same checks as placing). A move only carries and turns the piece: the server builds the points of a spline from its stored shape and the sent transform, never from points of the client, so moving never changes length or costs (shape edits are RequestSetSplinePoints)
Rotate Turns the piece by one rotation step
Pipette Selects the piece under the crosshair for placing
Copy Copies the structure under the crosshair (all touching pieces) into a blueprint
PlaceBlueprint Places the current blueprint
Upgrade Upgrades the piece to its next tier (pays the tier’s costs)
Repair Repairs the piece (pays a part of its value)
Work Starts or stops working on the construction site under the crosshair

Dragging rows and areas

With the Place tool active, BeginDrag(Line) or BeginDrag(Area) starts a drag at the current placement. While dragging the preview shows a row or a rectangle of copies (GetDragTransforms, at most MaxDragCount). EndDrag places all copies that pass the checks in one request and one undo step; CancelDrag drops it.

Range

Players build within BuildRange of the component (0: DefaultBuildRange of the settings), measured from the body of the builder (its pawn, else the owner) with Pulse::Requests::CheckReach of PulseFoundation. The checks allow 400 cm more, for the camera offset of third person games; when the Reach Tolerance of the request guard (Project Settings > Pulse > Foundation > Requests) is larger, that counts. The preview and the server run the same check; a place out of reach is refused with Out Of Range. Placing (with every spline point), removing, editing spline points and blueprints measure to the place; upgrades, repairs and the other changes of a placed piece measure to its bounds, so a long wall is in reach at either end.

Requests from code

RequestPlace(Piece, Placement), RequestPlaceMany(Piece, Transforms), RequestRemove(Id), RequestMove(Id, Placement) work for AI builders and scripted building as well (on the authority they run at once). To wait for the answer, use RequestBuildChange(Request, Callback) in C++ or the node Request Build; on the authority PlacePiece, RemovePiece and MovePiece return the FPulseResult directly. Without any checks, UPulseBuildSubsystem::AddPiece / K2_AddPiece add pieces directly (scripted bases, loading).


This site uses Just the Docs, a documentation theme for Jekyll.