UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FNetworkPredictionData_Client_Character Class Reference

#include <CharacterMovementComponent.h>

+ Inheritance diagram for FNetworkPredictionData_Client_Character:

Public Member Functions

ENGINE_API FNetworkPredictionData_Client_Character (const UCharacterMovementComponent &ClientMovement)
 
virtual ENGINE_API ~FNetworkPredictionData_Client_Character ()
 
ENGINE_API void AddStructReferencedObjects (FReferenceCollector &Collector) const override
 
ENGINE_API int32 GetSavedMoveIndex (float TimeStamp) const
 
ENGINE_API void AckMove (int32 AckedMoveIndex, UCharacterMovementComponent &CharacterMovementComponent)
 
virtual ENGINE_API FSavedMovePtr AllocateNewMove ()
 
virtual ENGINE_API void FreeMove (const FSavedMovePtr &Move)
 
virtual ENGINE_API FSavedMovePtr CreateSavedMove ()
 
ENGINE_API float UpdateTimeStampAndDeltaTime (float DeltaTime, ACharacter &CharacterOwner, class UCharacterMovementComponent &CharacterMovementComponent)
 
- Public Member Functions inherited from FNetworkPredictionData_Client
 FNetworkPredictionData_Client ()
 
virtual ~FNetworkPredictionData_Client ()
 

Public Attributes

float ClientUpdateRealTime
 
float CurrentTimeStamp
 
float LastReceivedAckRealTime
 
TArray< FSavedMovePtrSavedMoves
 
TArray< FSavedMovePtrFreeMoves
 
FSavedMovePtr PendingMove
 
FSavedMovePtr LastAckedMove
 
int32 MaxFreeMoveCount
 
int32 MaxSavedMoveCount
 
uint32 bUpdatePosition:1
 
FVector OriginalMeshTranslationOffset
 
FVector MeshTranslationOffset
 
FQuat OriginalMeshRotationOffset
 
FQuat MeshRotationOffset
 
FQuat MeshRotationTarget
 
float LastCorrectionDelta
 
float LastCorrectionTime
 
float MaxClientSmoothingDeltaTime
 
double SmoothingServerTimeStamp
 
double SmoothingClientTimeStamp
 
float MaxSmoothNetUpdateDist
 
float NoSmoothNetUpdateDist
 
float SmoothNetUpdateTime
 
float SmoothNetUpdateRotationTime
 
float MaxMoveDeltaTime
 
FVector LastSmoothLocation
 
FVector LastServerLocation
 
float SimulatedDebugDrawTime
 
float DebugForcedPacketLossTimerStart
 

Additional Inherited Members

- Protected Member Functions inherited from FNoncopyable
 FNoncopyable ()
 
 ~FNoncopyable ()
 

Constructor & Destructor Documentation

◆ FNetworkPredictionData_Client_Character()

PRAGMA_DISABLE_DEPRECATION_WARNINGS FNetworkPredictionData_Client_Character::FNetworkPredictionData_Client_Character ( const UCharacterMovementComponent ClientMovement)

◆ ~FNetworkPredictionData_Client_Character()

PRAGMA_ENABLE_DEPRECATION_WARNINGS FNetworkPredictionData_Client_Character::~FNetworkPredictionData_Client_Character ( )
virtual

Member Function Documentation

◆ AckMove()

void FNetworkPredictionData_Client_Character::AckMove ( int32  AckedMoveIndex,
UCharacterMovementComponent CharacterMovementComponent 
)

Ack a given move. This move will become LastAckedMove, SavedMoves will be adjusted to only contain unAcked moves.

◆ AddStructReferencedObjects()

void FNetworkPredictionData_Client_Character::AddStructReferencedObjects ( FReferenceCollector Collector) const
overridevirtual

Allows references to be considered during GC

Reimplemented from FNetworkPredictionData_Client.

◆ AllocateNewMove()

FSavedMovePtr FNetworkPredictionData_Client_Character::AllocateNewMove ( )
virtual

Allocate a new saved move. Subclasses should override this if they want to use a custom move class.

◆ CreateSavedMove()

FSavedMovePtr FNetworkPredictionData_Client_Character::CreateSavedMove ( )
virtual

Tries to pull a pooled move off the free move list, otherwise allocates a new move. Returns NULL if the limit on saves moves is hit.

◆ FreeMove()

void FNetworkPredictionData_Client_Character::FreeMove ( const FSavedMovePtr Move)
virtual

Return a move to the free move pool. Assumes that 'Move' will no longer be referenced by anything but possibly the FreeMoves list. Clears PendingMove if 'Move' is PendingMove.

◆ GetSavedMoveIndex()

int32 FNetworkPredictionData_Client_Character::GetSavedMoveIndex ( float  TimeStamp) const

Finds SavedMove index for given TimeStamp. Returns INDEX_NONE if not found (move has been already Acked or cleared).

◆ UpdateTimeStampAndDeltaTime()

float FNetworkPredictionData_Client_Character::UpdateTimeStampAndDeltaTime ( float  DeltaTime,
ACharacter CharacterOwner,
class UCharacterMovementComponent CharacterMovementComponent 
)

Update CurentTimeStamp from passed in DeltaTime. It will measure the accuracy between passed in DeltaTime and how Server will calculate its DeltaTime. If inaccuracy is too high, it will reset CurrentTimeStamp to maintain a high level of accuracy.

Returns
DeltaTime to use for Client's physics simulation prior to replicate move to server.

Member Data Documentation

◆ bUpdatePosition

