From what I understand using delta compression requires me to keep track of the player last acknowledged state on the server ...Without delta compression I'm assuming I can just blast state at the player and they can fix the ordering using the tick/frame number?
Using compression could see me successfully send an update to the player (say from frame 100 to 101), but the ack gets dropped somewhere along the way (red part of diagram below). The player is now in state 101 but is getting sent a delta of 100->102.
What's the fix for this:
- Send the delta of 100->102 and have the player client apply the delta to a past frame state to calculate the new state.
- If the players ack is missing on the next Update() send the delta of the last acked frame the server knows about + all the delta's between last acked frame and the current frame and let the player work out which ones it needs to apply (so in the above example: 100-> 101 + 101-> 102)... and hope it's not too big.
- The server acks the players ack and have the player re-send if it's ack timesout?
- Stop the world if the don't get the player ack, resend the data and wait (this seems like it drags all other connections down due to one players bad connection)
- Don't use delta compression and just blast compressed state at the player, letting the player accommodate for any missing state.
- Something else?
simulation net player
+-------+ +-------+ +-------+
| state | |
|Update();+----------->for players: |
| | send {last_frame, frame, delta_state} |
| +------------------------------------------>----
| | | |update local state
| | Ack(Frame);| |
| <------------------------------------------+<---
| | |
| +------+ |
| | |store last acked frame |
| | |for player |
| <------+ |
| | |
+ + +