Skip to content

Sein Path

Struct · FSeinPath

#include "SeinPathTypes.h"

deterministic: safe in simulation code

A planned route. Waypoints is the world-space polyline a unit follows from start to destination. Segments describes the same route as typed pieces (Straight, Field, Arc, Pivot). On an ordinary route they match waypoint pairs one to one; on a route with arcs the segments are the planned truth and Waypoints is a finer polyline approximating them, so never index one by the other. Total Cost is the planar length, and Is Partial marks a route that stops short of the destination.

TArray<FFixedVector> Waypoints

Blueprint read-only

The route as world positions, in order from start to destination.

TArray<FSeinPathSegment> Segments

Blueprint read-only

Typed segment representation of the path. One Straight segment per consecutive Waypoints[i] → Waypoints[i+1] pair, derived by DeriveSegmentsFromWaypoints after the path is committed.

FFixedPoint TotalCost

Blueprint read-only

Total planar (XY) world-space length of the path — the sum of segment lengths, set by DeriveSegmentsFromWaypoints when the path is committed. Use it to compare routes by travel distance (not the waypoint count). Does NOT include terrain cost weighting.

bool bIsValid · default false

Blueprint read-only

True when the search produced a usable route. A partial route is still valid; check Is Partial to see whether it reaches the destination.

bool bIsPartial · default false

Blueprint read-only

True if the path does not reach the exact destination (partial / best-effort).

C++ members (6)
  • void Clear();
  • int32 GetWaypointCount() const;
  • FFixedVector GetWaypoint(int32 Index) const;
  • void DeriveSegmentsFromWaypoints(); Populate Segments from Waypoints as a sequence of Straight segments — one per consecutive waypoint pair. Resets and re-fills; call AFTER all waypoint mutations (smoothing, wall push) are complete. No-op when Waypoints.Num() < 2.
  • void FlattenToWaypoints(FFixedPoint MaxChordError); Rebuild Waypoints from typed Segments into a drivable polyline the built-in follower can drive with no follower-loop changes: each Arc is expanded into fixed-point samples bounded by MaxChordError (the maximum allowed sagitta between the true arc and a sampled chord); every other kind (Straight / Field / Pivot) collapses to its From→To endpoints. Segments is PRESERVED as the authored typed truth (render + a curve-aware mode read it), so after this call Waypoints is a fine polyline no longer 1:1 with Segments. Endpoints are copied exactly (no fixed-point drift at joins); the terminal waypoint stays the exact destination, preserving the destination-preview invariant. SELF-GUARDING and DETERMINISTIC: a no-op when Segments holds only Straight kinds (the shipped case) — Waypoints is left untouched — so this is safe to call unconditionally on any committed path. When it does expand, it uses fixed-point LUT trig and a FIXED chord tolerance so every peer produces an identical waypoint count and identical positions; pass a compile-time / config constant for MaxChordError, never a per-run tunable that could drift across machines. Defined out-of-line in SeinPathTypes.cpp (keeps the trig include out of this widely-included header).
  • bool HasTypedSegments() const; True if any segment is a non-Straight kind (Arc / Field / Pivot) — i.e. the route needs FlattenToWaypoints (or a segment-aware mode) rather than plain waypoint following. False for the shipped all-Straight case.