Synchronization Architecture
Nitrox uses a server-authoritative model where the server maintains the canonical game state and broadcasts updates to all clients.Packet-Based Communication
All synchronization happens through typed packet classes that inherit from
Packet. Over 130 different packet types handle various synchronization scenarios.Network Delivery Methods
Packets use different delivery guarantees based on their importance:Delivery Methods
Delivery Methods
- UNRELIABLE_SEQUENCED: Fast, no guarantee (movement, animations)
- RELIABLE_ORDERED: Guaranteed delivery in order (stats, inventory)
- RELIABLE_ORDERED_LAST: Only latest packet matters (metadata updates)
- RELIABLE_UNORDERED: Guaranteed but order doesn’t matter (entity spawns)
What Gets Synchronized
Players
Everything about each player is synchronized in real-time: Movement & Position- Equipment and held items (
PlayerHeldItemChanged) - Quick slot bindings (
PlayerQuickSlotsBindingChanged) - Death events (
PlayerDeathEvent) - Vehicle/base entry and exit (
SubRootChanged,EscapePodChanged) - Animations (
AnimationChangeEvent) - Bench/chair usage (
BenchChanged)
Entities
All world entities are synchronized including their transforms and metadata. Transform Updates- RawTransformUpdate: Direct position/rotation
- SplineTransformUpdate: Interpolated movement with velocity
Spawning
EntitySpawnedByClient - Client requests entity spawn (e.g., dropped item, constructed object)Vehicles
Vehicles have specialized synchronization for complex interactions:Seamoth
- Position and rotation
- Module states
- Docking/undocking
- Health and power
Exosuit (PRAWN)
- Arm actions (drilling, grappling)
- Jump jet usage
- Storage and modules
- Docking states
Cyclops
- Damage points and fires
- Fire suppression
- Decoy launches
- Lighting modes
- Horn and sonar
CyclopsDamage- Hull integrity and damageCyclopsFireCreated- Fire outbreak locationsCyclopsFireSuppression- Extinguishing firesCyclopsDamagePointRepaired- Welding damage pointsCyclopsDecoyLaunch- Decoy tube activationPlayerInCyclopsMovement- Player walking inside Cyclops
Base Building
Base construction is synchronized with safety checks to prevent desynchronization: Build PacketsPlaceBase- New base piece constructedUpdateBase- Base piece modified (e.g., hatch opened)BaseDeconstructed- Base piece removedDeconstructionBegin- Deconstruction started
Inventory & Storage
Items in containers, player inventories, and vehicle storage are synchronized:- Item pickup and drop events
- Container contents
- Crafting and construction
- Battery/power cell charge states
- Food/water decay
Creatures & AI
Creature state is partially synchronized: Synchronized:- Spawn locations and types
- Creature metadata (health, home position)
- Attack targets and aggression states
- Death and respawn
- Exact real-time positions (too bandwidth-intensive)
- Individual swim paths
- Animations (predicted locally)
Creatures may appear in slightly different positions for each player, but important state like being killed is synchronized.
World Events
Story Progression- Aurora explosion timing
- Sunbeam arrival and outcome
- Radio messages and triggers
- Precursor facilities (doors, terminals, teleporters)
- Time of day and elapsed time
- Aurora radiation state
- Spawned entities and resources
- World cell loading/unloading
Packet System
All synchronization uses the packet system defined inNitrox.Model.Subnautica.Packets.
Example Packet Types
Player Packets (23 types)
Player Packets (23 types)
PlayerMovementPlayerStatsPlayerHeldItemChangedPlayerQuickSlotsBindingChangedPlayerDeathEventPlayerJoinedMultiplayerSessionPlayerKickedPlayerTeleported- And 15 more…
Vehicle Packets (12 types)
Vehicle Packets (12 types)
VehicleMovementsVehicleDockingVehicleUndockingVehicleOnPilotModeChangedCyclopsDamageCyclopsFireCreatedExosuitArmActionPacketSeamothModulesAction- And 4 more…
Entity Packets (8 types)
Entity Packets (8 types)
EntitySpawnedByClientEntityTransformUpdatesEntityMetadataUpdateEntityReparentedEntityDestroyed- And 3 more…
Base Building Packets (7 types)
Base Building Packets (7 types)
PlaceBaseUpdateBaseBaseDeconstructedDeconstructionBeginBuildingResyncBuildingResyncRequestBuildingDesyncWarning
Packet Processors
Each packet type has a corresponding processor on both client and server:Simulation Ownership
Nitrox uses a simulation ownership system to determine which player’s client simulates certain entities:- Prevents conflicts when multiple players interact with the same entity
- Owner’s client sends authoritative updates
- Ownership can transfer (e.g., when another player grabs an item)
- Server tracks ownership in
SimulationOwnershipData
Some packets are throttled to prevent bandwidth overload. The
ThrottledPacketSender batches updates.Cell-Based Streaming
The world is divided into cells that load/unload based on player proximity:CellVisibilityChanged- Player enters/exits a cell’s range- Entities only synchronized when in visible cells
- Reduces bandwidth for large worlds
- Server tracks which cells each player can see
Initial Sync
When a player joins, they receive the complete world state:
The initial sync can take 30-120 seconds depending on world complexity.
Performance Optimization
Nitrox optimizes synchronization through:- Unreliable packets for non-critical data (movement, animations)
- Delta compression for repeated data
- Cell-based streaming to limit entity count
- Throttling for high-frequency updates
- Entity caching to speed up world loading
Related Pages
Multiplayer
Player sessions and connection management
World Management
How synchronized state is persisted
Communication
Chat and commands for coordination
