Compression

DOTSNET is extremely fast. It’s so fast, that we are currently bandwidth limited. The more we optimize bandwidth, the more Entities we can sync over the network.

DOTSNET has a Compression class with a few helper functions likeDe/CompressQuaternion. Those can be used in NetworkMessage Serialize/Deserialize functions to compress data.

For example, writing a quaternion rotation usually takes 16 bytes:

public bool Serialize(ref BitWriter writer) =>
    writer.WriteQuaternion(rotation);

But most of the time we can compress it down to 4 bytes:

public bool Serialize(ref SegmentWriter writer) =>
    writer.WriteQuaternionSmallestThree(rotation);

If you run into bandwidth issues, you will understand why we go through the hassle of compression.

Last updated