uint32 FNetworkPredictionData_Client_Character::bUpdatePosition

◆ ClientUpdateRealTime

float FNetworkPredictionData_Client_Character::ClientUpdateRealTime

Timestamp of last time it sent a servermove() to the server. This is an increasing timestamp from the owning UWorld (undilated, real time seconds). Used for holding off on sending movement updates to save bandwidth.

◆ CurrentTimeStamp

float FNetworkPredictionData_Client_Character::CurrentTimeStamp

Current TimeStamp for sending new Moves to the Server. This time resets to zero at a frequency of MinTimeBetweenTimeStampResets and increases with this component's tick delta time.

◆ DebugForcedPacketLossTimerStart

float FNetworkPredictionData_Client_Character::DebugForcedPacketLossTimerStart

Used for simulated packet loss in development builds.

◆ FreeMoves

TArray<FSavedMovePtr> FNetworkPredictionData_Client_Character::FreeMoves

◆ LastAckedMove

FSavedMovePtr FNetworkPredictionData_Client_Character::LastAckedMove

◆ LastCorrectionDelta

float FNetworkPredictionData_Client_Character::LastCorrectionDelta

Used for remembering how much time has passed between server corrections

◆ LastCorrectionTime

float FNetworkPredictionData_Client_Character::LastCorrectionTime

Used to track time of last correction

◆ LastReceivedAckRealTime

float FNetworkPredictionData_Client_Character::LastReceivedAckRealTime

Last World timestamp (undilated, real time) at which we received a server ack for a move. This could be either a good move or a correction from the server.

◆ LastServerLocation

FVector FNetworkPredictionData_Client_Character::LastServerLocation

◆ LastSmoothLocation

FVector FNetworkPredictionData_Client_Character::LastSmoothLocation

Values used for visualization and debugging of simulated net corrections

◆ MaxClientSmoothingDeltaTime

float FNetworkPredictionData_Client_Character::MaxClientSmoothingDeltaTime

Max time delta between server updates over which client smoothing is allowed to interpolate.

◆ MaxFreeMoveCount

int32 FNetworkPredictionData_Client_Character::MaxFreeMoveCount

◆ MaxMoveDeltaTime

float FNetworkPredictionData_Client_Character::MaxMoveDeltaTime

Max delta time for a given move, in real seconds Based off of AGameNetworkManager::MaxMoveDeltaTime config setting, but can be modified per actor if needed. This value is mirrored in FNetworkPredictionData_Server, which is what server logic runs off of. Client needs to know this in order to not send move deltas that are going to get clamped anyway (meaning they'll be rejected/corrected). Note: This was previously named MaxResponseTime, but has been renamed to reflect what it does more accurately

◆ MaxSavedMoveCount

int32 FNetworkPredictionData_Client_Character::MaxSavedMoveCount

◆ MaxSmoothNetUpdateDist

float FNetworkPredictionData_Client_Character::MaxSmoothNetUpdateDist

Copied value from UCharacterMovementComponent::NetworkMaxSmoothUpdateDistance.

See also
UCharacterMovementComponent::NetworkMaxSmoothUpdateDistance

◆ MeshRotationOffset

FQuat FNetworkPredictionData_Client_Character::MeshRotationOffset

Component space offset of the mesh. Used for rotation smoothing in net games.

◆ MeshRotationTarget

FQuat FNetworkPredictionData_Client_Character::MeshRotationTarget

Target for mesh rotation interpolation.

◆ MeshTranslationOffset

FVector FNetworkPredictionData_Client_Character::MeshTranslationOffset

World space offset of the mesh. Target value is zero offset. Used for position smoothing in net games.

◆ NoSmoothNetUpdateDist

float FNetworkPredictionData_Client_Character::NoSmoothNetUpdateDist

Copied value from UCharacterMovementComponent::NetworkNoSmoothUpdateDistance.

See also
UCharacterMovementComponent::NetworkNoSmoothUpdateDistance

◆ OriginalMeshRotationOffset

FQuat FNetworkPredictionData_Client_Character::OriginalMeshRotationOffset

Used for rotation smoothing in net games (only used by linear smoothing).

◆ OriginalMeshTranslationOffset

FVector FNetworkPredictionData_Client_Character::OriginalMeshTranslationOffset

Used for position smoothing in net games

◆ PendingMove

FSavedMovePtr FNetworkPredictionData_Client_Character::PendingMove

◆ SavedMoves

TArray<FSavedMovePtr> FNetworkPredictionData_Client_Character::SavedMoves

◆ SimulatedDebugDrawTime

float FNetworkPredictionData_Client_Character::SimulatedDebugDrawTime

◆ SmoothingClientTimeStamp

double FNetworkPredictionData_Client_Character::SmoothingClientTimeStamp

Used to track the client time as we try to match the server.

◆ SmoothingServerTimeStamp

double FNetworkPredictionData_Client_Character::SmoothingServerTimeStamp

Used to track the timestamp of the last server move.

◆ SmoothNetUpdateRotationTime

float FNetworkPredictionData_Client_Character::SmoothNetUpdateRotationTime

How long to take to smoothly interpolate from the old pawn rotation on the client to the corrected one sent by the server. Must be >= 0. Not used for linear smoothing.

◆ SmoothNetUpdateTime

float FNetworkPredictionData_Client_Character::SmoothNetUpdateTime

How long to take to smoothly interpolate from the old pawn position on the client to the corrected one sent by the server. Must be >= 0. Not used for linear smoothing.


The documentation for this class was generated from the following files: