Sein Actor Bridge Subsystem
Class · USeinActorBridgeSubsystem : UTickableWorldSubsystem
#include "Simulation/SeinActorBridgeSubsystem.h"
Connects the simulation to Unreal actors. It spawns an actor for each entity, keeps its transform in step, dispatches visual events to the actors, and destroys actors after their entities die.
Functions
Section titled “Functions”Get Actor For Entity
Section titled “Get Actor For Entity”Get the visual actor for a sim entity. Returns nullptr if no actor exists.
ASeinActor* GetActorForEntity(FSeinEntityHandle Handle) const;Event dispatchers
Section titled “Event dispatchers”On Tech Researched
Section titled “On Tech Researched”FOnTechResearched OnTechResearched · passes FSeinPlayerID Player, FGameplayTag TechTag
Fired when a tech research completes (for UI systems to refresh).
On Visual Event Dispatched
Section titled “On Visual Event Dispatched”FOnVisualEventDispatched OnVisualEventDispatched · passes FSeinVisualEvent Event
Fired for every visual event before per-actor routing. Global UI systems (combat text, notifications) bind to this.
Properties
Section titled “Properties”Destroy Actor Delay
Section titled “Destroy Actor Delay”float DestroyActorDelay · default 3.0f
Editable in defaults and on instances · Blueprint read and write
Delay before destroying an actor after its entity dies (for death animations).
C++ members (7)
void ForEachRegisteredActor(TFunctionRef<void(FSeinEntityHandle, ASeinActor&)> Visitor) const;Visit live render actors without walking the full sim entity pool or repeating handle-map lookups. Presentation-only; ordering is undefined.void RegisterActor(FSeinEntityHandle Handle, ASeinActor* Actor);Manually register an actor for an entity (for pre-placed level actors).void UnregisterActor(FSeinEntityHandle Handle);Manually unregister an actor from the bridge.FSeinEntityHandle RegisterPlacedActor(ASeinActor& PlacedActor);Materialize one already-frozen level actor into the simulation and bind its render bridge. A match build calls this in its own fixed order; no discovery or sorting occurs inside this method.void RegisterAllPlacedActors(UWorld& InWorld);Walk every level-placedASeinActor(stable-sorted by actor name) and bind each one to a sim entity. Idempotent — actors already linked are skipped. The stable sort matters for lockstep determinism: every client must auto-register placed actors in the SAME order so their entity IDs match the server. TActorIterator order is implementation- defined and can vary across machines. Called from OnWorldBeginPlay unless a match start registers placed actors itself (USeinMatchStartupSubsystemturns the automatic call off).void SetAutoRegisterOnBeginPlay(bool bInAuto);Disable the auto-call from OnWorldBeginPlay. Call from a match start’s Initialize so it owns the registration order. Default true, for projects without one.void ReconcileBridgeAfterRestore();Reconcile the render-side actor map against the current sim state. Runs a two-pass walk: 1. Cull orphans — for every (Handle, Actor) in EntityActorMap, if the sim no longer has a live entity at Handle, mark the actor for destruction (uses DestroyActorDelay so death anims play if any cleanup the actor wants to run can complete). 2. Spawn missing — walk every alive sim entity; for any without an actor in EntityActorMap, look up its class viaUSeinWorldSubsystem::GetEntityActorClass and spawn one. Fires the same OnEntitySpawned hook used by the normal sim → render path. Called byUSeinWorldSubsystem::RestoreSnapshot after the sim’s pool + component storages have been rehydrated, so the render layer matches the new sim state without orphans or headless entities.