Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: NetworkTransform teleport interpolating from last position on no…
…n-authoritative side [NCCBUG-166] (Unity-Technologies#2110) * fix NetworkTransform was setting the value of m_Bitset but not resetting the individual bits if there was no deltas. This would result in a gradually increasing message size over time when updating the NetworkTransform. * update migrating the assignment back down below the CanCommitToTransform * fix This resolves the issue where clients were applying every value marked to be synchronized even if the update didn't include specific axis values. * test This includes some fixes to prefabs that hadn't been updated to the more recent changes in NetworkTransform that limited the minimum threshold (i.e. they were set to 0 which causes issues) * fix Since we are now no longer sending the entire transform values, this addition prevents the non-authoritative side from making changes to the transform. * style removing whitespace * update Adding some test adjustments and including rotation to interpolation measurements. * style removing an unused namespace. * style fixing issue with reference to UnityEngine's Object after I removed the system namespace. * fix This includes the adjustments for client authoritative mode to work without sending RPCs. * fix This update fixes the issue where the authoritative side was interpolating when interpolate is enabled. Now, the authoritative side no longer interpolates. * manual test updates These changes make the player client authoritative within the Samples Menu->Additive Scene Loading manual test/sample. * update reverting the change of m_Bitset to an internal. * test update updating test to account for reverting back to the private m_Bitset. * update Migrated the code that updates interpolators with the current value if the axis is not set into the AddInterpolatedState method as opposed to it being in the ApplyInterpolatedNetworkStateToTransform * fix First pass fix for teleporting. * test manual Manual test adjustments (still working on player motion controller from client side) * manual test Adjustments for the teleporting sample/manual test. Still working on the new player cube motion model. * test manual Improved motion model (still could use some more work for client to server side). Now packing data sent from client to host/server. Added UI text that displays whether the instance is a server, host, or client. * update removing debug code * fix This fixes the last issues with teleporting and the updated player motion model. * fix Cleaning up how we handle transitioning to and from global and local space. Minor adjustment to the validation test to assure the range of error being tested on the client side is the same as the delta position threshold range. * update Removing the NetworkTransformState Position, Rotation, and Scale since we are only sending the values that changed (i.e. if the x-axis of position was the only thing that was set and NetworkTransformState.Position was used, then the Y and Z axial values would be invalid). * fix removing code block no longer needed. * style removing a comment that was no longer needed. * update applying suggested changes * update replacing the GetReplicatedNetworkState() method with a getter ReplicatedNetworkState property. * update This is a new approach: - Make in-between state updates additive - Clear our state's Bitset value and prepare to capture any deltas for the next network tick period. * update Realized since we are back to additive (per network tick), we can now remove the non-authoritative interpolation work around for not having all values that changed within the associated NetworkTransformState's network tick period. * update Disposing the NetworkVariables when the NetworkTransform is destroyed. * update Suggestion updates and comment fixes. * style adding Sam's comment. * style updated comment to include what we are preserving. * update Removing the ApplyTransformValues and SetTransformValues as they are no longer needed. Also, removing the associated properties. * Test Manual Updates to manual test related assets and scripts. Removed the "make a pooled object invisible to hide the teleport interpolation issue" hack that would disable the render mesh when despawned and enable it shortly after it is spawned. Increased tick rate to 32 in the additive scene loading test. Fixing white space issues. * update Removing the unused serverTime addition as well. * update Renamed ApplyInterpolatedNetworkStateToTransform to ApplyAuthoritativeState. (It didn't make sense if interpolation is disabled) * tests update This includes an updated NetworkTransformTests that tests both authority types while running in Server and Host modes. This includes some updates to naming for easier identification of what each test does (in test runner and in code). * Update Minor adjustment where we don't need to send a local properties over the stack via parameters. * test Added interpolate enable/disable values to all tests. Now, all NetworkTranaformTests are done with interpolation enabled and disabled. * fix and update Fixed another issue that was exposed while cleaning up the code base. Was able to remove even more of the code added previously. Some clean up as well as making one additional method private as opposed to protected to prevent us from having to release a minor version vs patch. Also, ApplyTransformToNetworkState, and ApplyTransformToNetworkStateWithInfo only return if the state is dirty (the rest can be determined from within the state itself). ApplyLocalNetworkState, used for integration tests, now just returns the NetworkTransformState. * fix This fixes the issue with the memory leak message in the editor NetworkTimeTests (very odd this fixed the issue). * test manual Switched over to an owner authoritative NetworkTransform that also includes the playermovement. Adjusted the PlayerCube NetworkPrefab and minor adjustment to the CollideTeleporter. * update updating the changelog * fix Found a minor logic issue in ApplyTransformToNetworkStateWithInfo where the state dirty flag could be reset before end of the current network tick. This could result in state being carried forward into the next network tick. This resolves that issue. * update Minor adjustment to how we handle applying a rotation measurement on the non-authoritative side. Removed a property not being used outside of a single method and added additional comments to the PlayerMovement component. * update This update includes the final changes required in order to support the previous NetworkTransform model where it was always server authoritative and client owners could direct/apply state via internal RPCs. This also includes the ability for a server to apply/dictate state when running in client owner authority mode. This includes updates to the NetworkTransform tests that validate all of these updates and increase the amount of coverage for NetworkTransform. * style moving new private m_ClientRpcParams and m_ClientIds up to the rest of the property declarations. Adjusting comment * test manual Minor adjustments for the random player movers. Applying the server authoritative player prefab back to be the default for the additive scene sample (this makes it easier to compare to main branch). * style removing a no longer needed comment. adding note about future clean up for NetworkTransform. * style fixed spelling issue * style removing left over comment and spelling * style removing legacy/unused namespaces * update realized our CommitLocallyAndReplicate method was serving no purpose at this point. added the assignment of NetworkTransformState to the ReplicatedNetworkState within TryCommit and removed CommitLocallyAndReplicate. * update removing legacy check for TryCommitTransformToServer that is no longer needed. * update removing m_Transform (no purpose for it) Fixing minor grammar issue with a comment * test manual update removing additional IsOwner check. * revert reverting the changes I made to the editor test NetworkTimeTests as I just had Yamato crash again in a different area in NetworkTimeTests with the same memory leak error. * style replacing LF/CR * Style Improving comments
- Loading branch information