At the moment, I have the basics working. But, It doesn't account for delay from server to client, so when i receive a gamestate (delta or snapshot) It applies it as the current gamestate.
I'm now trying to remember our discussion earlier..
Leaving input prediction until later, is this correct:
- Store all received gamestates from the server. This is part of the networking just to set the last received gamestate
- Calling this every frame; Extrapolate using two or three game states to determine what the server's gamestate should look like at the current tick. And store this as simulated every tick.
- When you receive a gamestate, get the delta between the simulated gamestate for that tick and the server's gamestate, and then apply the delta.