Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

Fix Set Kinematic When Not Authoritative not being applied correctly. #1456

Merged
merged 2 commits into from
Aug 17, 2020

Conversation

jamiebrynes7
Copy link
Contributor

@jamiebrynes7 jamiebrynes7 commented Aug 17, 2020

Description

We had two different bugs that revealed themselves when we removed the AuthorityLossImminent state in #1451

  • The SetKinematicFromAuthoritySystem was grabbing the first authority change received in that frame to use as the authority change. In the case where you got AuthorityLossImminent and then NotAuthoritative in the same frame, it would grab AuthorityLossImminent (incorrectly).
  • The query returned by ConstructEntityQueryDesc<T> would have an Exclude<TransformInternal.HasAuthority> filter on it. This meant that we would never even attempt to reset the kinematic authority set when you become 'not authoritative'.

These two bugs combined meant that the kinematic state would never be by the system ever. In the playground, this seemed not to matter so we never noticed it (and the fact that we typically would only ever run with 1 worker locally).

When we removed the AuthorityLossImminent state, the first bug ceased to apply meaning that we just ended up with weird behaviour with multiple GameLogic workers.

This PR fixes both these bugs, the first by grabbing the correct element from the authority changes span and the second by making ConstructEntityQueryDesc take a tri-state enum of either (Exclude, Ignore, or Required).

Remaining work

  • Cubes are now being shot across the world and I'm not entirely sure why..
  • Changelog

Tests

  • Ran locally with two workers and ensured that the Is Kinematic state was being set.

@improbable-prow-robot improbable-prow-robot added jira/no-ticket Indicates a PR has no corresponding JIRA ticket do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Aug 17, 2020
@improbable-prow-robot improbable-prow-robot added A: transform-synchronization Area: Transform synchronization feature module size/S Denotes a PR that changes 15-39 lines, ignoring generated files. labels Aug 17, 2020
@sonarcloud
Copy link

sonarcloud bot commented Aug 17, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@jamiebrynes7 jamiebrynes7 marked this pull request as ready for review August 17, 2020 15:20
@improbable-prow-robot improbable-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 17, 2020
@jamiebrynes7 jamiebrynes7 merged commit b34f5c3 into develop Aug 17, 2020
@improbable-prow-robot improbable-prow-robot deleted the bugfix/set-kinematic branch August 17, 2020 15:24
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A: transform-synchronization Area: Transform synchronization feature module jira/no-ticket Indicates a PR has no corresponding JIRA ticket size/S Denotes a PR that changes 15-39 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants