Skip to content

feat: batched NetworkTransform synchronization, one message per tick (batched transforms 5/5) - #4235

Draft
NoelStephensUnity wants to merge 3 commits into
feat/batched-transform-4-state-reliabilityfrom
feat/batched-transform-5-batched-send-path
Draft

NoelStephensUnity wants to merge 3 commits into
feat/batched-transform-4-state-reliabilityfrom
feat/batched-transform-5-batched-send-path

Conversation

@NoelStephensUnity

@NoelStephensUnity NoelStephensUnity commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Purpose of this PR

Turns on the batched synchronization mode. With NetworkConfig.TransformSyncMode set to Batched, one Burst job checks every NetworkTransform for changes and the server sends one message per observing client per tick, instead of one message per instance. Batched mode can save up to ~54% of transform bandwidth. It is off by default and there are no breaking changes.

Stack (replaces #4123, review in order): #4231 math and handles → #4232 static delta check → #4233 native interpolator and sync mode setting → #4234 blittable state and reliability → #4235 batched send path. Each PR targets the branch of the one before it; the diff shown is that PR alone.

PR Scope:

  • NetworkTransformStateManager: owns the native state for registered instances, runs DetectTransformDeltaJob and InterpolateTransformJob, and assembles the batch per observing client.
  • NetworkTransformBatchMessage: carries every changed state for one client, keyed by the compact transform handle from feat: job-safe transform math and transform handle allocator (batched transforms 1/5) #4231.
  • NetworkManager captures TransformSyncMode when a session starts, so the value the session starts with applies for the whole session and a mid-session write has no effect.
  • NetworkTransform registers with the state manager in batched mode and serializes its transform handle on spawn.

What stays on the per-instance path

These are routed automatically, with no configuration, even when batched mode is on:

  • Distributed authority sessions (the CMB service does not handle the batched message yet).
  • Instances with client authority in a client-server session send per instance (only the server assembles batches). Their change detection still runs in the job.
  • Instances whose NetworkRigidbody uses "Use Rigidbody for Motion" (a job cannot read a Rigidbody's pose).
  • Nested NetworkTransform instances, which their parent already ticks.

NetworkTransform.UseUnreliableDeltas does not apply in batched mode. Delivery is decided per state update rather than per component.

Out of scope:

  • Further bandwidth savings, frame compression and latency compensation (next PR in the landing plan).
  • Distributed authority support for batching.

Jira ticket

N/A

Changelog

  • Added: NetworkConfig.TransformSyncMode, which determines whether NetworkTransform instances detect and synchronize their state individually or as a single batched message per tick.

Documentation

  • Will require documentation updates: a section covering NetworkConfig.TransformSyncMode, how to set it, that every peer has to match, and which instances stay on the per-instance path.

Testing & QA (How your changes can be verified during release Playtest)

  • NetworkTransformSyncModeParityTests runs the same scenarios through both modes and both authority models: motion, client-owned instances, teleports, NetworkHide/NetworkShow observer filtering, ownership changes, and despawn/respawn.
  • NetworkTransformSyncModeConfigurationTests checks the selected mode is the one used at runtime.

Playtest suggestion: run a scene with many moving NetworkTransform objects once in each mode and confirm motion looks identical. Include a NetworkRigidbody and a parented object, since those take the per-instance path.

Functional Testing

Manual testing :

  • Manual testing done

Automated tests:

  • Covered by existing automated tests
  • Covered by new automated tests

Does the change require QA team to:

  • Review automated tests?
  • Execute manual tests?
  • Provide feedback about the PR?

Up-port

N/A (develop-3.x.x only).

Backports

No backport is required.

Last of five PRs that replace #4123. With NetworkConfig.TransformSyncMode set to Batched, NetworkTransformStateManager detects changes for every registered instance in one Burst job, the server sends one NetworkTransformBatchMessage per observing client per tick, and non-authority instances interpolate in a job. Rigidbody driven and nested instances stay on the per-instance path. NetworkTransformSyncModeParityTests runs both modes side by side.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant