2 ms·
So would it have worked better to send the entire game state every frame/every N frames/etc so that a dropped UDP packet would not totally trash the game? I do
by paulmd 10y ago
So would it have worked better to send the entire game state every frame/every N frames/etc so that a dropped UDP packet would not totally trash the game? I don't know what the maximum frame size is for UDP.
- TD-Linux 10y agoYou can only assume a MTU of about 1500 bytes, unfortunately. However, instead of sending each packet effectively twice as in the original article, you can use FEC to require only 2 of 3 packets to be received for example [1]. But yeah, WebRTC for example also effectively implements resending the whole state - if you get too far behind, the receiver can request a video keyframe from the sender. [1] https://tools.ietf.org/html/rfc5109 https://tools.ietf.org/html/rfc5109
- hashmal 10y agoThat's what Valve is doing for their games (see their Source engine docs.) However, you don't always send the entire "world", but a delta-encoded version of it (the server keeps a history of the world state and a timestamp for each client, so it can send only what has changed since the last acknowledged packet.) Depending on the game you have to do a bit more work (interpolating changes so it always looks smooth even if packets are dropped, latency compensation, etc.)