GameNetworkingSockets icon indicating copy to clipboard operation
GameNetworkingSockets copied to clipboard

API to disable retry for reliable messages (outdated messages)

Open YintheCloud opened this issue 1 year ago • 2 comments

I want to implement a data replication system where data is one way replicated from server to client. Replicating data like unit positions should be reliable, while occasional data loss is acceptable. So whenever a new replication message is sent, older messages will no longer perform retransmission. (The last message will need to be reliable so the unit won't stay at wrong places on clients).

YintheCloud avatar Dec 12 '24 01:12 YintheCloud

This is very interesting and a good usecase. Some ideas:

  • Reliable latest only: The sender only transmits the newest message, not caring about earlier missed acks. The receiver doesn't care about gaps in packet ids. The receiver tracks the highest packet id and drops all packets with id lower than or equal that (to combat duplication or out of order packets). This version is good for saving bandwidth on infrequent updates.

  • Decaying: Messages have a configurable lifetime. If their lifetime is exceeded, they are not allowed to be transmitted again. This is useful in both unreliable and reliable messages. Of course, on decaying reliable messages the receiver needs to not care for packet gaps either. This version is good for frequent updates and using the virtual channel for more than one type of message.

alexdesander avatar Dec 13 '24 17:12 alexdesander

I would also be quite interested on that. It is quite useful when you want to send full state updates.

I have used it with LiteNetLib and with ROS2

https://github.com/RevenantX/LiteNetLib https://docs.ros.org/en/rolling/Concepts/Intermediate/About-Quality-of-Service-Settings.html#qos-policies

jmarchalgomez avatar Jun 08 '25 21:06 jmarchalgomez