Compression and batching are a frequently used techniques for lower network traffic and latency. So when using NGO RPCs and NamedMessageChannel/UnnamedMessageChannel, or should say when using FastBufferWriter/Reader, is the data compressed or batched in the low-level of NGO or UnityTransport? Do I need to impl them on my own ?
NGO does not expose any compression-related API methods or parameters beyond using FastBufferWriter/Reader for serialisation and deserialisation.
To confirm, when you say at the low level, do you ask if we are doing any deeper compression in the black box that isn’t exposed to the user?
According to my tests, it’s entirely up to you.
It’s absolutely crucial to send large batches of data at once rather than to rely on individual Network* behaviour components.
For example in my test case, 100 units with 100 NetworkTransform (with most efficient transmission settings, ie delta + half float) will consume ~5 times as much bandwidth as a single named message with a serialized stream of the transform data, using the BytePacker utility methods. I think I was also sending half float position/rotation values.
You can then further compress the byte array using BrotliStream for instance so that the bandwidth is 10-20 times less than those 100 individual NetworkTransform components.
The most optimal solution would be a funnel for all network synchronized data, then pack and compress it, and on the receiving side distribute the data to their targets. So if you want the absolute control over your data you may end up using very little of NGO (connection setup, approval, scene management in my case and Network* components for quick prototyping).
Yes! I mean in the low Transport level, would data be sent as-is to what FastBufferWrier outputs, or is there any default compression or batching.
In my own case, I’m considering frequently updated values. Can I just send message to message channel with no scruples and trust NGO to do the compression and batching or I’d better do these on my side. But thanks to @CodeSmile 's reply I think this should be done on my side.