State component and presets
Every property of UWSRFStateComponent, what each behaviour preset configures, Stable IDs, and when initial state is captured.
UWSRFStateComponent is the one component you add to an Actor to make it part of the world-state
system. It registers the Actor with the world subsystem at BeginPlay, owns the Stable ID, and
carries the region membership and the reset policy.
Details panel layout
The panel is grouped into three sections, in this order:
| Section | Contents |
|---|---|
| WSRF | Setup | Behavior Preset, Regions, Reset Policy |
| WSRF | Advanced | Origin, Capture Timing, Reset Priority |
| WSRF | Advanced | Identity | The Stable ID, read-only |
Everything a normal integration touches lives in Setup. Advanced exists for unusual spawned-Actor workflows and ordering problems.
Properties
| Property | Type | Default | Meaning |
|---|---|---|---|
BehaviorPreset | EWSRFBehaviorPreset | Custom | Applies a safe configuration for a common gameplay role |
Regions | FGameplayTagContainer | empty | Which world regions own this Actor |
ResetPolicy | FWSRFResetPolicy | see below | When the Actor resets and how |
Origin | EWSRFActorOrigin | Auto | Placed or runtime-spawned; normally detected automatically |
CaptureTiming | EWSRFInitialCaptureTiming | DeferredAfterOwnerBeginPlay | When the initial state is captured |
ResetPriority | int32 | 0 | Lower values restore first among independent Actors |
StableGuid | FGuid | generated | The Stable ID, visible per instance, not editable by hand |
The default policy is immediately usable: it responds to the Manual and Region reset reasons, uses
Resettable persistence, AutomaticThenInterface restore, and removes runtime Actors on a matching
reset.
Behaviour presets
ApplyBehaviorPreset is callable in the editor and at runtime. Seven roles ship with the plugin:
| Preset | Intent |
|---|---|
Custom | Nothing is applied; you configure the policy yourself |
Enemy | Returns after rest, death or region reset |
Boss / Elite | Stays defeated permanently, even after resting |
Breakable Prop | May be genuinely destroyed, then respawned |
Permanent Shortcut | Persistent: the change survives ordinary resets |
Unique Pickup | One Shot: consumed permanently |
Trap | Resettable armed state |
Runtime Actor | A temporary spawned Actor, removed on a matching reset |
A preset writes concrete values into the policy. It is a starting point, not a locked mode: after applying one you can still change any trigger, mode or strategy, and the component keeps working.
Presets are the fast path, not a limitation
Everything a preset does can be configured by hand with Custom. Presets exist because most
Actors in a checkpoint-driven game fall into a handful of recognisable roles, and re-deriving each one by
hand is where configuration mistakes come from.
Stable IDs
Every component serialises a WSRF-owned FGuid. It is the identity that survives destruction,
streaming, respawn and saving.
Rules the framework enforces:
- IDs are generated automatically when a component is created in the editor;
- PIE duplication keeps the editor-authored ID, so a PIE session tests the real identity;
- ordinary Actor duplication in the editor generates a new ID;
- a duplicate live ID is rejected and logged rather than silently accepted;
- runtime registrations may request an explicit ID or accept a session-only generated one.
GetStableId returns it at runtime. In the editor, repairs are explicit actions in the Inspector —
see Validation and debug visualization.
Do not copy Stable IDs by hand
The ID field is visible for diagnostics, not for editing. Duplicating a configured Actor inside the editor is the supported way to get a correctly generated new ID.
Initial capture timing
EWSRFInitialCaptureTiming decides when the automatic snapshot is taken:
| Value | Behaviour |
|---|---|
DeferredAfterOwnerBeginPlay | Default. Captured one tick after the owner’s BeginPlay, so construction and initial gameplay setup are already applied |
ImmediateAtComponentBeginPlay | Captured during the component’s own BeginPlay |
Manual | Nothing is recaptured until you call Recapture Initial State |
All three modes apply pending resets and deferred persistent restores. Only the recapture of the initial state depends on this setting.
Immediate runs before the owner's BeginPlay
ImmediateAtComponentBeginPlay applies a pending restore during the component’s own BeginPlay,
which is before the owning Actor’s BeginPlay has run. A Blueprint that initialises variables in
BeginPlay will overwrite the restored values immediately afterwards. Leave the default unless
you have a specific reason.
RecaptureInitialState re-reads the current state and makes it the new baseline. Call it after
intentional runtime initialisation — for example an Actor that arms itself, or one whose starting
transform is chosen by a spawner. In Manual mode, if a pending reset or persistent restore arrives
before any state was captured, WSRF still performs the minimum capture required to restore safely.
Reset priority
Among Actors that are not related by attachment, restoration order follows ascending
ResetPriority, then Stable ID as a deterministic tie-break. Attachment relationships always win:
a parent is restored before its children regardless of priority.
Most Actors should leave this at 0. Raise it only when a real dependency exists and cannot be
expressed as an attachment.
Events
| Delegate | Fires |
|---|---|
OnOwnerResetStarted | When a reset that matches this Actor begins |
OnOwnerResetCompleted | When that reset has finished for this Actor |
Both carry the FWSRFResetRequest, so a Blueprint can branch on the reason tag — a Rest reset and a
PlayerDeath reset can feel different without changing the policy.
Runtime configuration
| Function | Use |
|---|---|
SetResetPolicy | Replace the policy at any time; the change applies immediately |
SetRegionMembership | Move an Actor to a different region while playing |
ApplyBehaviorPreset | Apply a role at runtime |
RecaptureInitialState | Make the current state the new baseline |
IsRegisteredWithWSRF | Confirm registration succeeded |
Runtime policy changes are session-only
SetResetPolicy updates the live policy immediately, but it does not modify the authored
component default, so the change is lost when the session ends. A reset that is already running
finishes with the policy it selected when it started; the new policy applies to later resets.
Related pages
Last updated: 2026-09-04