Граф коммитов

2745 Коммитов

Автор SHA1 Сообщение Дата
Noel Stephens 2ecbd14351
feat: up-port of network variable traits, anticipation, serialized null references, and removal of animator component requirement (#2957)
* update

This contains the updates for PR-2820 (Anticipated NetworkVariable and NetworkTransform) with minor adjustments based on updates in the v2.0.0 branch.

Updating the package version.

Adding updated changelog entries.

up-port of PR-2872

up-port of PR-2874.

updating change log file
2024-06-21 04:21:49 -05:00
Noel Stephens ba4102f8de
fix: rotation not being 1.0 issue using rigid body for motion (#2954)
* fix

this fixes the issue where a quaternion could potentially be close to 1.0 but off by a very very very small amount. Under this scenario, we Normalize the quaternion prior to invoking MoveRotation.
2024-06-17 21:35:12 +00:00
Frank Luong ea0300a625
chore: updating changelog and package.json (#2952)
* updating changelog and package.json

* adding date
2024-06-17 15:47:01 -05:00
NoelStephensUnity 2493ff603b fix
Send InSceneNetworkObjectsSpawned and InternalNetworkSessionSynchronized NetworkBehaviour notifications on the server, host, and session owner side when first starting a session.
2024-06-15 19:58:03 -05:00
Noel Stephens 90cbb1e741
fix: ownership change halfprecision, session owner onclientconnected, and minor optimizations (#2948)
* fix

Fixing issue when using half float precision and ownership changes, the current base position needs to be synchronized.

* fix

This fixes the issue of not invoking OnClientConnected when scene management is enabled for the session owner of a distributed authority session.

* update

Minor reduction in allocs while processing received messages (with the asteroids stress test this removes a regular 83kb allocation that occurs when processing received messages).

* update

Making a client's owned objects be returned as an array as opposed to a list for performance purposes.

* update

Adding change log entries.

* update

Adding the PR number to the changelog entries.

* fix

Cast the local variable so message hooks based on type still work.

* style

adding and removing whitespaces...

* style

removing using statement for generic collections.

* style

Fixing spelling of private dictionary.

* update

Moving around how distributed authority mode is checked.
First pass of getting UnityTransport to be able to dictate what network topology is currently available (during a session).

* update

minor updates to NetworkTransform

* update

Only display the Start Client option in the inspector view when distributed authority mode is selected.

* updte

Adding event for when a session owner is promoted.

* update

adding a few more change log entries.

* test fix

Adding the same changes made to UnityTransport to MockTransport.

* update

Additional control flow for topology usage check

* fix

Fixing issue with NetworkObject ownership properties not showing up in the inspector view.
Renaming the version define from MULTIPLAYER_SDK_INSTALLED to MULTIPLAYER_SERVICES_SDK_INSTALLED.

Removing the components folder that was used for the assembly that no longer exists.

* update

Modifying the EveryoneRpcTarget so that it uses the NotAuthorityRpcTarget and AuthorityRpcTarget when in distributed authority mode.

* update

handling minor merge conflict

* fix

Fixing issue with motion based on very small linear velocity values.

* update

Adding 2D rigibody threshold calculations.
Disabling the auto session owner promotion in distributed authority host mode.

* fix and style

Initializing NetworkManager dependent properties within the OnNetworkSpawn of the NetworkRigidbodyBase class.

Removing whitespaces from NetworkConnectionManager.

* update

adding change log entries

* fix

declaring var rotationThreshold when there is no physics package installed.

* update

reverting previous change. Did another deep profile with Unity 6 (5f1) and this area does not seem to be causing any allocations.

* update

Adding authority mode selection drop down and exposing the NetworkTransformEditor  OnEnable method (making it virtual) so the control can be derived from and extended.

* update

adding changelog entry for NetworkTransformEditor adjustment.

* update

make sure to update to Owner authority during initialization.
2024-06-14 19:36:53 -05:00
Emma 60d321d5c0
chore: Break up the NetworkVariableSerialization file (#2950)
* reafactor: Break up the NetworkVariableSerialization file

* Move related files into the new Serialization folder

* Remove unrelated changes
2024-06-13 00:54:14 -05:00
Noel Stephens d9e1a5c898
chore: merge release 2.0.0-exp.5 into develop-2.0.0 (#2947)
update

updating package version
updating change log version
2024-06-10 08:54:55 -05:00
Emma 25c7e6b7fe
refactor: Ensure lengths are always written as uints (#2946)
* refactor: Ensure lengths are always written as uints

* Update CHANGELOG.md

---------

Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
2024-06-05 15:13:25 -05:00
Noel Stephens 98d4bbcc92
fix: new message versioning starting after session owner message (#2942)
* fix

We are starting the message versioning after the more recent session owner message.

* update

adding change log entry

* update

adding PR number to changelog entry.
2024-06-03 15:02:09 -05:00
Frank Luong 3f59dff4e4
chore: NGO 2.0.0-exp.4 merge back to develop NGO 2.0.0 (#2940)
* chore: distributed authority UI displays dependent upon multiplayer SDK package (#2875)

* update

Renaming Session Mode to Network Topology.
This includes any related properties or XML API documentation references.

Adding package dependent conditional define MULTIPLAYER_SDK_INSTALLED that is defined when the com.unity.services.multiplayer package is installed to the editor assembly definition file.

This removes the custom property drawer since it appears the default enum flag drawer visual bug is resolved in Unity 6.

incrementing the version change

* feat: expose the UTP connect (#2935)

* feat: expose the UTP connect payload

* pass accept payload

* fix formatting

* make Connect and m_Driver protected

* remove payload output

* chore: Merge develop 2.0.0 into exp.3 (#2933)

* feat: enum ordered message versioning  (#2929)

* chore: migrate tests from public to internal (#2930)

* update

Added the MessageTypeDefines ordering class that orders messages based on the NetworkMessageType.
Use tick offset.
Change the ticks ago based on whether DAHost or CMBService.
Changing all test public api to internal
Adding FixedJoint attach and detach methods to NetworkRigidbodyBase.

* test

Fixing issue with tests using their own message provider.
Fixing a few more tests that don't need the message ordering or count verification stuff to be running.
Removed the message ordering related tests since this it was no longer needed.


---------

Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>

* update

Migrated non-authority NetworkTransform updates to the pre late update to more align with how it is handled in v1.x.
Added NetworkRigidbodyBase reference to NetworkObject.
For now, added the ability to add a fixed joint when parenting two NetworkObjects with NetworkTransforms and NetworkRigidbodies that both have UseRigidBodyForMotion set to true (i.e. Rigidbody has no concept of "local space" motion).

* update

Change the FixedJoint approach so it does not require parenting.
The "parent" rigid body now updates its children in NetworkTransform when the "parent's" state is updated in order to keep both parent and children state updates synchronized on the same network tick.
Added NetworkObject.CurrentParent that is set when a NetworkObject is parented.
NetworkObject.NetworkTransform is now NetworkObject.NetworkTransforms (a single NetworkObject can have many NetworkTransforms).
NetworkObject.NetworkRigidbodybase is now NetworkObject.NetworkRigidbodies (a single NetworkObject can have many NetworkRigidbodybase components).

* fix

Adding COM_UNITY_MODULES_PHYSICS wrappers around NetworkObject.NetworkRigidbodies.

* fix

wrapping some physics dependent properties in #if COM_UNITY_MODULES_PHYSICS.

* fix

Last missed NetworkRigidbodies needed wrapping in #if COM_UNITY_MODULES_PHYSICS

* fix

Only invoke DetachFromFixedJoint if HasAuthority is true during despawn.

* fix

Fixing issue where NetworkTransforms updated during FixedUpdate can have a render time that is slightly earlier than the start time. The delta between the two is typically in the nano to pico seconds range.

This first pass approach to resolve this issue is to just cast the two double properties to floats prior to subtracting one from the other in order to reduce that level of granularity of the delta between the two.

---------

Co-authored-by: Frank Luong <100299641+fluong6@users.noreply.github.com>

* chore: add NGO 2.0.0-exp.3 version and date to changelog (#2937)

adding release version and date to changelog

* removing "unreleased" tag

* chore: update changelog in ngo 2.0.0 exp.4 (#2939)

* updating changelog

* bumping ngo version in package json

* adding unreleased section back

---------

Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
Co-authored-by: Dominick <dominick@schroer.ca>
2024-05-31 16:24:37 -05:00
Frank Luong 0060d33cf0
chore: migrate tests from public to internal (#2930)
* changing all test public api to internal

* updating changelog

* additional changes

---------

Co-authored-by: Noel Stephens <noel.stephens@unity3d.com>
2024-05-22 15:40:23 -05:00
Noel Stephens 6a4bb8f68a
feat: enum ordered message versioning (#2929)
* update

Added the MessageTypeDefines ordering class that orders messages based on the NetworkMessageType.

* test

Fixing issue with tests using their own message provider.
Fixing a few more tests that don't need the message ordering or count verification stuff to be running.
Removed the message ordering related tests since this it was no longer needed.
2024-05-21 13:29:29 -05:00
Noel Stephens 4e35f84df9
fix: In-scene placed NetworkObjects getting destroyed if early disconnect (up-port) (#2924)
* fix

up-port of #2923 fix for in-scene placed NetworkObjects getting destroyed if a client disconnects early.

* test

adding test to validate fix

* test fix

Fixing issue of checking HasAuthority via NetworkObject as opposed to NetworkBehaviour
2024-05-14 08:30:29 -05:00
Noel Stephens 0e1094850b
chore: add second part of session restore (#2919)
* update

Skip initial in-scene object spawn pass and sending service the initial synchronization when restoring a session.
Allow same scene handle entries when restoring a session.
Don't spawn the player during connection approval during session restore.
Integration test helpers registers validation handler to exclude InitTestScene for all clients.
NetworkSceneManager always sends scene events to the service.
For now, session owner always uses PostSynchronizationSceneUnloading when processing a session restore synchronization.
2024-05-10 12:56:47 -05:00
Noel Stephens f6f815c99e
chore!: migrate components to runtime assembly [MTT-8472] (#2914)
* update

Migrated components to runtime.
Added  some low hanging fruit updates to NetworkTransform and NetworkTransformMessage to help optimize cpu consumption and reduce GC allocations.
Disabled the ticks ago since RTT seems to only update when a client sends packets.

* test

Made adjustments to tests and testproject assets.

* fix

Fixing scenario where m_UseRigidbodyForMotion is not defined and was being used to register for updates.
Removed some whitespaces.
Wrapping all fixed update related methods and properties in NetworkManager within #if COM_UNITY_MODULES_PHYSICS.
Adjusting the ILPP for NetworkBehaviour to scan the Runtime assembly too.
Adjusting the early exit for lack of observer count to only happen in DA mode.

* test fix

Sometimes the ClientDisconnectMultipleClients can exceed more than 2s (but seemingly less than 5) before receiving all events.
Reverting the OnUpdate  change to TransformInterpolationObject's back to Update as both instances need to update regularly for this test.
Fixing issue with unreliable delta full state synchronization.
2024-05-10 12:43:18 -05:00
Noel Stephens be8a02a86e
feat: add pre and post spawn methods [MTT-8470] up-port v2.0.0 (#2912)
* update

adding pre and post spawn methods.
clearing the m_ChildNetworkBehaviours on Awake.

* update

adding change log entries

* update

Needed to add a NetworkManager ref into the pre spawn method.
Needed to account for locally spawning.

* test

Adding test that validates the pre spawn and post spawn methods are invoked and that order of operations for OnNetworkSpawn invocation is not an issue with OnNetworkPostSpawn invocation.

* style

updating comments

* style

updating comments a bit more

* test

Migrating OnDynamicNetworkPreAndPostSpawn into its own class to avoid interfering with the generic tests.

* style

removing property no longer used and remove LF/CR

* update and test

Added NetworkBehaviour.OnNetworkSessionSynchronized and NetworkBehaviour.OnInSceneObjectsSpawned methods.

Added test to validate the above methods.

Added assets for the test to validate the above methods.

* update

Merge fix

* test

Updates for distributed authority testing.

* Update CHANGELOG.md

Adding v2.0.0 PR

* style

removing white spaces
2024-05-01 21:11:49 -05:00
NoelStephensUnity db2315ce8e fix
Minor NetworkTransform fix to prevent error logging of messages received by a previous owner.
If NetworkTransform is not active then don't check for updates during the tick update.
2024-04-26 15:59:41 -05:00
Noel Stephens b449ea89af
fix: in-scene networkobject with networktransform synchronization when parented under gameobject (up-port of 2895) [MTT-8402] (#2898)
* fix

Fixing issue where parenting synchronization on the authority side was not properly handling the scenario where a NetworkObject is parented under a GameObject (with or without auto object parent sync enabled).

* fix

Fixing issue where parenting synchronization on the non-authority side was not properly handling the scenario where a NetworkObject is parented under a GameObject (with or without auto object parent sync enabled).

* update

migrate when to apply in local space above the parenting check.

* test

Adding an integration test to validate an in-scene placed NetworkObject's initial synchronization when parented under a GameObject. This also test both scenarios where the in-scene placed NetworkObject does and does not have a NetworkTransform.

* fix

removing white space after added enabled field during a cherry pick merge.

* style

removing unused using directive.

* update

updating some package versions

* update

updating the version of linux used

* Update CODEOWNERS

just catching up the CODEOWNERS v2.0 develop branch to changes in v1.0 branch

* update

adding changelog entry

* Update CHANGELOG.md
2024-04-25 17:43:52 -05:00
NoelStephensUnity b0106c3cd5 chore
updating develop-2.0.0 to match the develop branch
2024-04-25 15:13:40 -05:00
Noel Stephens e7ac3c896e
chore: update to for Unity6 support (#2863)
* update

make the unity 6 editor the target

* update

updating the target editor to use for all tests

* update

Update changes from PascalCasing to camelCasing.
Updating the manifest.json.
Updating the ProjectVersion.

* fixes and update

fixing an issue with one of the scene integration tests.
Updating the addressable asset settings for Unity 6 compatibility.
other minor updates.

* update

NGO version number.
Added a large chunk of the changelog entries.
2024-04-03 08:27:09 -05:00
NoelStephensUnity 0f34139e78 test fix
DAHost integration test expects the single synchronization complete message.
2024-04-01 17:54:34 -05:00
NoelStephensUnity bbdcf59694 update & fix
Fixing issue with null in-scene placed NetworkObject checking when session owner is assigned.
Updating scene management (client side) to send the SynchronizeComplete message to all connected clients (so they will redistribute NetworkObjects evenly).
2024-04-01 17:07:56 -05:00
NoelStephensUnity 81a88fc82b update
When a session owner leaves, any remaining in-scene placed NetworkObjects belonging to the session owner changes ownership over to the newly promoted session owner.
(temporary solution for this type of ownership change)
2024-04-01 14:28:54 -05:00
NoelStephensUnity bcf94a74ec fix
NetworkVariables of in-scene placed NetworkObjects not updating was due to the observers not being populated during the scene load event.
2024-04-01 13:33:41 -05:00
NoelStephensUnity a0387117b1 update
Adjusting the NotMeRpcTarget for distributed authority mode.
2024-04-01 11:04:39 -05:00
NoelStephensUnity 2aa38ce046 update
Missed update
2024-03-31 16:35:54 -05:00
NoelStephensUnity 7904e3de90 fix & test
Fixing some additional issues with Rigidbody testing and assuring we are comparing the correct position and rotation. With NetworkTransformOwnershipTests, it turned out that the movement of the non-kinematic body was giving the Rigidbody a linear velocity under certain conditions.

Removing the warning about resetting dirty when not initialized during NetworkVariableTests (removing a couple thousand log messages).

Since the service is now consuming the initial synchronize event, updated how in-scene objects are spawned initially.
2024-03-31 15:03:44 -05:00
NoelStephensUnity 77ae80a1d6 test
still sorting this issue out
2024-03-31 09:23:13 -05:00
NoelStephensUnity ba9f37ac1c test 2024-03-31 07:40:55 -05:00
NoelStephensUnity 65d974258a style 2024-03-30 20:51:43 -05:00
NoelStephensUnity 38fe8c2df3 test fix
Adding wait for FixedUpdate in ServerAuthoritativeTest when using rigid body for motion.
2024-03-30 20:30:28 -05:00
NoelStephensUnity beebcd63f2 test fix
Some more modifications to NetworkTransformOwnershipTests (waiting for FixedUpdate)
2024-03-30 17:40:45 -05:00
NoelStephensUnity 5877aad78c test and style
Fixing missing whitespace.
Missed a few spots in the NetworkTransformOwnership tests.
2024-03-30 17:33:43 -05:00
NoelStephensUnity 400cdc05fc test fix
Fixing issue with some rigid body tests.
Reverting change to NotMeTarget as it impacts UniversalRpc tests that I need to review with Kitty to determine the best way to modify.
2024-03-30 16:48:23 -05:00
NoelStephensUnity ee27047f8f update & fix
Consolidated NetworkRigidbody and NetworkRigidbody2D into single base class that provides more customizable options for users.

NetworkObject no longer implements the Update method in order to check for object scene migration. Instead, it is registered in a table that is updated in the late update prior to sending any messages about objects migrating into a new scene. This removes the added processing per NetworkObject for scenarios where the NetworkObject plays a more passive role (i.e. a sinlge NetworkBehaviour with one or more NetworkVariables).

Fixed issue with parenting when using Rigidbody motion in NetworkTransform.

Fixed issue with NotMeRpcTarget when in distributed authority mode.
2024-03-29 15:54:25 -05:00
NoelStephensUnity dbcb3475d7 update
excluding certain tests from the minimal project pass.
minor fix for initial in-scene NetworkObject spawning until service fully consumes the initial Synchronize event.
2024-03-26 21:43:20 -05:00
NoelStephensUnity 959e887b20 style
removing white spaces.
2024-03-26 17:36:59 -05:00
NoelStephensUnity 6132bb9d23 test
Adjusting some of the metrics tests to yield more accurate end results.
2024-03-26 16:06:56 -05:00
NoelStephensUnity c9df98b6f7 test
Excluding certain tests from the tools integration test project tests.
Increasing the primary test project's 2023 editor to 2023.2 as opposed to 2023.1.
2024-03-26 13:21:34 -05:00
NoelStephensUnity 5d38c546b0 style
removing using directive for System.Linq
2024-03-25 23:23:44 -05:00
NoelStephensUnity 916e637203 style
more whitespace removal
2024-03-25 23:16:24 -05:00
NoelStephensUnity 65c0cd6fd9 style
Removing whitespaces.
2024-03-25 23:09:50 -05:00
NoelStephensUnity 3569d80d5e fix
Wrapping rigidbody specific code blocks within COM_UNITY_MODULES_PHYSICS
2024-03-25 23:03:28 -05:00
NoelStephensUnity 54ed8bf8b8 update
removing NGO_DAMODE
2024-03-25 20:56:31 -05:00
NoelStephensUnity 6953178597 Merge branch 'experimental/distributed-authority' into experimental/distributed-authority-no-ngo-damode 2024-03-25 20:53:36 -05:00
NoelStephensUnity a3b503ba60 update
removing the ServerRpc and ClientRpc distributed authority support. Distributed authority only supports universal RPCs.
2024-03-25 20:50:48 -05:00
NoelStephensUnity 0e04678499 test fix
Fixing some issues with the time integration test.
2024-03-25 20:47:29 -05:00
Noel Stephens a2ccf77fa7
Update CHANGELOG.md
Fixing invalid entry
2024-03-25 20:09:05 -05:00
NoelStephensUnity 41dd028cd7 fix
fixing an issue with client disconnect
2024-03-25 20:06:06 -05:00
NoelStephensUnity 18b389d750 test fix
Fixing an issue with disconnecting a client during the distributed objects test.
2024-03-25 20:05:14 -05:00