We are building multiplayer game where there's no central server managing the game.
Each player is responsible for sending out its state to all connected players.
In addition, all clients run prediction between received packets, to keep all objects moving in between state packets.
We also smooth out the positiobs received from remote clients, for example in scenarios where the received oosition is small enough and should be moved smoothly from the current predicted position.
The issue I am trying to handle is how should the algorithm behave in case it hasn't finished smoothing out the position yet, and a new state is being received?
The smoothing algorithm currently operates for a given configured duration (e.g: 80 ms). Should a new incoming state cancel the ongoing smoothing? What is done in such cases?
One option is to never reset started smoothing, that is, run for the whole 80 ms, but update the target position in case new state is received.
Another option would be to reset (start the 80 ms count all over again. This time with the new start/end positions).
Both options have their issues. I am wondering whether there's a formal way to deal with this.