UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FNetworkPhysicsData Struct Reference

#include <NetworkPhysicsComponent.h>

+ Inheritance diagram for FNetworkPhysicsData:

Public Member Functions

PRAGMA_DISABLE_DEPRECATION_WARNINGS FNetworkPhysicsData ()=default
 
virtual ~FNetworkPhysicsData ()=default
 
 FNetworkPhysicsData (const FNetworkPhysicsData &)=default
 
 FNetworkPhysicsData (FNetworkPhysicsData &&)=default
 
FNetworkPhysicsDataoperator= (const FNetworkPhysicsData &)=default
 
FNetworkPhysicsDataoperator= (FNetworkPhysicsData &&)=default
 
void SetImplementationComponent (UActorComponent *InImplementationComponent)
 
void ClearImplementationComponent ()
 
void SetDeltaSourceData (FNetworkPhysicsData *IntDeltaSourceData)
 
void ClearDeltaSourceData ()
 
void SerializeFrames (FArchive &Ar)
 
void SetImportant (bool bIsImportant)
 
virtual void ApplyData (UActorComponent *NetworkComponent) const
 
virtual void BuildData (const UActorComponent *NetworkComponent)
 
virtual void InterpolateData (const FNetworkPhysicsData &MinData, const FNetworkPhysicsData &MaxData)
 
virtual void DecayData (float DecayAmount) override
 
virtual void MergeData (const FNetworkPhysicsData &FromData)
 
virtual void ValidateData (const UActorComponent *NetworkComponent)
 
virtual bool CompareData (const FNetworkPhysicsData &PredictedData)
 
virtual const FString DebugData ()
 
bool operator== (const FNetworkPhysicsData &Other) const
 
void DoInterpolateData (const FNetworkPhysicsPayload &MinData, const FNetworkPhysicsPayload &MaxData) override
 
void MergeData (const FNetworkPhysicsPayload &FromData) override
 
bool CompareData (const FNetworkPhysicsPayload &PredictedData) const override
 
virtual void InterpolateData (const FNetworkPhysicsPayload &MinData, const FNetworkPhysicsPayload &MaxData, float LerpAlpha)
 
- Public Member Functions inherited from FNetworkPhysicsPayload
virtual ~FNetworkPhysicsPayload ()
 
virtual const FString DebugData () const
 
void PrepareFrame (int32 CurrentFrame, bool bIsServer, int32 ClientFrameOffset)
 

Public Attributes

PRAGMA_ENABLE_DEPRECATION_WARNINGS TStrongObjectPtr< UActorComponentImplementationComponent = nullptr
 
FNetworkPhysicsDataDeltaSourceData = nullptr
 
- Public Attributes inherited from FNetworkPhysicsPayload
int32 ServerFrame = 0
 
int32 LocalFrame = 0
 
bool bDataAltered = false
 
bool bReceivedData = false
 
bool bImportant = false
 

Detailed Description

END Iris Compliant Data Base network physics data that will be used by physics

Constructor & Destructor Documentation

◆ FNetworkPhysicsData() [1/3]

PRAGMA_DISABLE_DEPRECATION_WARNINGS FNetworkPhysicsData::FNetworkPhysicsData ( )
default

◆ ~FNetworkPhysicsData()

virtual FNetworkPhysicsData::~FNetworkPhysicsData ( )
virtualdefault

◆ FNetworkPhysicsData() [2/3]

FNetworkPhysicsData::FNetworkPhysicsData ( const FNetworkPhysicsData )
default

◆ FNetworkPhysicsData() [3/3]

FNetworkPhysicsData::FNetworkPhysicsData ( FNetworkPhysicsData &&  )
default

Member Function Documentation

◆ ApplyData()

virtual void FNetworkPhysicsData::ApplyData ( UActorComponent NetworkComponent) const
inlinevirtual

◆ BuildData()

virtual void FNetworkPhysicsData::BuildData ( const UActorComponent NetworkComponent)
inlinevirtual

◆ ClearDeltaSourceData()

void FNetworkPhysicsData::ClearDeltaSourceData ( )
inline

◆ ClearImplementationComponent()

void FNetworkPhysicsData::ClearImplementationComponent ( )
inline

◆ CompareData() [1/2]

virtual bool FNetworkPhysicsData::CompareData ( const FNetworkPhysicsData PredictedData)
inlinevirtual

Define how to compare client and server data for the same frame, returning false means the data differ enough to trigger a resimulation.

Parameters
PredictedDatais data predicted on the client to compare with the current data received from the server. NOTE: To use this function, CVars np2.Resim.CompareStateToTriggerRewind and/or np2.Resim.CompareInputToTriggerRewind needs to be set to true or the equivalent settings overridden on the actor via UNetworkPhysicsSettingsComponent.

◆ CompareData() [2/2]

bool FNetworkPhysicsData::CompareData ( const FNetworkPhysicsPayload PredictedData) const
inlineoverridevirtual

Define how to compare client and server data for the same frame, returning false means the data differ enough to trigger a resimulation.

Parameters
PredictedDatais data predicted on the client to compare with the current data received from the server. NOTE: To use this function, CVars np2.Resim.CompareStateToTriggerRewind and/or np2.Resim.CompareInputToTriggerRewind needs to be set to true or the equivalent settings overridden on the actor via UNetworkPhysicsSettingsComponent.

Reimplemented from FNetworkPhysicsPayload.

◆ DebugData()

virtual const FString FNetworkPhysicsData::DebugData ( )
inlinevirtual

Return string with custom debug data

Reimplemented from FNetworkPhysicsPayload.

◆ DecayData()

