Currently writing a system to do some client side prediction right now. Clients do actions which are then sent and replayed on the server, which then sends back the final positions back. Little stuck though because the UDP packets (well not really packets, I'm using Mirror's remote actions to send and receive data) that encode the various actions that my player character takes are being received out of order and its causing a lot of stuttering since if packet B is run before A, the compared final positions are gonna be completely different than what I'm expecting.
I'm brainstorming how to deal with this and the consensus seems to be:
- Keep sequence numbers and then always take the latest packet, throwing away any "older" packets that arrive later.
2. Send redundant packets to have a more comprehensive replica of button presses.
But my only problem is that the movement wont be replicated over 100% if that makes any sense. Is that expected? Is there a more standard approach to dealing with this?