Skip to content

Conversation

NoelStephensUnity
Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity commented Oct 14, 2025

Purpose of this PR

This PR is a documentation extension PR from #3664.

Jira ticket

MTTB-1584
MTT-10092

Changelog

  • Added: TBD

Documentation Included

  • Includes new documentation sections.

WIP Documentation

  • Add a "Netcode best practices" section (covers message delivery, order, states & events, timing, and cost).
  • Order of operations (under Netcode best practices)
    • Message delivery
      • Reliable Fragmented Sequenced
        • The sequenced portion assures messages are received in order
      • Add note about using a different network delivery can impact the order of operations.
        • Include some example scenarios of how changing the network delivery can impact the order of operations (include references to NeworkTransform, Rpcs, named, and unnamed messages).
    • Message queue order
      • What it is and when messages are queued vs deferred to be generated at the end of the frame.
    • Netcode script & message order
      • State updates and events
        • Everything boils down to messages
        • Local vs netcode states and events
      • Script order dictates message order
        • Messages are sent in the order they were created.
          • Messages are received in the order they were created on the sender's side.
      • Examples of how script can cause issues:
        • Add NetworkBehaviourReference and NetworkObjectReference example
          • Order of operations example that covers issues when sending a reference to a same frame locally spawned (with no observers) NetworkObject, changing ownership, showing, and then invoking an RPC (targeting client to show the object to) on an already spawned NetworkObject that uses a NetworkObjectReference and/or NetworkBehaviourReference as a parameter.
        • Add RPC order of operations documentation and the NetworkTransforms, parenting, ownership, and more.
        • Provide examples of issues with the solutions to resolving the issues.
    • Message cost
      • Observer vs no observer spawning and message cost.
      • Netcode design approach & message cost.
  • Look for areas in existing documentation that makes sense to link back to appropriate sections in the Order of operations section.
  • Update NetworkTransform unreliable delivery documentation and xml api to call out that it will impact the NetworkTransform's order of operations (when applied vs things like parenting, owenrship, etc).

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

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?

If any boxes above are checked the QA team will be automatically added as a PR reviewer.

Backports

This PR is only for v2.x.

NoelStephensUnity and others added 30 commits September 9, 2025 18:09
Assure that the local InLocalSpace field is updated to match the parented status.
Reset IsTeleporting and ExplicitSet after invoking OnAuthorityPushTransformState so these values are preserved for user script.

Automatically adjust InLocalSpace when spawning a NeworkObject based on the NetworkObject's current parented status when SwitchTransformSpaceWhenParented is enabled.
Invoking the OnAuthorityPushTransformState and OnNetworkTransformStateUpdated when synchronizing in order to provide users with the NetworkTransformState used to synchronize a NetworkTransform when first spawned.
Revert moving where IsTeleportingNextFrame and ExplicitSet are reset.
Add WasTeleported to NetworkTransformState in order to preserve whether the pushed state was teleported or not.
Adding documentation updates.
XML API update
NetworkSpawnManager:
Relative to spawning only, process deferred messages after post spawn.

NetworkTransform:
Synchronize the SwitchTransformSpaceWhenParented flag when it changes on the authority side.
Perform an early check in CheckForStateChange for changes to SwitchTransformSpaceWhenParented.
Apply changes to SwitchTransformSpaceWhenParented when processing a state update on non-authority instance.
A complete refactoring of how parenting is handled when NetworkTransform.SwitchTransformSpaceWhenParented is enabled to provide a complete 1:1 match of (n) back-to-back parenting actions and/or many parenting actions that occur over several frames. This preserves the order of operations, sends 1 full state update plus an added parenting directive per action immediately, and then upon receiving the non-authority instances will apply the parenting, transform the local values and interpolators' queued entries  between transform spaces (world to local, local to world, or local to local).
Standards/style fix.
More hidden white spaces...
Removing one line space
Adding change log entry.
Check if writing as binary resolves the CRLF issue.
Reverting last change.
Removing a single line of code.
Migrating all NetworkTransform serialization into the NetworkTransformMessage.
Removing legacy observers for the NetworkTransform.
Increment count after check when iterating through observers.
remove whitespaces.
Add a test to validate this PR.
Adjusting based on the PR's recent updates.
Refactoring the physics section.
Moved the NetworkRigidbody content out of physics and into a new NetworkRigidbody section under componetns.
Moved physics up to the components layer.
Did a large update to the physics documentation and provided an additional walk through of  how to "parent" physics bodies using attachables.
This resolves the broken half float issue.
Fixing issue with synch when SwitchTransformSpaceWhenParented is disabled.
Allow a full teleport when using SwitchTransformSpaceWhenParented.
This refactors the previous "fix" to preserve the teleport flag but also keeps the original logic which is needed for when SwitchTransformSpaceWhenParented is disabled.
This includes a more modular framework for generating order of operation sequences in order to create a wide range of tests that validate specific order of operation actions are processed and applied on the non-authority instances as they were on the authority instance.
Updated the order of operations test to include 10 of the 11 spawn sequence ordering tests.
Added `NetcodeIntegrationTest.SpawnObjectInstance` that allows you to create an instance of a prefab and pass the instance in to be spawned through the normal integration test spawn process.
Removing single white space after an (internal) comment...
removing more whitespace.
Some general clean up and separating areas of the NetworkTransformOrderOfOperations by region to help with navigating through the different parts.
Adding the 11th test to the order of operations test.
Adding missing change log entry.
Check on the receiving side of the `ReferenceTeleportRpc` call that only the motion authority applies the teleport.
Moving the motion authority check within the check to assure the SpawnSequenceController NetworkBehaviourReference is valid.
Updated some XML API documentation and corrected a typo in a comment.
@NoelStephensUnity NoelStephensUnity changed the title doc: addition to 3664 order of operations docs: addition to 3664 order of operations Oct 14, 2025
@NoelStephensUnity NoelStephensUnity changed the title docs: addition to 3664 order of operations docs: additional order of operations and switch transform space when parented updates Oct 14, 2025
@NoelStephensUnity NoelStephensUnity changed the title docs: additional order of operations and switch transform space when parented updates docs: additional order of operations and switch transform space when parented updates Oct 14, 2025
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.

2 participants