-
Notifications
You must be signed in to change notification settings - Fork 449
Client/Owner authoritative NetworkTransform and Re-Parenting issue #2842
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
Comments
I see where the issue could arise with an owner authoritative instance. Of course, we are getting much closer to releasing the alpha package for distributed authority that provides full client-side authority over owned NetworkObjects... so at that point you can just parent the NetworkObject on the client-side where transform values will synchronize to the client owner's values (which would completely resolve your issue). I am restricted from providing details on when this will be available, but I can say to keep watching the repository as it will get a relatively large update soon (i.e. in a few weeks). While the update won't be specific to the develop branch it will have some new branches that will have some rather large changes. Let me weigh the benefits of adding that property vs holding back until the distributed authority is available (i.e. landed in the repo not the official package). (Have several ideas of how you could work around this issue...but again... distributed authority update will resolve these kinds of issues "by design"...so I am hesitant sending you in a direction that you will most likely replace once DA is available). |
@NoelStephensUnity Thanks! I'm pretty sure I can make customizations to Netcode myself locally to fix this one, but I wanted to make sure it was on the radar as a problem with client authority. However, I haven't been able to figure out my own solution to this other kinda related problem yet: I've been able to reduce the problem down to what I assume is a single tick of bad positioning, but that's still a huge visual glitch. |
@NoelStephensUnity It seems like a small change to ParentSyncMessage.cs fixes this issue with owner/client authoritative position snapping back in time:
This makes me wonder in what circumstances you would even need to be writing position/rotation information when re-parenting is |
If changes are made on the authority side to the transform upon a NetworkObject being parented (i.e. within OnNetworkObjectParentChanged) and there is no NetworkTransform then this scenario applies. There have been on-going issues with handling parenting under various scenarios (especially if a NetworkTransform is attached to the GameObject in question). Side Note: |
Closing this issue as it was fixed in #3013. |
@NoelStephensUnity this was closed when it was fixed in 2.x but was never backported to 1.x. This issue and #2843 actually create some problems bad enough in a Netcode 1.x game that make it unshippable. (Not being able to smoothly re-parent without a major visual hiccup is way too janky to ship.) Upgrading to Unity 6 is not possible, so maybe I will have to backport all of 2.x for our own uses. I think the two tickets I mentioned are just as disruptive as #3080 which was mostly fixed by the backport of #3388. |
@zachstronaut As a side note, it definitely helps to provide the Unity editor and NGO version you are using when you experienced the issue so in the event we are backlogged and circle back to an issue we can make sure any fixes are targeted for the appropriate versions. |
@NoelStephensUnity sorry about that... Unity 2022.3.60f1 and Netcode 1.13 Yes, I think I am looking for the ParentSyncMessage fixes to be backported for this purposes of this ticket. I think for #2843 we're talking different fixes. |
Ok, I will look and see if I can include an "over-all" back-port that includes the v2.x |
@NoelStephensUnity ooooOOOooo wishing you luck! |
I marked this one particular issue to be imported and high and will make sure to include the fact that there are several other "orbiting" issues where some backports did not make it due to the PRs contained changes which require a major version increment of the package. Now that a bunch of the v2.x stuff is starting to settle a bit it is definitely time to circle back and bring over any fixes (that can be brought over without requiring a major version increment) that pertain to synchronization and parenting. |
@zachstronaut
If you get a chance, could you see if using either of the two helps to resolve your issue? The Let me know if this helps to resolve your issue? |
@NoelStephensUnity these sound promising, I will take a look as soon as I can. thanks! |
Awesome... if you run into other issues while testing this branch with your project let me know so I can try to see what parts from v2.x I can bring over to resolve those as well. |
This PR backports the the `NetworkObject.SyncOwnerTransformWhenParented` and `NetworkObject.AllowOwnerToParent` functionality. [MTTB-1284](https://jira.unity3d.com/browse/MTTB-1284) fix: #2842 ## Changelog - Added: `NetworkObject.SyncOwnerTransformWhenParented` which will not synchronize transform values sent by the server when parented (primarily for owner authoritative motion models). - Added: `NetworkObject.AllowOwnerToParent` which allows a client owner to parent locally and have the changes synchronize with the server and other clients (primarily for owner authoritative motion models). ## Testing and Documentation - Includes backported integration test modified to the constraints of v1.x. - Includes additions to public API documentation. <!-- Uncomment and mark items off with a * if this PR deprecates any API: ### Deprecated API - [ ] An `[Obsolete]` attribute was added along with a `(RemovedAfter yyyy-mm-dd)` entry. - [ ] An [api updater] was added. - [ ] Deprecation of the API is explained in the CHANGELOG. - [ ] The users can understand why this API was removed and what they should use instead. --> ## Backport No back port needed as this is a targeted backport of certain v2.x features that could be useful to projects still using v1.x. --------- Co-authored-by: Emma <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
When you have a moving client/owner authoritative
NetworkTransform
and the server changes its parent, the position where that object was on the server at the moment of the re-parenting gets serialized back to the client. The client is pushed back to a previous position (essentially back in time).This problem isn't happening inside of
NetworkTransform
, though. You can observe the same issue where the client jumps to the server's position upon re-parenting if you have no NT at all.The source of this problem is actually in
ParentSyncMessage.Handle()
messing with the position of objects and not respecting that somebody other than the server may own the position of the object.The text was updated successfully, but these errors were encountered: