UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TNetRewindHistory< DataType, bLegacyData > Struct Template Reference

#include <NetworkPhysicsComponent.h>

+ Inheritance diagram for TNetRewindHistory< DataType, bLegacyData >:

Public Types

using Super = Chaos::TDataRewindHistory< DataType >
 

Public Member Functions

 TNetRewindHistory (const int32 FrameCount, const bool bIsHistoryLocal)
 
 TNetRewindHistory (const int32 FrameCount)
 
virtual ~TNetRewindHistory ()
 
virtual TUniquePtr< Chaos::FBaseRewindHistoryCreateNew () const
 
virtual TUniquePtr< Chaos::FBaseRewindHistoryClone () const
 
virtual void ValidateDataInHistory (const void *ActorComponent) override
 
virtual int32 CountValidData (const uint32 StartFrame, const uint32 EndFrame, const bool bIncludeUnimportant=true, const bool bIncludeImportant=false) override
 
virtual int32 CountAlteredData (const bool bIncludeUnimportant=true, const bool bIncludeImportant=false) override
 
virtual void SetImportant (const bool bImportant, const int32 Frame=INDEX_NONE) override
 
virtual void ApplyDataRange (const int32 FromFrame, const int32 ToFrame, void *ActorComponent, const bool bOnlyImportant=false) override
 
virtual bool CopyAllData (Chaos::FBaseRewindHistory &OutHistory, bool bIncludeUnimportant=true, bool bIncludeImportant=false) override
 
virtual bool CopyAlteredData (Chaos::FBaseRewindHistory &OutHistory, bool bIncludeUnimportant=true, bool bIncludeImportant=false) override
 
virtual bool CopyData (Chaos::FBaseRewindHistory &OutHistory, const uint32 StartFrame, const uint32 EndFrame, bool bIncludeUnimportant=true, bool bIncludeImportant=false) override
 
virtual TUniquePtr< Chaos::FBaseRewindHistoryCopyFramesWithOffset (const uint32 StartFrame, const uint32 EndFrame, const int32 FrameOffset) override
 
virtual int32 ReceiveNewData (Chaos::FBaseRewindHistory &NewData, const int32 FrameOffset, bool CompareDataForRewind=false, const bool bImportant=false, int32 TryInjectAtFrame=INDEX_NONE) override
 
virtual bool ShouldRecordReceivedDataOnFrame (const DataType &ReceivedData, DataType *NextReceivedData=nullptr)
 
virtual bool TriggerRewindFromNewData (DataType &NewData)
 
virtual void NetSerialize (FArchive &Ar, UPackageMap *InPackageMap) override
 
virtual void NetSerialize (FArchive &Ar, UPackageMap *InPackageMap, TUniqueFunction< void(void *Data, const int32 DataIndex)> DataSetupFunction) override
 
virtual void DebugData (const Chaos::FBaseRewindHistory &DebugHistory, TArray< int32 > &LocalFrames, TArray< int32 > &ServerFrames, TArray< int32 > &InputFrames) override
 
virtual void DebugData (const FString &DebugText) override
 
- Public Member Functions inherited from Chaos::TDataRewindHistory< DataType >
FORCEINLINE TDataRewindHistory (const int32 FrameCount, const bool bIsHistoryLocal)
 
FORCEINLINE TDataRewindHistory (const int32 FrameCount)
 
virtual FORCEINLINE ~TDataRewindHistory ()
 
virtual void Initialize ()
 
virtual FORCEINLINE bool HasValidData (const int32 ValidFrame) const override
 
virtual FORCEINLINE bool ExtractData (const int32 ExtractFrame, const bool bResetSolver, void *HistoryData, const bool bExactFrame=false) override
 
virtual FORCEINLINE void MergeData (int32 FromFrame, void *ToData) override
 
FORCEINLINE bool LoadData (const int32 LoadFrame)
 
FORCEINLINE bool EvalData (const int32 EvalFrame)
 
virtual FORCEINLINE bool RecordData (const int32 RecordFrame, const void *HistoryData) override
 
