Im implementing my very own model of consumer prediction and server reconciliation for a customized pawn in unreal engine 5, since i couldnt use the default unreal character for my wants, because it forces you into utilizing a capsule collision element as a root element which i dont wish to use. So every little thing went positive up till I got here throughout consumer and server state desync, which from what i understood could be brought on by RTT fluctuations and/or packet loss (or possibly even body charge drops however im not totally positive but). Mainly the system i’ve now works sort of like this:
- Consumer has a buffer with all pending states unacked by the server
- Each tick (which isnt mounted) consumer domestically simulates motion and sends a brand new state to the server
- Server receives the brand new state and provides it to its personal unacked states buffer
- Each tick (which is mounted to say 60 TPS) server iterates by way of the unacked state buffer and simulates domestically with the enter and delta time offered within the state, it does this as many instances as there are consumer state delta instances that match inside the server time per tick (say 1 / 60 seconds), acking and eradicating every state from the buffer
- Whereas acking all of the strikes server additionally checks their validity and in case of any error sends a correction RPC again to the consumer
- After the server is completed processing all of the states within the the buffer or they attain the time per tick threshold the server sends the ultimate state again to the consumer so the consumer can take away the already acked states in its buffer
My downside proper now could be discovering out why precisely that occurs and that when the consumer inevitably will get too far into the long run from the server, there isn’t a method of reliably correcting this error because the ping/framerate are all the time fluctuating and the consumer appears to all the time be in a desynced state.
Any concepts on what can be the very best plan of action on this scenario?