Skip to content

Sein Entity Subsystem

Class · USeinEntitySubsystem : UWorldSubsystem

#include "Simulation/SeinEntitySubsystem.h"

Entities: one spawn path for spawned, placed and abstract entities, deferred destroy, ownership changes, named entities, and the hooks modules run at each of those points. Entities live in the world state; this service is the logic over them.

C++ members (14)
  • FSeinEntityHandle SpawnEntity(TSubclassOf<AActor> ActorClass, const FFixedTransform& SpawnTransform, FSeinPlayerID OwnerPlayerID); Spawn an entity from a unit Blueprint class (its entity bridge’s authored components). A class without an entity bridge is refused with an error and an invalid handle.
  • FSeinEntityHandle SpawnEntityWithParameters(TSubclassOf<AActor> ActorClass, const FFixedTransform& SpawnTransform, FSeinPlayerID OwnerPlayerID, const FInstancedStruct& SpawnParameters); SpawnEntity with parameters that Spawned hooks read (for example a construction start state).
  • FSeinEntityHandle SpawnPlacedEntity(TSubclassOf<AActor> ActorClass, const FSeinEntityArchetype& Instance, const FFixedTransform& SimTransform, FSeinPlayerID OwnerPlayerID); Spawn the entity of a level-placed actor from its instance archetype, so per-instance edits apply. The actor already exists, so no spawn visual event is sent.
  • FSeinEntityHandle SpawnClasslessEntity(const FFixedTransform& SpawnTransform, FSeinPlayerID OwnerPlayerID); A world entity with no class: no actor and no authored components. The caller adds its components; no hooks run.
  • FSeinEntityHandle SpawnAbstractEntity(FSeinPlayerID OwnerPlayerID, const UClass* Archetype = nullptr, TConstArrayView<FInstancedStruct> Components = {}, const FFixedTransform& Transform = FFixedTransform()); An abstract entity: no actor, and never in world sweeps or the spatial index. With Archetype (a Player State, Game State or other abstract class) it gets that entity bridge’s Sein components and base tags, then Components, which replace an authored component of the same type, then Spawned hooks run. Without one it gets Components and no hooks run; the caller adds the rest (a broker). Transform is what systems that track the entity read.
  • void DestroyEntity(FSeinEntityHandle Handle); Queue deferred destruction (processed in PostTick).
  • bool IsPendingDestroy(FSeinEntityHandle Handle) const; True while the entity waits for its deferred destroy.
  • void SetEntityOwner(FSeinEntityHandle Handle, FSeinPlayerID NewOwner); Change an entity’s owner (capture). Runs the ownership hooks around the change.
  • uint64 GetOwnerTransitionRevision(FSeinEntityHandle Handle) const; Bumped by every real ownership change of the entity; lets nested transfers detect supersession.
  • bool AddEntityHook(ESeinEntityHook Hook, int32 Order, FSeinEntityHookDelegate Delegate); Add deterministic follow-up work at a point in every entity’s life. Hooks run in ascending Order (see SeinEntityHookOrder); an Order already taken for that hook is rejected. Register before the match starts.
  • void RemoveEntityHooks(const UObject* Owner); Remove every hook bound to Owner.
  • void RegisterNamedEntity(FName Name, FSeinEntityHandle Handle); Register an entity under a name, replacing any previous mapping.
  • FSeinEntityHandle LookupNamedEntity(FName Name) const; The entity registered under a name, or invalid.
  • void UnregisterNamedEntity(FName Name);