-
Notifications
You must be signed in to change notification settings - Fork 459
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 <[email protected]>
…orm.cs Co-authored-by: Amy Reeve <[email protected]>
…orm.cs Co-authored-by: Amy Reeve <[email protected]>
…orm.cs Co-authored-by: Amy Reeve <[email protected]>
…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
Regressed a previous fix when resolving the most current issue where generating a parent directive should only apply the parenting directive if it is the server and not the motion authority (whether local or world) and to assure if we are the motion authority we still set the m_PreviousParent in the event ownership changes and the NetworkTransform is using an owner authority motion model.
…e-forcing-updates-localspace
Allow NetworkObjects to run through the despawn process if they are destroyed by something like the UnityEngine SceneManager when unloading a scene. Added validation check against the NetworkObject's GameObject's scene (IsValid) and whether the scene is loaded or not to determine if an error message should be logged or if it is just being destroyed due to the scene being unloaded (abrupt unloading like exiting play mode while in a session).
Changing #3687 adjustment to use the version of SpawnNetworkObjectLocally that accepts a SceneObject which doesn't invoke pre-spawn but does invoke post spawn and processes deferred messages. These were moved in this PR to assure post spawn was invoked after the object was 100% done locally spawning and as a last step process any deferred messages targeting this object.
Validating clients had initialized was some how was encapsulated within a verbose debug check. Not sure why this was passing before other than certain messages might have always been processed out of order before...?
Removing the previously removed post spawn invocation from the common spawn method (missed when merging). Renaming the local spawn methods to reflect the context of the local spawn (i.e. authority is the first to spawn and then notify where non-authority is invoked by the authority's CreateObjectMessage). It will help keep the context clear (possible area to merge into one with a flag to determine if it is an authority or non-authority spawn action).
Removing whitespace at the end of the comment
…e-forcing-updates-localspace
Noticed an issue with the world space approach and rotating platforms (parents). This is a refactor of the same kind of approach (i.e. interpolator handles transform space updates) with the addition of tracking each measurement's parent, handling any transform space conversion if the current parent is different from the measurement's parent, and just keeping everything transform space relative.
…e-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.Pending Changelog Update
CreateObjectMessage
as opposed to waiting until the next network tick to synchronize the show with the update to NetworkVariables.Documentation (WIP)
WIP Documentation
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.