virtual FORCEINLINE bool RecordDataGrowingOrdered (const void *HistoryData) override
 
virtual FORCEINLINE void SetRecordDataIncremental (const bool bInIncremental) override
 
virtual bool CopyAllDataGrowingOrdered (Chaos::FBaseRewindHistory &OutHistory) override
 
DataType & GetCurrentData ()
 
const DataType & GetCurrentData () const
 
DataType & GetAndLoadEarliestData ()
 
DataType * GetAndLoadNextIncrementalData ()
 
FORCEINLINE uint32 NumValidData (const uint32 StartFrame, const uint32 EndFrame) const
 
TArray< DataType > & GetDataHistory ()
 
const TArray< DataType > & GetDataHistoryConst () const
 
virtual const int32 GetLatestFrame () const override
 
virtual const int32 GetEarliestFrame () const override
 
virtual const int32 GetHistorySize () const
 
virtual const bool HasDataInHistory () const
 
FORCEINLINE void ResizeDataHistory (const int32 FrameCount, const EAllowShrinking AllowShrinking=EAllowShrinking::Default) override
 
FORCEINLINE const uint32 GetFrameIndex (const int32 Frame) const
 
virtual FORCEINLINE void ResetFast ()
 
- Public Member Functions inherited from Chaos::FBaseRewindHistory
virtual FORCEINLINE ~FBaseRewindHistory ()
 
virtual FORCEINLINE void SetPackageMap (class UPackageMap *InPackageMap)
 
virtual int32 ReceiveNewData (FBaseRewindHistory &NewData, const int32 FrameOffset, const bool CompareDataForRewind=false, const bool bImportant=false)
 
virtual FORCEINLINE bool RewindStates (const int32 RewindFrame, const bool bResetSolver)
 
virtual FORCEINLINE bool ApplyInputs (const int32 ApplyFrame, const bool bResetSolver)
 

Additional Inherited Members

- Protected Member Functions inherited from Chaos::TDataRewindHistory< DataType >
FORCEINLINE int32 ClosestData (const int32 DataFrame, const bool bMinData)
 
- Protected Attributes inherited from Chaos::TDataRewindHistory< DataType >
bool bIsLocalHistory
 
bool bIncremental
 
TArray< DataType > DataHistory
 
int32 LatestFrame
 
int32 CurrentFrame
 
int32 CurrentIndex
 
int32 NumFrames = 0
 

Detailed Description

template<typename DataType, bool bLegacyData = false>
struct TNetRewindHistory< DataType, bLegacyData >

Templated data history, holding a data buffer

Member Typedef Documentation

◆ Super

template<typename DataType , bool bLegacyData = false>
using TNetRewindHistory< DataType, bLegacyData >::Super = Chaos::TDataRewindHistory<DataType>

Constructor & Destructor Documentation

◆ TNetRewindHistory() [1/2]

template<typename DataType , bool bLegacyData = false>
TNetRewindHistory< DataType, bLegacyData >::TNetRewindHistory ( const int32  FrameCount,
const bool  bIsHistoryLocal 
)
inline

◆ TNetRewindHistory() [2/2]

template<typename DataType , bool bLegacyData = false>
TNetRewindHistory< DataType, bLegacyData >::TNetRewindHistory ( const int32  FrameCount)
inline

◆ ~TNetRewindHistory()

template<typename DataType , bool bLegacyData = false>
virtual TNetRewindHistory< DataType, bLegacyData >::~TNetRewindHistory ( )
inlinevirtual

Member Function Documentation

◆ ApplyDataRange()

template<typename DataType , bool bLegacyData = false>
virtual void TNetRewindHistory< DataType, bLegacyData >::ApplyDataRange ( const int32  FromFrame,
const int32  ToFrame,
void ActorComponent,
const bool  bOnlyImportant = false 
)
inlineoverridevirtual

Call ApplyData on each frame data within range

Reimplemented from Chaos::FBaseRewindHistory.

