Has anyone ever done a dead reckoning multiplayer?

I must say I have now well understood how the three.js game engine work, the original author multiplayer methods is just sending the next player position of avatar or vehicle when driving, but the lag is just too great by leaving it to the cannon.js to navigate the avatars or drive the vehicle to the locations and it’s also very expensive to performance, I thought about the dead reckoning methods where the player send real time location and by the time it is received by the other players the location is seconds too late, so the dead reckoning methods instead of the real-time location it calculate the predicted position latency seconds advance making it look like real-time.

I anyone had work at this or have an idea would be great.

Dead reckoning could be an improvement, but in my experience, if your latency is high (1 second is high) then the dead reckoning can cause a lot of snapping when the remote player does movement inputs during a network frame.

But your instinct is good… what I would do is transmit the .position and .orientation, and inputs, as efficiently and fast as you can… So make your latency a settable parameter.. like “network_tick_rate_msec = 100” or something.

Then, you “debounce” the players input.. so only sends a new packet if the player has moved a certain distance or hit some input keys..
If they have, then the network stream is woken up, and starts transmitting at a roughly constant rate, like 10 fps.

On the receiving side, you interpolate with a 100msec window into the past, so that things move smoothly between keyframes.

a sample code or repo would really help, i am imagining it but couldn’t put together how it should be done on code

If you’re using an LLM, just paste it the link to this thread. :smiley: It can figure it out.

Or point it at this link:

specifically the server + client section

( The source repo to the engine you linked is only a week old, so I doubt many people will have specific experience with it. )

we already spent a fortune to make the repo public so more developers can help us, LLMs had been great help deconstructing the repo, the author refused to help except sharing it, so we have figured it out, the dead reckoning algorithm would be a great replacement for the existing multiplayer method that uses cannon.js on every character and vehicle, this kills the performance.

Here is a test, i think the jittering is bearly noticeable.

I can definitely see it. Hard to tell if its because of framerate, or because of lack of network packet interpolation. It looks like lack of interpolation to me tho.

It looks extremely jittery? Why not interpolate the samples in the past?