Hi!, I'm currently developing a deterministic racing game and I have encountered a problem I can't seem to figure out the best solution for it.
In the client side every fixed time tick I perform client side prediction and store the result in history buffer,
than whenever the client receives an update from the server it perform reconciliation.
Reconciliation pseudo code:
- Discard old inputs
- Check if the diff between client state and server state is too big
- If true rerun client inputs on the received server state
- Than snap player to the received state
My problem is sometimes the diff is too big (Different computers usually causes this) and then the snapping is too harsh, I tried to interpolate the client state towards the server state but I don't have a lot of time because the next client tick is coming and client side prediction is run, so even if I interpolate it looks harsh and if I just interpolate until the next tick happens and then continue from there although the divergence is still there(only smaller),
Is there a better way to perform this? (Client and server run at 60 fps)
I tried to snap the player to the server position even if the diff is small in order to prevent the divergence from getting too big, I also tried to separate the collider and the visual representation, run prediction and snapping on the collider and always interpolate the visual to the collider but it gave the player a laggy feel
Thanks a lot