◆ Clone()

template<typename DataType , bool bLegacyData = false>
virtual TUniquePtr< Chaos::FBaseRewindHistory > TNetRewindHistory< DataType, bLegacyData >::Clone ( ) const
inlinevirtual

Create a polymorphic copy of the history

Implements Chaos::FBaseRewindHistory.

◆ CopyAllData()

template<typename DataType , bool bLegacyData = false>
virtual bool TNetRewindHistory< DataType, bLegacyData >::CopyAllData ( Chaos::FBaseRewindHistory OutHistory,
bool  bIncludeUnimportant = true,
bool  bIncludeImportant = false 
)
inlineoverridevirtual

Copy all data from local history into into

Parameters
OutHistory
bIncludeUnimportant= If to copy unimportant data entries
bIncludeImportant= If to copy important data entries

Reimplemented from Chaos::FBaseRewindHistory.

◆ CopyAlteredData()

template<typename DataType , bool bLegacyData = false>
virtual bool TNetRewindHistory< DataType, bLegacyData >::CopyAlteredData ( Chaos::FBaseRewindHistory OutHistory,
bool  bIncludeUnimportant = true,
bool  bIncludeImportant = false 
)
inlineoverridevirtual

Copy altered data from local history into into

Parameters
OutHistory
bIncludeUnimportant= If to copy unimportant data entries
bIncludeImportant= If to copy important data entries

Reimplemented from Chaos::FBaseRewindHistory.

◆ CopyData()

template<typename DataType , bool bLegacyData = false>
virtual bool TNetRewindHistory< DataType, bLegacyData >::CopyData ( Chaos::FBaseRewindHistory OutHistory,
const uint32  StartFrame,
const uint32  EndFrame,
bool  bIncludeUnimportant = true,
bool  bIncludeImportant = false 
)
inlineoverridevirtual

Copy data from local history into

Parameters
OutHistory
StartFrame= Included
EndFrame= Included
bIncludeUnimportant= If to copy unimportant data entries
bIncludeImportant= If to copy important data entries

Reimplemented from Chaos::FBaseRewindHistory.

◆ CopyFramesWithOffset()

template<typename DataType , bool bLegacyData = false>
virtual TUniquePtr< Chaos::FBaseRewindHistory > TNetRewindHistory< DataType, bLegacyData >::CopyFramesWithOffset ( const uint32  StartFrame,
const uint32  EndFrame,
const int32  FrameOffset 
)
inlineoverridevirtual

Create a polymorphic copy of only a range of frames, applying the frame offset to the copies

Parameters
StartFrame= Included
EndFrame= Excluded

Implements Chaos::FBaseRewindHistory.

◆ CountAlteredData()

template<typename DataType , bool bLegacyData = false>
virtual int32 TNetRewindHistory< DataType, bLegacyData >::CountAlteredData ( const bool  bIncludeUnimportant = true,
const bool  bIncludeImportant = false 
)
inlineoverridevirtual

Find how many entries that have been marked as altered, meaning the server has altered the data so that it doesn't match the received data from the client

Reimplemented from Chaos::FBaseRewindHistory.

◆ CountValidData()

template<typename DataType , bool bLegacyData = false>
virtual int32 TNetRewindHistory< DataType, bLegacyData >::CountValidData ( const uint32  StartFrame,
const uint32  EndFrame,
const bool  bIncludeUnimportant = true,
const bool  bIncludeImportant = false 
)
inlineoverridevirtual

Find how many entries are valid in frame range

Parameters
StartFrame= Included
EndFrame= Included
bIncludeUnimportant= If to include unimportant data entries
bIncludeImportant= If to include important data entries

Reimplemented from Chaos::FBaseRewindHistory.

◆ CreateNew()

template<typename DataType , bool bLegacyData = false>
virtual TUniquePtr< Chaos::FBaseRewindHistory > TNetRewindHistory< DataType, bLegacyData >::CreateNew ( ) const
inlinevirtual

Create a new, empty instance with the same concrete type as this object

