Skip to content

refactor: blittable NetworkTransformState and reliability before serializing (batched transforms 4/5) - #4234

Draft
NoelStephensUnity wants to merge 2 commits into
feat/batched-transform-3-native-interpolator-and-sync-modesfrom
feat/batched-transform-4-state-reliability
Draft

NoelStephensUnity wants to merge 2 commits into
feat/batched-transform-3-native-interpolator-and-sync-modesfrom
feat/batched-transform-4-state-reliability

Conversation

@NoelStephensUnity

@NoelStephensUnity NoelStephensUnity commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Purpose of this PR

Makes NetworkTransformState blittable and decides its reliability before it is written, so a state can be queued and sent from native memory. The per-instance wire format is unchanged, and NetworkTransformStateBaselineTests pins it byte for byte.

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:

  • NetworkTransformState drops its reader and writer fields.
  • NetworkTransformState.UpdateReliability() derives ReliableSequenced before serializing, rather than inside NetworkSerialize. Behaviour change for reviewers: the half-float condition is now SynchronizeBaseHalfFloat rather than NetworkDeltaPosition.CollapsedDeltaIntoBase, so the serialized flag matches the delivery actually used.
  • NetworkTransform reaches its three interpolators through helper methods, and the per-frame interpolation values are computed once per update stage on NetworkManager instead of once per instance.
  • Fix: re-enabling a position axis that drifted out of half-float delta range while it was disabled now teleports. The per-axis check assigned its result instead of accumulating it, so an in-range axis discarded what an out-of-range one had found.

Out of scope:

Jira ticket

N/A

Changelog

  • Fixed: Re-enabling a NetworkTransform position axis that drifted out of half float delta range while it was disabled did not teleport.

Documentation

  • No documentation changes or additions were necessary.

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

  • NetworkTransformStateBaselineTests records the exact serialized bytes of a NetworkTransformState across every serialization branch. If the wire format changes, it fails and prints the new table; a wire format change should also bump the NGO protocol version.
  • The existing NetworkTransform integration tests cover the rest.

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.

…lity before serializing

Fourth of five PRs that replace #4123. NetworkTransformState drops its reader and writer fields so it can live in native memory, and UpdateReliability decides ReliableSequenced before the state is written. NetworkTransform routes its interpolators through helpers and computes its interpolation frame data once per update stage. NetworkTransformStateBaselineTests pins the serialized output.

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