So, for the sake of ease it is best to treat the latest incoming data as the current data.
How would one run a jitter buffer for this without doing something involving clock sync?
The predictions I send to the server will be the results of the inputs, therefore I'd only need to timestamp them to help prevent speed-hacking (I'd only need to know how long the inputs were processed for.)
In light of the fact that I'd need to re-simulate physics, I've decided to temporarily switch to another Python-based engine which gives me this ability, so that I can get the foundations working. Does this look like a permissible gameloop?
- Receive network data.
- Apply any corrections to physics data - there would have to be "real" positions and "render" positions, although this would make things more complex so I may just use interpolated positions for non-authority gameobjects.
- Tick physics (perhaps a number of times if there are a number of saved moves).
- Run simulation from inputs.
- Tick Physics
- Send results to server (with timestamp) -> delta = last_timestamp - current timestamp