Achieves a more GC friendly DrawRay debug code through caching the gameobject transform, reducing the engine calls to getTransform
Co-authored-by: Gustavo Santos <gustappsantos@gmail.com>
* fix: Don't let exceptions in OnNetworkSpawn/OnNetworkDespawn block processing of the next callback.
* Standards and changelog.
* Standards fixes
* It would be good to check in the right file.
* I swear these tests passed before but I have no idea how.
Also review feedback.
* Address review feedback.
* Switched to LogAssert.Expect
* Updated tests to NetcodeIntegrationTest style
* Standards fix
* Rewrote tests according to feedback.
Also fixed merge issue with changelog.
* Test the behavior on both server and client
* style
fixing white space issue.
* Update com.unity.netcode.gameobjects/CHANGELOG.md
Co-authored-by: Fatih Mar <mfatihmar@gmail.com>
Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
Co-authored-by: Fatih Mar <mfatihmar@gmail.com>
* fix: splitting the internal and visible parts of OnNetworkSpawn
* fix: Not throwing an exception when NetworkVariable is written to before being spawned. Logging a warning instead
Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
* fix: not sending all NetworkVariables to all clients when a client connects to a server. (#1987)
* fix
This fixes the issue with some of the tests failing.
Disabled the tests where clients don't have a prefab defined.
* update
Fixing issues with the last 5 tests.
* update
Got another (of the five) test working.
Adding some helpers to assure the prefabs are spawned before trying to check them.
Updated some comments.
* test update
This resolves the remaining issues with the deferred message tests for this PR.
* test update
I believe this will fix the tests having instability issues as well.
Co-authored-by: NoelStephensUnity <73188597+NoelStephensUnity@users.noreply.github.com>
Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
Fixed RPC codegen failing to choose the correct extension methods for FastBufferReader and FastBufferWriter when the parameters were a generic type (i.e., List<int>) and extensions for multiple instantiations of that type have been defined (i.e., List<int> and List<string>)
* 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
* fix: NCCBUG-175: BitReader/BitWriter Reading/writing more than 8 bits was producing the wrong result
* Standards + changelog
Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
* fix: Fixed Owner-written NetworkVariable infinitely write themselves (#2109)
Fixed by doing the pre-write as a separate step
* nit PR review :-)
* Adding test
* fix
This fixes the issue where transitions were being both triggered and the change in animation state (i.e. transition state) was being synchronized and applied to clients already transitioning which would cause any StateMachineBehaviours to have their OnStateEnter method invoked twice.
* fix
Making adjustments to account for changes to the Transition state update vs trigger update fix.
* test
Adding the additional StateMachineBehaviour (CheckStateEnter) to validate this fix.
Adjusting two tests for this fix.
Includes the animation related assets needed for the test.
* style
adding additional comments for some changes that were not obvious to the fix.
* update
removing code used to debug
* style
MTT-3564
updating changelog.
* style
correcting grammar in comment
* style
slight adjustment to the comment
* style
* update
removing more debug related code.
* style
minor integration test variable rename.
* Performance fix for large number of NetworkObjects
* docs: style: changelog and coding convention
* fixes tests (but not NetworkList ones)
* Fixes NetworkList functionality
* disabling incompatible test
* test adjustment, following improvement in NetworkVariable sending
* Merging two loops to scan over objects one less time (performance). Re-enabling test, making it use SetDirty() properly
* improved naming, fixed tests
* addressing 'This seems like it should be handled by PostNetworkVariableWrite' PR review comment
* refactoring common part to duplicated code paths into a single instance
* limiting m_IsDirty visibility, to encourage using SetDirty()
Co-authored-by: starchitectus <acarija@gmail.com>
* fix
Seeing if this fixes the issue with our memory leaks.
* fix
minor fix to my fix. Need to reconnect the client after creating the new MessagingSystem.
adjusted a comment.
* Update com.unity.netcode.gameobjects/Tests/Editor/Messaging/MessageSendingTests.cs
Adding Fatih's LF/CR suggestion for readability
Co-authored-by: Fatih Mar <mfatihmar@gmail.com>
Co-authored-by: Fatih Mar <mfatihmar@gmail.com>
* fix
NCCBUG-137
This resolves the issue where destroying a GameObject with one or more NetworkBehaviour components that is a child or any child generation of the NetworkObject/GameObject that theNetworkBehaviour(s) are assigned to would still try to access the destroyed NetworkBehaviour since it was still an entry within the NetworkObject.ChildNetworkBehaviours list. It also resolves the issue where under this scenario the NetworkBehaviours would not have their OnNetworkDespawn method invoked.
* update
NCCBUG-137
updating the changelog
* fix
We need to check IsSpawned when logging a warning about a NetworkBehaviour not having an assigned NetworkObject (this is only valid if NetworkBehaviour.IsSpawned == true)
* fix
Needed to adjust to account for the condition when it is valid is when you have a NetworkBehaviour that is spawned but there is no assigned NetworkObject.
* test
NCCBUG-137
This is the integration validation test for this PR fix.
* update
Adding PR number to the changelog entry
* test
adding check for OnNetworkDespawn being invoked when a child NetworkBehaviour is destroyed. but the parent NetworkObject persists and remains spawned.
* style
MTT-4260
was created for this technical debt.
removing reminder to create a ticket.
* fix
fixing merge issue.
* fix
Removing the invocation of NetworkBehaviour's OnNetworkDespawn when a NetworkBehaviour is destroyed while a NetworkObject is still spawned.
* style
removing unused namespace.
* Update com.unity.netcode.gameobjects/CHANGELOG.md
Co-authored-by: Jesse Olmer <jesseo@unity3d.com>
Co-authored-by: Jesse Olmer <jesseo@unity3d.com>
* fix
MTT-4266
This fixes the issue where a NetworkVariable that is set to owner read and write permissions and the owner is a client, then the server would not be updated with any changes to the NetworkVariable.
* test
This includes an additional test to check that a client owner with both Owner read and write permissions will only update changes to the NetworkVariable on the server.
* update
Adding the changelog entry for this fix.
* update
adding PR number.
* fix
This resolves the issue with NetworkAnimator not de-registering itself from OnClientConnected.
This resolves some issues with the manual NetworkAnimator test.
* update
MTT-4080
(this branch includes fixes for the OnClientConnectedCallback issue)
Renamed NetworkAnimatorEnhancement scene to NetworkAnimatorServerOwnerTest.
Adding the manual NetworkAnimatorServerOwnerTest scene to the scenes in build list.
* style
fixing whitespace issue.
* update
Fixing how AnimatedCubeController determines the type of NetworkAnimator and whether it is server or owner authoritative.
* update
Simplifying the conditional check requirements down to IsSpawned and IsOwner for the AnimationUserInput component since the only input checked should always be by the owner.
* update
removing an artifact from cherry picking a previous branch's work that included the manual test fixes.
* style
removing unused property.
* fix
MTT-4211
This fixes the issue where in-scene placed NetworkObjects were being destroyed when NetworkHide is invoked.
* test
MTT-4211
This adds an additional check for NetworkHide and NetworkShow towards the end of the in-scene placed NetworkObject synchronization test.
* style
whitespace fix
* style
Adjusting comments and adding additional API XML Documentation for readability and clarification purposes.
* update
MTT-4211
Updating the changelog.
* update
improving the logic used for readability purposes since we know IsSceneObject will be valid.
* style
migrating the majority of the comments into remarks.
* style
Adding space within all added <br/> tags so they look like this: <br />
This is to see if the version of docusaurus we are using will not crash when it runs across this markdown syntax.
* update timeout
* remote UNET
* fix: Stop populating ILPPMessageProvider with messages from outside the main runtime assembly
* reset the changes to the scene
* Initialiize the Rawgithash variable for the local execution case
* Add a little more logging and see if we can find why allactons hasn't been populated at the time the test runs
* Update the test to reduce the number of log messages as well as make the messages more informative
* Lot when initlializatioon is complete
* More logging clean up and adding information about registered test methods
* Move init all steps to Awake instead of Start, eventually need to figure out how to block initial connection until init all steps is done
* Move init to Awake
* Fix missing log message in TestCoordinator Start method
* Use GPU for Ubuntu image
* Remove the nographics requirement and see if we can stabilize 2022.2
* Use -nographics and don't request a GPU for Linux
* try to use ubuntu-20 and see if this is more stable
* Use GPU for Linux and use Ubuntu 18
* Remove nographics again as it clearly makes an improvement
* Adding a GPU and removing nographics just made things slower but still failing so no point making this change, reverse it
Co-authored-by: Kitty Draper <kitty.draper@unity3d.com>
Co-authored-by: ashwini <36935028+ashwinimurt@users.noreply.github.com>
* chore: Disable unstable test WhenAMessageIsDeferredForMoreThanTheConfiguredTime_ItIsRemoved
* Update com.unity.netcode.gameobjects/Tests/Runtime/DeferredMessagingTests.cs
Co-authored-by: Fatih Mar <mfatihmar@gmail.com>
Co-authored-by: Fatih Mar <mfatihmar@gmail.com>
* Set up for launching remotely
* Set up for launching remotely
* Report on WorkerCount and LaunchRemotely state
* Store the Process as it will complete later
* add a little more logging
* Simplified name
* Update GetWorkerCount to no longer set internal state
* Update BaseMultiprocessTests.cs
respond to PR feedback
Co-authored-by: ashwini <36935028+ashwinimurt@users.noreply.github.com>