SFML community forums

Help => Network => Topic started by: firepro20 on December 05, 2019, 02:16:09 am

Title: Player Movement Interpolation / Prediction
Post by: firepro20 on December 05, 2019, 02:16:09 am
I am currently sending a UDP packet using sf::Packet type for data transmission.

What would be the ideal logic for interpolating between the last two packets received position and the current one? So it will be based on the last three data packets?

At the moment all I have is a send and receive packet on both server and client respectively.
Title: Re: Player Movement Interpolation / Prediction
Post by: eXpl0it3r on December 05, 2019, 09:58:29 am
You wouldn't really interpolate between packets, but you'd do a client side physics calculation and move your objects accordingly. Once the server response with a new data point, you set the correct position.

There's no "ideal logic" to this, but it all depends on your code.

Also here's an article that might be interesting to you: https://www.kinematicsoup.com/news/2017/5/30/multiplayerprediction