USMStateMachineComponent¶
Module: SMSystem
#include <SMStateMachineComponent.h>
Inherits from UActorComponent, ISMStateMachineInterface, ISMStateMachineNetworkedInterface
Description¶
Actor Component wrapper for a State Machine Instance. Supports Replication. Will default state machine context to the owning actor of this component. Call Start() when ready.
Public Functions¶
Name | |
---|---|
virtual void | PostLoad() override |
virtual void | Serialize(FArchive & Ar) override |
virtual void | PostEditImport() override |
virtual void | PostEditChangeProperty(FPropertyChangedEvent & PropertyChangedEvent) override |
virtual bool | ReplicateSubobjects(UActorChannel * Channel, FOutBunch * Bunch, FReplicationFlags * RepFlags) override |
virtual void | GetLifetimeReplicatedProps(TArray< FLifetimeProperty > & OutLifetimeProps) const override |
virtual void | InitializeComponent() override |
virtual void | BeginPlay() override |
virtual void | EndPlay(const EEndPlayReason::Type EndPlayReason) override |
virtual void | TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction * ThisTickFunction) override |
virtual void | OnComponentDestroyed(bool bDestroyingHierarchy) override |
virtual void | Initialize(UObject * Context =nullptr) override |
virtual void | Start() override |
virtual void | Update(float DeltaSeconds) override |
virtual void | Stop() override |
virtual void | Restart() override |
virtual void | Shutdown() override |
void | InitializeAsync(UObject * Context, const FOnStateMachineComponentInitializedAsync & OnCompletedDelegate =FOnStateMachineComponentInitializedAsync()) |
void | K2_InitializeAsync(UObject * Context, FLatentActionInfo LatentInfo) |
bool | IsInitialized() const |
bool | IsStateMachineActive() const |
void | CopySettingsFromOtherComponent(USMStateMachineComponent * OtherComponent) |
virtual void | ServerInitialize(UObject * Context) override |
virtual void | ServerStart() override |
virtual void | ServerStop() override |
virtual void | ServerShutdown() override |
virtual void | ServerTakeTransition(const FSMTransitionTransaction & TransitionTransaction) override |
virtual void | ServerActivateState(const FGuid & StateGuid, bool bActive, bool bSetAllParents, bool bActivateNowLocally) override |
virtual void | ServerFullSync() override |
virtual bool | HandleNewChannelOpen(UActorChannel * Channel, FReplicationFlags * RepFlags) override |
virtual void | HandleChannelClosed(UActorChannel * Channel) override |
virtual bool | CanExecuteTransitionEnteredLogic() const override |
virtual bool | HasAuthorityToChangeStates() const override |
virtual bool | HasAuthorityToChangeStatesLocally() const override |
virtual bool | HasAuthorityToExecuteLogic() const override |
virtual bool | HasAuthorityToTick() const override |
virtual bool | IsConfiguredForNetworking() const override |
virtual bool | HasAuthority() const override |
virtual bool | IsSimulatedProxy() const override |
virtual void | SetCanEverNetworkTick(bool bNewValue) override |
bool | IsNetworked() const |
bool | IsLocallyOwned() const |
bool | IsOwningClient() const |
bool | IsRemoteRoleOwningClient() const |
ENetRole | GetRemoteRole() const |
bool | IsListenServer() const |
bool | CanTickForEnvironment() const |
float | GetServerUpdateFrequency() const |
float | GetClientUpdateFrequency() const |
void | SetCanInstanceNetworkTick(bool bCanEverTick) |
AActor * | GetTopMostParentActor() const |
USMInstance * | GetInstance() const |
USMInstance * | GetTemplateForInstance() const |
UObject * | GetContextForInitialization() const |
FString | GetInfoString() const |
bool | IsProcessingRPCs() const |
Protected Functions¶
Name | |
---|---|
void | Internal_OnInstanceInitializedAsync(USMInstance * Instance) |
void | Internal_OnReplicatedInstanceInitialized(USMInstance * Instance) |
void | Internal_OnStateMachineStarted(USMInstance * Instance) |
void | Internal_OnStateMachineUpdated(USMInstance * Instance, float DeltaSeconds) |
void | Internal_OnStateMachineStopped(USMInstance * Instance) |
void | Internal_OnStateMachineShutdown(USMInstance * Instance) |
void | Internal_OnStateMachineTransitionTaken(USMInstance * Instance, FSMTransitionInfo Transition) |
void | Internal_OnStateMachineStateChanged(USMInstance * Instance, FSMStateInfo ToState, FSMStateInfo FromState) |
void | Internal_OnStateMachineStateStarted(USMInstance * Instance, FSMStateInfo State) |
virtual void | PostInitialize() |
void | OnPostInitialize() |
void | InitInstanceTemplate() |
void | DestroyInstanceTemplate() |
void | ImportDeprecatedProperties() |
USMInstance * | CreateInstance(UObject * Context) |
virtual void | DoInitialize(UObject * Context) |
virtual void | DoStart() |
FORCEINLINE void | DoStart(const FSMTransaction_Base & Transaction) |
virtual void | DoUpdate(float DeltaTime) |
virtual void | DoStop() |
FORCEINLINE void | DoStop(const FSMTransaction_Base & Transaction) |
virtual void | DoShutdown() |
FORCEINLINE void | DoShutdown(const FSMTransaction_Base & Transaction) |
void | DoFullSync(const FSMFullSyncTransaction & FullSyncTransaction) |
void | DoTakeTransitions(const TArray< FSMTransitionTransaction > & InTransactions, bool bAsServer =false) |
void | DoActivateStates(const TArray< FSMActivateStateTransaction > & StateTransactions) |
virtual void | ConfigureInstanceNetworkSettings() |
bool | IsClientAndShouldSkipMulticastStateChange() const |
bool | IsClientAndCanLocallyChangeStates() const |
bool | IsServerAndCanLocallyChangeStates() const |
bool | ShouldClientQueueTransaction() const |
void | SetClientAsSynced() |
void | SetServerAsSynced() |
bool | HasOwningClientConnected() const |
void | FindAndSetOwningClientConnection() |
bool | IsServerAndShouldWaitForOwningClient() const |
bool | IsServerAndNeedsOwningClientSync() const |
bool | IsServerAndNeedsToWaitToProcessTransactions() const |
bool | PrepareFullSyncTransaction(FSMFullSyncTransaction & OutFullSyncTransaction) const |
void | ClearFullSyncTransactions(TArray< TSharedPtr< FSMTransaction_Base > > & InOutTransactions, bool bIgnoreUserAdded =true) |
bool | HasAuthorityToExecuteLogicForDomain(ESMNetworkConfigurationType Configuration) const |
FORCEINLINE bool | ShouldMulticast() const |
void | Server_PrepareTransitionTransactionsForClients(const TArray< FSMTransitionTransaction > & InTransactions) |
void | Server_PrepareStateTransactionsForClients(const TArray< FSMActivateStateTransaction > & InTransactions) |
void | ClientServer_ProcessAllTransactions(TArray< TSharedPtr< FSMTransaction_Base > > & InOutTransactions) |
void | Client_SendOutgoingTransactions() |
bool | Client_DoesClientNeedToSendInitialSync() const |
bool | Client_SendInitialSync() |
void | SERVER_Initialize(const FSMInitializeTransaction & Transaction) Server. |
void | SERVER_Start(const FSMTransaction_Base & Transaction) |
void | SERVER_Update(float DeltaTime) |
void | SERVER_Stop(const FSMTransaction_Base & Transaction) |
void | SERVER_Shutdown(const FSMTransaction_Base & Transaction) |
void | SERVER_TakeTransitions(const TArray< FSMTransitionTransaction > & TransitionTransactions) |
void | SERVER_ActivateStates(const TArray< FSMActivateStateTransaction > & StateTransactions) |
void | SERVER_RequestFullSync(bool bForceFullRefresh =false) |
void | SERVER_FullSync(const FSMFullSyncTransaction & FullSyncTransaction) |
virtual void | REP_OnInstanceLoaded() |
template \<typename T >void | QueueOutgoingTransactions(const TArray< T > & InTransactions) |
template \<typename T >void | QueueOutgoingTransactions(const T & InTransaction) |
template \<typename T >bool | QueueClientPendingTransactions(const TArray< T > & InTransactions) |
template \<typename T >bool | QueueClientPendingTransactions(const T & InTransaction) |
Public Attributes¶
Protected Attributes¶
Name | |
---|---|
TObjectPtr< USMInstance > | R_Instance |
TObjectPtr< USMInstance > | InstanceTemplate |
uint8 | bCanInstanceNetworkTick |
uint8 | bInitialized |
uint8 | bOverrideTick_DEPRECATED |
uint8 | bCanEverTick_DEPRECATED |
uint8 | bOverrideTickInterval_DEPRECATED |
float | TickInterval_DEPRECATED |
Friends¶
Name | |
---|---|
struct | FInitiateServerCall(FInitiateServerCall ) |
struct | FQueuedTransactionHelper(FQueuedTransactionHelper ) |
Public Functions Documentation¶
function
PostLoad¶
function
Serialize¶
function
PostEditImport¶
function
PostEditChangeProperty¶
function
ReplicateSubobjects¶
virtual bool ReplicateSubobjects(
UActorChannel * Channel,
FOutBunch * Bunch,
FReplicationFlags * RepFlags
) override
function
GetLifetimeReplicatedProps¶
virtual void GetLifetimeReplicatedProps(
TArray< FLifetimeProperty > & OutLifetimeProps
) const override
function
InitializeComponent¶
function
BeginPlay¶
function
EndPlay¶
function
TickComponent¶
virtual void TickComponent(
float DeltaTime,
ELevelTick TickType,
FActorComponentTickFunction * ThisTickFunction
) override
function
OnComponentDestroyed¶
function
Initialize¶
Prepare the state machine for use.
This cannot occur during automatic Component Activation when working with Listen servers and playing in the editor. The game will incorrectly report as Stand Alone.
Parameters:
Context
- The context to use for the state machine. A null context will imply the owner of the component should be used.
function
Start¶
Start the root state machine.
function
Update¶
Manual way of updating the root state machine if tick is disabled. Not used by default and for custom update implementations. This will either call update locally if not replicated or call update on the server. For more control in a network environment calling Update from GetInstance() may be more appropriate.
function
Stop¶
This will complete the state machine's current state and force the machine to end regardless of if the state is an end state.
function
Restart¶
Forcibly restart the state machine and place it back into an entry state.
function
Shutdown¶
Shutdown this instance. Calls Stop. Must call initialize again before use. If the goal is to restart the state machine later call Stop instead.
function
InitializeAsync¶
void InitializeAsync(
UObject * Context,
const FOnStateMachineComponentInitializedAsync & OnCompletedDelegate =FOnStateMachineComponentInitializedAsync()
)
Prepare the state machine for use on a separate thread.
Parameters:
Context
- The context to use for the state machine. A null context will imply the owner of the component should be used.
function
K2_InitializeAsync¶
Prepare the state machine for use on a separate thread.
function
IsInitialized¶
If the state machine component has fully initialized.
function
IsStateMachineActive¶
Checks if the instance is initialized and active.
function
CopySettingsFromOtherComponent¶
Sets relevant settings from another state machine component, ideally used with or immediately after component creation. Does not copy state machine instance data.
Parameters:
OtherComponent
- A state machine component for settings to be copied from. Accepts null.
function
ServerInitialize¶
Signal to the server to initialize. Can be called by either the server or owning client that has state change authority. Only the server will perform initialization directly from this call. The client will always initialize post instance replication.
function
ServerStart¶
Signal to the server to start processing. Can be called by either the server or owning client that has state change authority.
function
ServerStop¶
Signal to the server to stop processing. Can be called by either the server or owning client that has state change authority.
function
ServerShutdown¶
Signal to the server to shutdown. Can be called by either the server or owning client that has state change authority.
function
ServerTakeTransition¶
virtual void ServerTakeTransition(
const FSMTransitionTransaction & TransitionTransaction
) override
Provide a transition for the server to take.
function
ServerActivateState¶
virtual void ServerActivateState(
const FGuid & StateGuid,
bool bActive,
bool bSetAllParents,
bool bActivateNowLocally
) override
Signal to the server to activate a specific state. Can be called by either the server or owning client that has state change authority.
Parameters:
StateGuid
- The guid of the specific state to activate.
bActive
- Add or remove the state from the owning state machine's active states.
bSetAllParents
- Sets the active state of all super state machines. A parent state machine won't be deactivated unless there are no other states active.
bActivateNowLocally
- If the state is becoming active and this component has authority to activate locally it will run OnStateBegin this tick.
function
ServerFullSync¶
Notify the server to update all clients with its current states.
function
HandleNewChannelOpen¶
Handle when a new connection is added, ensuring the connection receives the initial transaction if required. This is called automatically when using bAutomaticallyHandleNewConnections.
Requires the component registered, active, initialized.
Parameters:
Channel
- The newly added actor channel.
RepFlags
- The replication flags for the channel.
Return: If the channel was added.
function
HandleChannelClosed¶
Handle when a channel is closed. Called automatically with bAutomaticallyHandleNewConnections. Default behavior just removes the channel and all null channels from the set.
Parameters:
Channel
- The channel to be removed. If null the connection set is cleaned of null channels.
function
CanExecuteTransitionEnteredLogic¶
If transition enter logic can currently execute.
function
HasAuthorityToChangeStates¶
If this connection has the authority to change states.
function
HasAuthorityToChangeStatesLocally¶
If the caller is both allowed to change states and can do so without server supervision.
function
HasAuthorityToExecuteLogic¶
If this connection has the authority to execute logic.
function
HasAuthorityToTick¶
If this connection has authority to tick. Even if it does, ticking may be disabled by the user.
function
IsConfiguredForNetworking¶
Checks if this component is networked and replicated.
function
HasAuthority¶
If the this instance has authority (Such as an instance running on a server)
function
IsSimulatedProxy¶
If this is only a simulated instance.
function
SetCanEverNetworkTick¶
Sets bCanInstanceNetworkTick directly. Requires tick authority.
function
IsNetworked¶
If this is a networked environment.
function
IsLocallyOwned¶
If this belongs to a player controlled on this client.
function
IsOwningClient¶
If this is the client that owns this component.
function
IsRemoteRoleOwningClient¶
If this is the authority for an owning client.
function
GetRemoteRole¶
Return the remote role of the owner.
function
IsListenServer¶
If this is the listen server.
function
CanTickForEnvironment¶
Checks tick settings depending on if this is a networked environment or not.
function
GetServerUpdateFrequency¶
Retrieve the correct update frequency to use.
function
GetClientUpdateFrequency¶
Retrieve the correct update frequency to use.
function
SetCanInstanceNetworkTick¶
Special override to change instance tick settings when networked. Requires tick authority to make any changes. Calling USMInstance::SetCanEverTick() on the primary instance will update the network tick, which may make this call unnecessary.
This call will likely be deprecated in the future and replaced with SetCanEverNetworkTick().
function
GetTopMostParentActor¶
Find the highest level owning actor of this component. Useful if this component is used within a child actor component.
function
GetInstance¶
Retrieve the real state machine instance this component wraps.
function
GetTemplateForInstance¶
Retrieve the archetype template the state machine instance is based on. Only valid for the CDO.
function
GetContextForInitialization¶
The context to use for initialization. Defaults to GetOwner(). For native implementations overload GetContextForInitialization_Implementation.
Return: The context to use when initializing the state machine instance.
function
GetInfoString¶
Create a string containing relevant information about this component.
function
IsProcessingRPCs¶
True while ClientServer_ProcessAllTransactions is processing.
Protected Functions Documentation¶
function
Internal_OnInstanceInitializedAsync¶
Callback from when the instance initializes, used for async initialization.
function
Internal_OnReplicatedInstanceInitialized¶
When the instance has initialized from replication.
function
Internal_OnStateMachineStarted¶
function
Internal_OnStateMachineUpdated¶
function
Internal_OnStateMachineStopped¶
function
Internal_OnStateMachineShutdown¶
function
Internal_OnStateMachineTransitionTaken¶
function
Internal_OnStateMachineStateChanged¶
void Internal_OnStateMachineStateChanged(
USMInstance * Instance,
FSMStateInfo ToState,
FSMStateInfo FromState
)
function
Internal_OnStateMachineStateStarted¶
function
PostInitialize¶
Called after the state machine has initialized either locally or by replication.
function
OnPostInitialize¶
Called after the state machine has initialized either locally or by replication.
function
InitInstanceTemplate¶
Initialize the USMInstance template based on the current StateMachineClass.
function
DestroyInstanceTemplate¶
Remove the current USMInstance template.
function
ImportDeprecatedProperties¶
Tick overrides are deprecated in favor of modifying the USMInstance template.
function
CreateInstance¶
function
DoInitialize¶
function
DoStart¶
function
DoStart¶
function
DoUpdate¶
function
DoStop¶
function
DoStop¶
function
DoShutdown¶
function
DoShutdown¶
function
DoFullSync¶
Sync all states locally.
function
DoTakeTransitions¶
void DoTakeTransitions(
const TArray< FSMTransitionTransaction > & InTransactions,
bool bAsServer =false
)
Perform local processing of transactions.
function
DoActivateStates¶
Perform local processing of transactions.
function
ConfigureInstanceNetworkSettings¶
Configure instance specific network properties.
function
IsClientAndShouldSkipMulticastStateChange¶
Checks if this instance can skip server authored state changes.
function
IsClientAndCanLocallyChangeStates¶
If the caller is the client and can process AND change states.
function
IsServerAndCanLocallyChangeStates¶
If the caller is the server and can change states.
function
ShouldClientQueueTransaction¶
Determine if transactions should be queued by the local client.
function
SetClientAsSynced¶
Resets pending transactions and sync requests.
function
SetServerAsSynced¶
Sets the server as being up to date with the client.
function
HasOwningClientConnected¶
Checks if the owning client has connected to the server.
function
FindAndSetOwningClientConnection¶
Checks if the owning client has already connected and sets the internal flag.
function
IsServerAndShouldWaitForOwningClient¶
If this instance should be waiting for the owning client to connect.
function
IsServerAndNeedsOwningClientSync¶
If this instance should be waiting for the owning client to connect and provide its initial sync.
function
IsServerAndNeedsToWaitToProcessTransactions¶
Checks if the server should be waiting before processing transactions. This does not check frequency.
function
PrepareFullSyncTransaction¶
Create a full sync transaction from this instance.
function
ClearFullSyncTransactions¶
void ClearFullSyncTransactions(
TArray< TSharedPtr< FSMTransaction_Base > > & InOutTransactions,
bool bIgnoreUserAdded =true
)
Clears all transactions matching the type from the input array.
Parameters:
InOutTransactions
- Transactions to search and modify.
bIgnoreUserAdded
- Do not clear full sync transactions triggered from user loading states.
function
HasAuthorityToExecuteLogicForDomain¶
Check for logic execution authority against specific domain.
function
ShouldMulticast¶
If multicast should be used, otherwise client calls will be used.
function
Server_PrepareTransitionTransactionsForClients¶
void Server_PrepareTransitionTransactionsForClients(
const TArray< FSMTransitionTransaction > & InTransactions
)
Update transaction array to be replicated to clients.
function
Server_PrepareStateTransactionsForClients¶
void Server_PrepareStateTransactionsForClients(
const TArray< FSMActivateStateTransaction > & InTransactions
)
Update transaction array to be replicated to clients.
function
ClientServer_ProcessAllTransactions¶
void ClientServer_ProcessAllTransactions(
TArray< TSharedPtr< FSMTransaction_Base > > & InOutTransactions
)
Server: Iterate through the outgoing queue sending all transactions to the correct proxies. Client: Iterate through the pending queue running on methods locally. The client will be assumed to be in sync after.
Parameters:
InOutTransactions
- Transactions in will be processed and the array cleared.
function
Client_SendOutgoingTransactions¶
Special handling when the client is executing queued transactions the server should execute.
function
Client_DoesClientNeedToSendInitialSync¶
If the owning client is responsible for sending the initial sync.
function
Client_SendInitialSync¶
Call from the owning client that is state change authoritative. Return false if failed.
function
SERVER_Initialize¶
Server.
Signal the server to initialize state machine.
function
SERVER_Start¶
Signal the server to start the state machine.
function
SERVER_Update¶
Update the server state machine.
function
SERVER_Stop¶
Signal the server to end the state machine.
function
SERVER_Shutdown¶
Signal the server to shutdown the state machine.
function
SERVER_TakeTransitions¶
Signal the server of transition transactions.
function
SERVER_ActivateStates¶
Signal the server to activate a specific state.
function
SERVER_RequestFullSync¶
Signal the server that it should force all clients to sync.
Parameters:
bForceFullRefresh
- Signal that the refresh should always be accepted and the local network settings should be refreshed.
function
SERVER_FullSync¶
Signal to the server that it should accept the current state of the owning client.
function
REP_OnInstanceLoaded¶
When the StateMachineInstance is loaded from the server.
function
QueueOutgoingTransactions¶
function
QueueOutgoingTransactions¶
function
QueueClientPendingTransactions¶
template <typename T >
inline bool QueueClientPendingTransactions(
const TArray< T > & InTransactions
)
function
QueueClientPendingTransactions¶
Public Attributes Documentation¶
variable
OnStateMachineInitializedEvent¶
Called when the state machine is first initialized.
variable
OnStateMachineStartedEvent¶
Called right before the state machine is started.
variable
OnStateMachineUpdatedEvent¶
Called right before the state machine is updated.
variable
OnStateMachineStoppedEvent¶
Called right after the state machine has ended.
variable
OnStateMachineShutdownEvent¶
Called right after the state machine has shutdown.
variable
OnStateMachineTransitionTakenEvent¶
Called when a transition has evaluated to true and is being taken.
variable
OnStateMachineStateChangedEvent¶
Called when a state machine has switched states.
variable
OnStateMachineStateStartedEvent¶
Called when a state has started. This happens after OnStateMachineStateChanged and all previous transitions have evaluated.
variable
bAutomaticallyHandleNewConnections¶
New connections generally need to receive an initial sync transaction or they will not function. This is performed automatically by default.
When true, new connections are automatically determined through ReplicateSubObjects(). When false, you must manually call HandleNewChannelOpen() and HandleChannelClosed().
variable
StateMachineClass¶
End Server.
The state machine class to use for this instance.
variable
bInitializeOnBeginPlay¶
Automatically initialize the state machine when the component begins play. This will set the Context to the owning actor of this component. This happens in two stages: On InitializeComponent the state machine is instantiated, on BeginPlay the state machine is initialized.
variable
bStartOnBeginPlay¶
Automatically start the state machine when the component begins play.
variable
bStopOnEndPlay¶
Automatically stop the state machine when the component ends play.
variable
BeginPlayInitializationMode¶
Configure multi-threaded options to use with InitializeOnBeginPlay. Running async can reduce blocking operations on the game thread but increase total initialization time per component.
variable
bReuseInstanceAfterShutdown¶
If set to false when shutdown is called the internal reference to the state machine instance is cleared so it can be garbage collected. If set to true the instance will not be freed and will be re-used when initializing.
When used with replication and re-initializing the component, this setting may be better set to false so the instance can run its first time OnRep initialize logic.
variable
bLetInstanceManageTick¶
The default behavior is to let the actor component tick the state machine when it ticks. This legacy option allows the instance to register as a tickable object instead.
Deprecated:
This property is deprecated and will no longer be supported in future versions. Remove uses of this property and configure the component to manage tick.
variable
StateChangeAuthority¶
The authoritative domain to determine the state of the state machine. This impacts evaluating transitions, activating states, start, and stop. Requires Replication and a networked environment.
Client - The client is allowed to evaluate and send state changes to the server. The server will only process and broadcast changes from the client. Server - Only the server will determine state changes which it will then send to the client. ClientAndServer - This is unsupported and is completely up to your implementation to determine which state the state machine is in for all connections.
Warning:
Client authority on an actor without a player controller will not work. Remote calls to a server can only be made with a player controller.
variable
NetworkTransitionConfiguration¶
Deprecated:
Use StateChangeAuthority instead.
variable
NetworkTickConfiguration¶
Determine which domain to tick. The state machine must allow ticking for this to take effect.
variable
NetworkStateExecution¶
The domain which primary state logic can be executed on. Requires Replication and a networked environment. Client - Only the client will execute state logic. Server - Only the server will execute state logic. ClientAndServer - Both the server and client will execute state logic.
This impacts OnStateBegin, OnStateUpdate, and OnStateEnd. All other optional execution nodes will always execute across all domains.
variable
NetworkStateConfiguration¶
Deprecated:
Use NetworkStateExecution instead.
variable
bIncludeSimulatedProxies¶
Include simulated proxies when broadcasting changes and executing client logic. The default behavior only includes autonomous proxies such as actors possessed by a player controller. Client driven transitions will not work without a player controller.
variable
ReplicatedInitializationMode¶
Configure multi-threaded options to use when the instance is replicated to proxies. Running async can reduce blocking operations on the game thread but increase total initialization time per component.
variable
NetworkTransitionEnteredConfiguration¶
The domain to execute OnTransitionEntered logic. This fires for transitions when one is being taken to the next state.
This setting respects bIncludeSimulatedProxies.
variable
bWaitForTransactionsFromServer¶
When true, if the client initiates a change it will only notify the server and not make the change until the server updates the client. When false, the client will make the change immediately.
This is generally not needed unless you want to retrieve the time the server spent in a state during OnStateEnd.
variable
bTakeTransitionsFromServerOnly¶
Deprecated:
Use bWaitForTransactionsFromServer instead.
variable
bHandleControllerChange¶
Attempt to automatically handle when the owning pawn is possessed or unpossessed by a player controller. This will force a full refresh using the current server states and update all connected clients' network settings.
This works best when the authority is set to server.
This may not work correctly when set to a client authority and going to or from a simulated proxy. It is not possible to have a client driven state machine owned by the server. In this case you may want to disable this option and handle OnPossess and OnUnPossess of the pawn, manually shutting down and initializing the state machine as desired.
variable
bCalculateServerTimeForClients¶
Calculate the server time spent in states when NetworkTickConfiguration is set to client only. This only impacts the client value of USMStateInstance_Base::GetServerTimeInState() and has no effect if the server is ticking.
When true and the server is not ticking, it will take a measurement from the timestamp of when the state first started compared to when the server received the request to end the state.
If only using auto-bound events, or the state machine is being manually updated, this may not be necessary and disabling could increase accuracy.
variable
bUseOwnerNetUpdateFrequency¶
Uses the NetUpdateFrequency of the component owner.
variable
ServerNetUpdateFrequency¶
The update rate (per second) to use for server RPC processing.
A lower frequency means less remote calls but larger average payload size. Total bandwidth over time may be less due to better transaction packing. A higher frequency means more frequent remote calls but smaller average payload size. Total bandwidth used may be more over time.
variable
ClientNetUpdateFrequency¶
The update rate (per second) for the client to use if it is performing RPC processing.
A lower frequency means less remote calls but larger average payload size. Total bandwidth over time may be less due to better transaction packing. A higher frequency means more frequent remote calls but smaller average payload size. Total bandwidth used may be more over time.
variable
bAlwaysMulticast¶
Configure whether the server should always use mutlicast RPCs regardless of what bIncludeSimulatedProxies is set to. This can support the case where the state machine needs to be replicated to simulated proxies, but the proxies should not execute state logic.
Protected Attributes Documentation¶
variable
R_Instance¶
The actual state machine instance.
variable
InstanceTemplate¶
The template to use when initializing the state machine. Only valid within the CDO.
variable
bCanInstanceNetworkTick¶
Set from the template and adjusted for the network configuration.
variable
bInitialized¶
If the component is initialized.
variable
bOverrideTick_DEPRECATED¶
If false the default setting will be used. When replicated this component may still perform some level of override depending on the NetworkTickConfiguration.
Deprecated:
Use bCanEverTick on the instance template instead.
variable
bCanEverTick_DEPRECATED¶
Allow the machine to tick. Overrides default State Machine blueprint configuration.
Deprecated:
Use bCanEverTick on the instance template instead.
variable
bOverrideTickInterval_DEPRECATED¶
If false the default setting will be used.
Deprecated:
Use TickInterval on the instance template instead.
variable
TickInterval_DEPRECATED¶
Time in seconds between native ticks. This mostly affects the "Update" rate of the state machine. Overloaded Ticks won't be affected. Overrides default state machine blueprint configuration.
Deprecated:
Use TickInterval on the instance template instead.
Private Attributes Documentation¶
variable
CurrentActorChannels¶
variable
OutgoingTransactions¶
Transactions the server is preparing to send.
variable
PendingTransactions¶
Transactions which could not be processed yet.
variable
LastNetUpdateTime¶
Time spent since last update.
variable
NetworkRole¶
variable
RemoteRole¶
variable
bProcessingRPCs¶
True during RPC processing.
variable
bJustExecutedRPCLocally¶
If the server should skip transaction processing for this frame in scope.
variable
bServerJustPreparedRPC¶
If the server is originating an RPC transaction for a frame in scope.
variable
bClientJustPreparedRPC¶
If the client is originating an RPC transaction for a frame in scope.
variable
bWaitingForServerSync¶
If this is a client that needs replicated states from the server.
variable
bClientInSync¶
The client is estimated to be in sync with the server.
variable
bServerInSync¶
The server is estimated to be in sync with the client.
variable
bProxiesWaitingForOwningSync¶
At least one proxy requires a sync, but the server needs initial data from the owning client.
variable
bClientHasPendingFullSyncTransaction¶
If the client has queued a full sync transaction.
variable
bQueueClientTransactions¶
The client is queuing transactions.
variable
bClientSendingOutgoingTransactions¶
When the client is sending its outgoing transactions.
variable
bOwningClientConnected¶
If the owning client has connected to the server.
variable
bCalledShutdownWhileWaitingForOwningClient¶
User called shutdown before the owning connected and the server was waiting.
variable
bPerformInitialSyncBeforeQueue¶
Perform an initial (empty) full sync and then execute the remaining queue.
variable
bClientNeedsToSendInitialSync¶
True only if auth client still needs to send an initial sync to the server.
variable
bNonAuthServerHasInitialStates¶
Special flag if a non-auth server was started with custom loaded states. This will tell the server to ignore the initial sync from the auth client.
variable
bHasServerRemoteRoleJustChanged¶
If the server has had its remote role suddenly changed.
variable
ComponentToCopy¶
Provide an existing component to copy certain settings from during dynamic component creation. This is only read during initialize component. Does not copy state machine instance data. Setting this will override all other settings when called through the blueprint node Add State Machine Component.
variable
bWaitingForInitialize¶
variable
bWaitingForStartOnBeginPlay¶
variable
bInitializeAsync¶
variable
OnStateMachineInitializedAsyncDelegate¶
Set from caller of initialize async function.