Calculating Ping | As exact as possible

Hey guys,

I just noticed that with lower frame per second, my calculated ping increases, likely due to the lower intervall of triggering RPC’s.
I need very exact ping for my Physics Rewind & Replay System, that provides input-latency free, server-authoritve physics prediction.
The system works fine on low FPS, where the ping is calculated more precisely.

Any ideas on how to exclude the FPS influence from the ping? I need the exact time it takes the client so send a package to the server, for syncing local and server-physics.

As a reference, with 60 FPS, 80ms ping (160ms roundtrip) increase to 200ms roundtrip, and with 25fps to 270ms roundtrip. When I set the physics-rewind forwarding amount manually to 160ms (80ms*2), it works very very smooth, but with 200ms, it fast-forwards too much, leading to inaccurate position calculation and jiggeling at too high correction intervalls :frowning:

Are you calculating ping yourself? This is already done by the engine. I think it’s GameState->GetServerTime() or something similar. Ping means roundtrip btw (time from computer to server and back). CharacterMovementComponent does rewind logic so you could take a look there for a working example.

These calculations aren’t normally done per frame, so if you’re using the built in functions this shouldn’t matter.