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

#include <NetworkPhysicsComponent.h>

+ Inheritance diagram for FNetworkPhysicsPayload:

Public Member Functions

virtual ~FNetworkPhysicsPayload ()
 
virtual void InterpolateData (const FNetworkPhysicsPayload &MinData, const FNetworkPhysicsPayload &MaxData, float LerpAlpha)
 
virtual void MergeData (const FNetworkPhysicsPayload &FromData)
 
virtual void DecayData (float DecayAmount)
 
virtual bool CompareData (const FNetworkPhysicsPayload &PredictedData) const
 
virtual const FString DebugData ()
 
virtual const FString DebugData () const
 
void PrepareFrame (int32 CurrentFrame, bool bIsServer, int32 ClientFrameOffset)
 
virtual void DoInterpolateData (const FNetworkPhysicsPayload &MinData, const FNetworkPhysicsPayload &MaxData)
 

Public Attributes

int32 ServerFrame = 0
 
int32 LocalFrame = 0
 
bool bDataAltered = false
 
bool bReceivedData = false
 
bool bImportant = false
 

Detailed Description

START Iris Compliant Data

Constructor & Destructor Documentation

◆ ~FNetworkPhysicsPayload()

virtual FNetworkPhysicsPayload::~FNetworkPhysicsPayload ( )
inlinevirtual

Member Function Documentation

◆ CompareData()

virtual bool FNetworkPhysicsPayload::CompareData ( const FNetworkPhysicsPayload PredictedData) const
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.

Reimplemented in FNetworkPhysicsData.

◆ DebugData() [1/2]

virtual const FString FNetworkPhysicsPayload::DebugData ( )
inlinevirtual

Return string with custom debug data

Reimplemented in FNetworkPhysicsData.

◆ DebugData() [2/2]

virtual const FString FNetworkPhysicsPayload::DebugData ( ) const
inlinevirtual

◆ DecayData()

virtual void FNetworkPhysicsPayload::DecayData ( float  DecayAmount)
inlinevirtual

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 in FNetworkPhysicsData.

◆ DoInterpolateData()

virtual void FNetworkPhysicsPayload::DoInterpolateData ( const FNetworkPhysicsPayload MinData,
const FNetworkPhysicsPayload MaxData 
)
inlinevirtual

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

Reimplemented in FNetworkPhysicsData.

◆ InterpolateData()

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 in FNetworkPhysicsData.

◆ MergeData()

virtual void FNetworkPhysicsPayload::MergeData ( const FNetworkPhysicsPayload 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.

Reimplemented in FNetworkPhysicsData.

◆ PrepareFrame()

void FNetworkPhysicsPayload::PrepareFrame ( int32  CurrentFrame,
bool  bIsServer,
int32  ClientFrameOffset 
)
inline

Member Data Documentation

◆ bDataAltered

bool FNetworkPhysicsPayload::bDataAltered = false

◆ bImportant

bool FNetworkPhysicsPayload::bImportant = false

◆ bReceivedData

bool FNetworkPhysicsPayload::bReceivedData = false

◆ LocalFrame

int32 FNetworkPhysicsPayload::LocalFrame = 0
mutable

◆ ServerFrame

int32 FNetworkPhysicsPayload::ServerFrame = 0

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