Skip to content
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

feat: up-port of network variable traits, anticipation, serialized null references, and removal of animator component requirement #2957

Conversation

NoelStephensUnity
Copy link
Collaborator

@NoelStephensUnity NoelStephensUnity commented Jun 20, 2024

This PR updates NGO v2.0.0 with:

  • Up-port of PR-2872 updates to remove Animator requirements for NetworkAnimator.
  • Up-port of PR-2874 allow null values for NetworkBehaviourReference and NetworkObjectReference.
  • Up-port of PR-2820 updates for anticipated NetworkVariable and NetworkTransform.

Changelog

  • Added: AnticipatedNetworkVariable<T>, which adds support for client anticipation of NetworkVariable values, allowing for more responsive gameplay.
  • Added: AnticipatedNetworkTransform, which adds support for client anticipation of NetworkTransforms.
  • Added: NetworkVariableBase.ExceedsDirtinessThreshold to allow network variables to throttle updates by only sending updates when the difference between the current and previous values exceeds a threshold. (This is exposed in NetworkVariable<T> with the callback NetworkVariable<T>.CheckExceedsDirtinessThreshold).
  • Added: NetworkVariableUpdateTraits, which add additional throttling support: MinSecondsBetweenUpdates will prevent the NetworkVariable from sending updates more often than the specified time period (even if it exceeds the dirtiness threshold), while MaxSecondsBetweenUpdates will force a dirty NetworkVariable to send an update after the specified time period even if it has not yet exceeded the dirtiness threshold.
  • Added: virtual method NetworkVariableBase.OnInitialize which can be used by NetworkVariable subclasses to add initialization code.
  • Added: NetworkTime.TickWithPartial, which represents the current tick as a double that includes the fractional/partial tick value.
  • Added: NetworkTickSystem.AnticipationTick, which can be helpful with implementation of client anticipation. This value represents the tick the current local client was at at the beginning of the most recent network round trip, which enables it to correlate server update ticks with the client tick that may have triggered them.
  • Changed: NetworkAnimator no longer requires the Animator component to exist on the same GameObject.
  • Changed: NetworkObjectReference and NetworkBehaviourReference to allow null references when constructing and serializing.

Testing and Documentation

  • Includes new and modified integration tests.
  • Includes documentation for previously-undocumented public API entry points.

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.
@NoelStephensUnity NoelStephensUnity requested review from chrispope, miniwolf and a team as code owners June 20, 2024 19:54
Adding updated changelog entries.
fixing some minor formatting issues.
up-port of PR-2872
up-port of PR-2874.
remove an unused property.
updating change log file
@NoelStephensUnity NoelStephensUnity changed the title feat: up-port of network variable traits and anticipation feat: up-port of network variable traits, anticipation, serialized null references, and removal of animator component requirement Jun 20, 2024
Missed a line
@NoelStephensUnity NoelStephensUnity merged commit 2ecbd14 into release/2.0.0-pre.2 Jun 21, 2024
23 checks passed
@NoelStephensUnity NoelStephensUnity deleted the feat/up-port-NetworkVariable_Traits_And_Anticipation branch June 21, 2024 09:21
NoelStephensUnity added a commit that referenced this pull request Jun 26, 2024
* chore: updating changelog and package.json (#2952)

* updating changelog and package.json

* adding date

* 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.

* 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

---------

Co-authored-by: Frank Luong <[email protected]>
NoelStephensUnity added a commit that referenced this pull request Jun 26, 2024
* chore: updating changelog and package.json (#2952)

* updating changelog and package.json

* adding date

* 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.

* 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

* fix

Even if the service specifies to synchronize, if scene management is disabled then do not synchronize.

* fix

Removing some of the logic to determine if session owner should synchronize a connecting client or not.

* fix

Fixing issue with spawning objects within OnInSceneObjectsSpawned and OnNetworkSessionSynchronized primarily on the session owner side.

* update

Reducing the notification down to just synchronization since in-scene notification is called on the spawn sweep.

* test

Adding test for preventing spawning prior to being approved.
Adding tests for when spawning during NetworkBehaviour.OnInSceneObjectsSpawned or NetworkBehaviour.OnNetworkSessionSynchronized or both.

* fix

Up port of #2953

* update

Adding change log entries.

* style

removing white space

* update

reducing GC overhead during deferred despawn

* style

Removing whitespaces

* revert

Reverting deferred spawn update.

---------

Co-authored-by: Frank Luong <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants