Sending state diffs (deltas) and unreliable connections
Posted
by
spaceOwl
on Game Development
See other posts from Game Development
or by spaceOwl
Published on 2013-10-28T22:09:19Z
Indexed on
2013/10/28
22:14 UTC
Read the original article
Hit count: 261
We're building a realtime multiplayer game, in which each player is responsible for reporting its state on every iteration of the game loop.
The state updates are broadcasted using unreliable UDP.
To minimize state data sending, we've come up with a system that will send only deltas (whatever state data that was changed).
This method however is flawed, since a lost packet will mean that other players will not receive the delta, making the game behave in an unexpected way.
For example:
Assume that state is comprised of: { positionX, positionY, health }
Frame 1 - positionX changed --> send a packet with positionX only.
Frame 2 - health changed // lost !
Frame 3 - positionY changed --> send a packet with positionY only.
// Other players don't know about health change.
How can one overcome this issue then? sending the entire data is not always feasible.
© Game Development or respective owner