-
Notifications
You must be signed in to change notification settings - Fork 458
fix: networktransform SwitchTransformSpaceWhenParented forces updates when InLocalSpace is true #3664
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop-2.0.0
Are you sure you want to change the base?
Conversation
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.
…e-forcing-updates-localspace
…calspace' of https://github.com/Unity-Technologies/com.unity.netcode.gameobjects into fix/networktransform-autoswitchspace-forcing-updates-localspace
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left suggestions on the smaller changes - have pushed a commit with changes to the larger new additions to the NetworkTransform page, mostly just trying to improve clarity and reduce verbiage.
This page is getting very long, might break it up at some point, but will do that in a separate PR.
com.unity.netcode.gameobjects/Documentation~/components/core/networkobject.md
Outdated
Show resolved
Hide resolved
com.unity.netcode.gameobjects/Documentation~/components/core/networkobject.md
Outdated
Show resolved
Hide resolved
com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs
Outdated
Show resolved
Hide resolved
com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs
Outdated
Show resolved
Hide resolved
com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs
Outdated
Show resolved
Hide resolved
com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs
Outdated
Show resolved
Hide resolved
com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs
Outdated
Show resolved
Hide resolved
com.unity.netcode.gameobjects/Runtime/Components/NetworkTransform.cs
Outdated
Show resolved
Hide resolved
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.
…calspace' of https://github.com/Unity-Technologies/com.unity.netcode.gameobjects into fix/networktransform-autoswitchspace-forcing-updates-localspace
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>
…e-forcing-updates-localspace
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).
/ci ngo |
/ci ngo |
More hidden white spaces...
/ci ngo |
/ci ngo |
…e-forcing-updates-localspace
Co-authored-by: Amy Reeve <amy.reeve@unity3d.com>
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.
Adding one suggested change I left out.
Fixing trailing spaces.
Updating the SwitchTransformSpaceWhenParented test to validate using various NetworkTransform configurations (i.e. half precision, quaternion, quaternion compressed) while also parenting with world position stays enabled and disabled. Removing trailing space in recent documentation update.
…e-forcing-updates-localspace
@@ -1,4 +1,4 @@ | |||
"""Helper class for common operations.""" | |||
"""Helper class for common operations.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an artifact from earlier changes... just reflecting what it is currently in the main v2 branch.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alrighty, that was quite a lot 😅 I've just been through and given it a bit of polish. Main change to note is that I've modified the walkthrough of AttachableBehaviour parenting to be a bit more docsy (fewer asides and less conversational tone).
Relatively large change: - Preserving order of operations by making the default network delivery be reliable fragmented sequenced with the exception of named, unnamed, and any message types adjusted explicitly by user code to use a different network delivery method. - Adjusted parenting directive to allow the server to force a parenting directive on a NetworkTransform it does not have the motion authority over. - The NetworkObjects to show now will be also processed in-between ticks to preserve order of operations. - NetworkObjects pending to be shown on the same frame as the tick update will still be processed during the tick update.
…calspace' of https://github.com/Unity-Technologies/com.unity.netcode.gameobjects into fix/networktransform-autoswitchspace-forcing-updates-localspace
…e-forcing-updates-localspace
Purpose of this PR
This PR resolves the issue where setting SwitchTransformSpaceWhenParented to true and then setting InLocalSpace to true will force the motion authority to continually send updates each tick (whether there is a delta or not).
Jira ticket
MTTB-1584
fix: #3653
fix: #3646
fix: #3645
Changelog
NetworkTransform.SwitchTransformSpaceWhenParented
is enabled and the associated NetworkObject is parented multiple times in a single frame or within a couple of frames.NetworkTransform.SwitchTransformSpaceWhenParented
when it is updated by the motion model authority.NetworkDelivery
used by all messages is now reliable fragmented sequenced with the exception of named, unnamed, and any messages sent with a user specified network delivery type. This assures certain order of operations to be preserved when same call-stack changes are applied to a newly spawned, authority side, NetworkObject.Documentation (WIP)
WIP Documentation
NetworkDelivery
and what the default network delivery type is.Testing & QA (How your changes can be verified during release Playtest)
NetworkTransformAutoParenting
)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 is an NGO v2.x.x specific issue. No backport is required.