3 ms·
If you get your data small enough to fit multiple updates into a single packet, you can send the last N updates in each packet. If your updates are bigger; you
by toast0 4y ago
If you get your data small enough to fit multiple updates into a single packet, you can send the last N updates in each packet.
If your updates are bigger; you probably will end up with seqs, acks and retransmitting of some sort, but you may be able to do better than sending a duplicate of the missed packet.
- hpx7 4y agoExactly, you assign a sequence number to each update, have the client send acks to convey which packets it has received, and the server holds onto and sends each unacked update in the packet to clients (this is an improvement over blindly sending N updates each time, you don't want to send updates that you know the client has already received). If the client misses too many frames the server can send it a snapshot (that way the server can hold a bounded number of old updates in memory).
- shepherdjerred 4y agoYou just described TCP
- hpx7 4y agoIt's close but TCP will retransmit frames rather than packing multiple updates in a single frame. It's common for people to build this kind of retransmission logic on top of UDP (especially for networked games), it's sometimes referred to as "reliable UDP".
- vvanders 4y agoTCP forces sequencing across all packets, SCTP is a bit closer.
- xyzzyz 4y agoIt’s not TCP, it’s TCP without head-of-line blocking, which makes it much more suitable for real time games.