Skip to content

chore: [Optimize bitfield accessors] NetworkTransform#3907

Open
noellie-velez wants to merge 2 commits intodevelop-2.0.0from
chore/simplify-accessors-network-transform
Open

chore: [Optimize bitfield accessors] NetworkTransform#3907
noellie-velez wants to merge 2 commits intodevelop-2.0.0from
chore/simplify-accessors-network-transform

Conversation

@noellie-velez
Copy link
Collaborator

Purpose of this PR

Jira ticket

MTT-14675

Changelog

  • Changed: Improve performance of NetworkAnimator.

Documentation

  • No documentation changes or additions were necessary.

Testing & QA (How your changes can be verified during release Playtest)

Functional Testing

Manual testing :

  • Manual testing done

Automated tests:

  • Covered by existing automated tests
  • Covered by new automated tests

Does the change require QA team to:

  • Review automated tests?
  • Execute manual tests?
  • Provide feedback about the PR?

If any boxes above are checked the QA team will be automatically added as a PR reviewer.

Backports

N/A

// We compare against the NetworkTickSystem version since ServerTime is set when updating ticks
if (UseUnreliableDeltas && !isSynchronization && m_DeltaSynch && m_NextTickSync <= CurrentTick)
{
// TODO-CACHE: m_CachedNetworkManager.NetworkConfig.TickRate value
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

m_CachedNetworkManager.NetworkConfig.TickRate is used only once in this script, why would we cache it?

{
if (networkTransform.NetworkManager == null)
//CHECK static context, can we use NetworkManager.Singleton?
var networkManager = networkTransform.NetworkManager;
Copy link
Collaborator Author

@noellie-velez noellie-velez Mar 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here:
If we are in static context, does it mean we are using NetworkManager.Singleton? If that's so, shouldn't we use that one instead of networkTransform.NetworkManager?


if (!networkTransform.NetworkManager.DistributedAuthorityMode && !s_NetworkTickRegistration.ContainsKey(networkTransform.NetworkManager))
//CHECK can we use NetworkManager.Singleton instead as we are in static context?
var networkManager = networkTransform.NetworkManager;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are in static context, does it mean we are using NetworkManager.Singleton? If that's so, shouldn't we use that one instead of networkTransform.NetworkManager?

@noellie-velez noellie-velez marked this pull request as ready for review March 18, 2026 18:12
@noellie-velez noellie-velez requested a review from a team as a code owner March 18, 2026 18:12
@noellie-velez noellie-velez changed the title chore: Use cached network manager instead of property chore: [Optimize bitfield accessors] NetworkTransform Mar 18, 2026
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.

1 participant