Implements Chaos::FBaseRewindHistory.

◆ DebugData() [1/2]

template<typename DataType , bool bLegacyData = false>
virtual void TNetRewindHistory< DataType, bLegacyData >::DebugData ( const Chaos::FBaseRewindHistory DebugHistory,
TArray< int32 > &  LocalFrames,
TArray< int32 > &  ServerFrames,
TArray< int32 > &  InputFrames 
)
inlineoverridevirtual

Debug the data from the archive

Reimplemented from Chaos::FBaseRewindHistory.

◆ DebugData() [2/2]

template<typename DataType , bool bLegacyData = false>
virtual void TNetRewindHistory< DataType, bLegacyData >::DebugData ( const FString &  DebugText)
inlineoverridevirtual

Print custom string along with values for each entry in history

Reimplemented from Chaos::FBaseRewindHistory.

◆ NetSerialize() [1/2]

template<typename DataType , bool bLegacyData = false>
virtual void TNetRewindHistory< DataType, bLegacyData >::NetSerialize ( FArchive Ar,
UPackageMap PackageMap 
)
inlineoverridevirtual

Serialize the data to or from a network archive

Reimplemented from Chaos::FBaseRewindHistory.

◆ NetSerialize() [2/2]

template<typename DataType , bool bLegacyData = false>
virtual void TNetRewindHistory< DataType, bLegacyData >::NetSerialize ( FArchive Ar,
UPackageMap PackageMap,
TUniqueFunction< void(void *Data, const int32 DataIndex)>  DataSetupFunction 
)
inlineoverridevirtual

Serialize the data to or from a network archive

Reimplemented from Chaos::FBaseRewindHistory.

◆ ReceiveNewData()

template<typename DataType , bool bLegacyData = false>
virtual int32 TNetRewindHistory< DataType, bLegacyData >::ReceiveNewData ( Chaos::FBaseRewindHistory NewData,
const int32  FrameOffset,
bool  CompareDataForRewind = false,
const bool  bImportant = false,
int32  TryInjectAtFrame = INDEX_NONE 
)
inlineoverridevirtual

Copy new data (received from the network) into this history Returns frame to resimulate from if

Parameters
CompareDataForRewindis set to true and compared data differ enough
TryInjectAtFrameputs the latest of the received data entries at the specified frame (if there isn't data for that frame yet), used to inject the latest data at the head of the buffer if it's empty

Reimplemented from Chaos::FBaseRewindHistory.

◆ SetImportant()

template<typename DataType , bool bLegacyData = false>
virtual void TNetRewindHistory< DataType, bLegacyData >::SetImportant ( const bool  bImportant,
const int32  Frame = INDEX_NONE 
)
inlineoverridevirtual

Mark frame important or unimportant

Parameters
Frame= use INDEX_NONE to set importance on all entries

Reimplemented from Chaos::FBaseRewindHistory.

◆ ShouldRecordReceivedDataOnFrame()

template<typename DataType , bool bLegacyData = false>
virtual bool TNetRewindHistory< DataType, bLegacyData >::ShouldRecordReceivedDataOnFrame ( const DataType &  ReceivedData,
DataType *  NextReceivedData = nullptr 
)
inlinevirtual

Check if we should record received data into history. Can for example block received data from client from overriding server authoritative data

◆ TriggerRewindFromNewData()

template<typename DataType , bool bLegacyData = false>
virtual bool TNetRewindHistory< DataType, bLegacyData >::TriggerRewindFromNewData ( DataType &  NewData)
inlinevirtual

Compares new received data with local predicted data and returns true if they differ enough to trigger a resimulation

◆ ValidateDataInHistory()

template<typename DataType , bool bLegacyData = false>
virtual void TNetRewindHistory< DataType, bLegacyData >::ValidateDataInHistory ( const void ActorComponent)
inlineoverridevirtual

Validate data in history buffer received from clients on the server

Reimplemented from Chaos::FBaseRewindHistory.


The documentation for this struct was generated from the following file: