FSimulationTickState

[FSimulationTickState](API\Plugins\NetworkPrediction\FSimulationTickState): Holds active state for simulation ticking.

Windows
MacOS
Linux

Inheritance Hierarchy

FSimulationTickState

TSimulationTicker

References

Module

NetworkPrediction

Header

/Engine/Plugins/Runtime/NetworkPrediction/Source/NetworkPrediction/Public/NetworkedSimulationModelTick.h

Include

#include "NetworkedSimulationModelTick.h"

Syntax

struct FSimulationTickState

Remarks

FSimulationTickState: Holds active state for simulation ticking. We track two things: frames and time.

PendingFrame is the next frame we will process: the input/sync/aux state @ PendingFrame will be run through ::SimulationTick and produce the next frame's (PendingFrame+1) Sync and possibly Aux state (if it changes). "Out of band" modifications to the sync/aux state should happen to PendingFrame (e.g, before it is processed. Once a frame has been processed, we won't run it through ::SimulationTick again!).

MaxAllowedFrame is a frame based limiter on simulation updates. This must be incremented to allow the simulation to advance.

Time is also tracked. We keep running total for how much the sim has advanced and how much it is allowed to advance. There is also a historic buffer of simulation time in SimulationTimeBuffer.

Consider that Frames are essentially client dependent and gaps can happen due to packet loss, etc. Time will always be continuous though.

Variables

Name Description

Public variable

bool

 

bUpdateInProgress

Public variable

int32

 

MaxAllowedFrame

Public variable

int32

 

PendingFrame

Public variable

TNetworkSimCont...

 

SimulationTimeBuffer

Historic tracking of simulation time. This allows us to timestamp sync data as its produced.

Protected variable

FNetworkSimTime

 

TotalAllowedSimulationTime

Protected variable

FNetworkSimTime

 

TotalProcessedSimulationTime

Functions

Name Description

Public function Const

FNetworkSimT...

 

GetRemainingAllowedSimulationTime()

How much granted simulation time is left to process.

Public function Const

FNetworkSimT...

 

GetTotalAllowedSimulationTime()

Public function Const

FNetworkSimT...

 

GetTotalProcessedSimulationTime()

Public function

void

 

IncrementTotalProcessedSimulationTime

(
    const FNetworkSimTime& DeltaSimTim...,
    int32 Frame
)

Public function

void

 

SetTotalProcessedSimulationTime

(
    const FNetworkSimTime& SimTime,
    int32 Frame
)

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss