DOTSNET
  • Documentation
  • Overview
    • Installation
    • Recommended Reading
    • Platforms
    • Changelog
  • Examples
    • Benchmark
    • Chat
    • Pong
    • Physics
  • User Manual
    • Migrating from Mirror
    • Authoring
    • Server & Client Worlds
    • Selective System Authoring
    • Dependency Injection
    • NetworkMessage
    • NetworkServerSystem
    • NetworkClientSystem
    • NetworkIdentity
    • NetworkComponent
    • PrefabSystem
    • NetworkReader/Writer
    • Bitpacking
    • Authentication
    • Interest Management
    • Transports
    • Networking & Burst
    • Networking & Jobs
    • Compression
    • Utilities & Extensions
    • Unity.Physics Support
    • Hybrid Renderer V2 / URP
    • Benchmarks
Powered by GitBook
On this page
  1. User Manual

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.

PreviousNetworking & JobsNextUtilities & Extensions

Last updated 4 years ago