virtual void FNetworkPhysicsData::DecayData ( float  DecayAmount)
inlineoverridevirtual

Use to decay desired data during resimulation if data is forward predicted.

Parameters
DecayAmount= Total amount of decay as a multiplier. 10% decay = 0.1. NOTE: Decay is not accumulated, the data will be in its original state each time DecayData is called. DecayAmount will increase each time the input is predicted (reused). EXAMPLE: Use to decay steering inputs to make resimulation not predict too much with a high steering value. Use DecayAmount of 0.1 to turn a steering value of 0.5 into 0.45 for example.

Reimplemented from FNetworkPhysicsPayload.

◆ DoInterpolateData()

void FNetworkPhysicsData::DoInterpolateData ( const FNetworkPhysicsPayload MinData,
const FNetworkPhysicsPayload MaxData 
)
inlineoverridevirtual

Temporary virtual function for backwards compatibility with FNetworkPhysicsData.Use the InterpolateData function that passes the LerpAlpha instead

Reimplemented from FNetworkPhysicsPayload.

◆ InterpolateData() [1/2]

virtual void FNetworkPhysicsData::InterpolateData ( const FNetworkPhysicsData MinData,
const FNetworkPhysicsData MaxData 
)
inlinevirtual

Define how to interpolate between two data points if we have a gap between known data.

Parameters
MinDatais data from a previous frame.
MaxDatais data from a future frame. EXAMPLE: We have input data for frame 1 and 4 and we need to interpolate data for frame 2 and 3 based on frame 1 as MinData and frame 4 as MaxData.

◆ InterpolateData() [2/2]

virtual void FNetworkPhysicsPayload::InterpolateData ( const FNetworkPhysicsPayload MinData,
const FNetworkPhysicsPayload MaxData,
float  LerpAlpha 
)
inlinevirtual

Define how to interpolate between two data points if we have a gap between known data.

Parameters
MinDatais data from a previous frame.
MaxDatais data from a future frame.
LerpAlphais the 0.0 - 1.0 value of where this data is between MinData and MaxData calculated as so: float LerpAlpha = (LocalFrame - MinData.LocalFrame) / (MaxData.LocalFrame - MinData.LocalFrame) EXAMPLE: We have input data for frame 1 and 4 and we need to interpolate data for frame 2 and 3 based on frame 1 as MinData and frame 4 as MaxData, for frame 2 LerpAlpha will be 0.33 and for frame 3 LerpAlpha will be 0.66

Reimplemented from FNetworkPhysicsPayload.

◆ MergeData() [1/2]

virtual void FNetworkPhysicsData::MergeData ( const FNetworkPhysicsData FromData)
inlinevirtual

Define how to merge data together

Parameters
FromDatais data from a previous frame that is getting merged into the current data. EXAMPLE: Simulated proxies might receive two inputs at the same time after having used the same input twice, to not miss any important inputs we need to take both inputs into account and to not get behind in simulation we need to apply them both at the same simulation tick meaning we merge the two new inputs to one input.

◆ MergeData() [2/2]

void FNetworkPhysicsData::MergeData ( const FNetworkPhysicsPayload FromData)
inlineoverridevirtual

Define how to merge data together

Parameters
FromDatais data from a previous frame that is getting merged into the current data. EXAMPLE: Simulated proxies might receive two inputs at the same time after having used the same input twice, to not miss any important inputs we need to take both inputs into account and to not get behind in simulation we need to apply them both at the same simulation tick meaning we merge the two new inputs to one input.

Reimplemented from FNetworkPhysicsPayload.

◆ operator=() [1/2]

FNetworkPhysicsData & FNetworkPhysicsData::operator= ( const FNetworkPhysicsData )
default

◆ operator=() [2/2]

FNetworkPhysicsData & FNetworkPhysicsData::operator= ( FNetworkPhysicsData &&  )
default

◆ operator==()

bool FNetworkPhysicsData::operator== ( const FNetworkPhysicsData Other) const
inline

◆ SerializeFrames()

void FNetworkPhysicsData::SerializeFrames ( FArchive Ar)
inline

◆ SetDeltaSourceData()

void FNetworkPhysicsData::SetDeltaSourceData ( FNetworkPhysicsData IntDeltaSourceData)
inline

◆ SetImplementationComponent()

void FNetworkPhysicsData::SetImplementationComponent ( UActorComponent InImplementationComponent)
inline

◆ SetImportant()

void FNetworkPhysicsData::SetImportant ( bool  bIsImportant)
inline

Set if this data is important(replicated reliably) or unimportant(replicated unreliably) NOTE: Default is to handle all inputs as unimportant, while one time events can be marked as important.

◆ ValidateData()

virtual void FNetworkPhysicsData::ValidateData ( const UActorComponent NetworkComponent)
inlinevirtual

Validate data received on the server from clients EXAMPLE: Validate incoming inputs from clients and correct any invalid input commands. NOTE: Changes to the data in this callback will be sent from server to clients.

Member Data Documentation

◆ DeltaSourceData

FNetworkPhysicsData* FNetworkPhysicsData::DeltaSourceData = nullptr

Pointer to a previous FNetworkPhysicsData which is valid during NetSerialize() to be used for delta serialization

◆ ImplementationComponent

PRAGMA_ENABLE_DEPRECATION_WARNINGS TStrongObjectPtr<UActorComponent> FNetworkPhysicsData::ImplementationComponent = nullptr

Thread safe pointer to the UActorComponent that implements the derived type of this data Note: This pointer can be accessed on both Game Thread and Physics Thread but you still need to ensure the read and write calls inside the UActorComponent are thread safe.


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