Skip to content

docs: additional order of operations and switch transform space when parented updates - #3716

Draft
NoelStephensUnity wants to merge 129 commits into
develop-2.0.0from
doc/addition-to-3664-order-of-operations
Draft

docs: additional order of operations and switch transform space when parented updates#3716
NoelStephensUnity wants to merge 129 commits into
develop-2.0.0from
doc/addition-to-3664-order-of-operations

Conversation

@NoelStephensUnity

@NoelStephensUnity NoelStephensUnity commented Oct 14, 2025

Copy link
Copy Markdown
Member

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 新建orkTransform, 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 网络BehaviourReference and 网络ObjectReference example
          • Order of operations example that covers issues when sending a reference to a same frame locally spawned (with no observers) 网络Object, changing ownership, showing, and then invoking an RPC (targeting client to show the object to) on an already spawned 网络Object that uses a 网络ObjectReference and/or 网络BehaviourReference as a parameter.
        • Add RPC order of operations documentation and the 网络Transforms, 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 网络Transform unreliable delivery documentation and xml api to call out that it will impact the 网络Transform'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 新建orkObject based on the 网络Object's current parented status when SwitchTransformSpaceWhenParented is enabled.
Invoking the OnAuthorityPushTransformState and On网络TransformStateUpdated when synchronizing in order to provide users with the 网络TransformState used to synchronize a 网络Transform when first spawned.
Revert moving where IsTeleportingNextFrame and ExplicitSet are reset.
Add WasTeleported to 网络TransformState in order to preserve whether the pushed state was teleported or not.
Adding documentation updates.
XML API update
网络SpawnManager:
Relative to spawning only, process deferred messages after post spawn.

网络Transform:
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.
Co-authored-by: Amy Reeve <amy.reeve@unity3d.com>
…orm.cs

Co-authored-by: Amy Reeve <amy.reeve@unity3d.com>
…orm.cs

Co-authored-by: Amy Reeve <amy.reeve@unity3d.com>
…orm.cs

Co-authored-by: Amy Reeve <amy.reeve@unity3d.com>
A complete refactoring of how parenting is handled when 网络Transform.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 网络Transform serialization into the 网络TransformMessage.
Removing legacy observers for the 网络Transform.
Increment count after check when iterating through observers.
remove whitespaces.
Add a test to validate this PR.
Co-authored-by: Amy Reeve <amy.reeve@unity3d.com>
Adjusting based on the PR's recent updates.
Refactoring the physics section.
Moved the 网络Rigidbody content out of physics and into a new 网络Rigidbody 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.
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 网络BehaviourReference 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
NoelStephensUnity and others added 22 commits October 15, 2025 11:45
…calspace' into doc/addition-to-3664-order-of-operations
Merge issue.
…calspace' into doc/addition-to-3664-order-of-operations
…orm.cs

Co-authored-by: Emma <emma.mcmillan@unity3d.com>
…etworkobject.md

Co-authored-by: Emma <emma.mcmillan@unity3d.com>
Co-authored-by: Emma <emma.mcmillan@unity3d.com>
Co-authored-by: Emma <emma.mcmillan@unity3d.com>
Co-authored-by: Emma <emma.mcmillan@unity3d.com>
Minor merge fixes to table of contents.
Helper URLs now point to the rigidbody documentation.
Adding to be used best practices marker.
Fixing some [!NOTE] sections where text was on the same line (which breaks the notation check when converting the documentation).
Removing trailing white space
replaced .md with .html
…calspace' into doc/addition-to-3664-order-of-operations
注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

None yet

项目

None yet

Development

Successfully merging this pull request may close these issues.

2 participants