-
-
Notifications
You must be signed in to change notification settings - Fork 771
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
Hybrid Sync Part 1: NetworkTransform Hybrid #3937
base: master
Are you sure you want to change the base?
Conversation
8580770
to
27feb01
Compare
Assets/Mirror/Components/NetworkTransform/NetworkTransformHybrid2022.cs
Outdated
Show resolved
Hide resolved
Assets/Mirror/Components/NetworkTransform/NetworkTransformHybrid2022.cs
Outdated
Show resolved
Hide resolved
public bool showGizmos; | ||
public bool showOverlay; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flags enum
public bool unreliableRedundancy = false; | ||
|
||
[Tooltip("When sending a reliable baseline, should we also send an unreliable delta or rely on the reliable baseline to arrive in a similar time?")] | ||
public bool baselineIsDelta = true; | ||
|
||
// selective sync ////////////////////////////////////////////////////// | ||
[Header("Selective Sync & interpolation")] | ||
public bool syncPosition = true; | ||
public bool syncRotation = true; | ||
// public bool syncScale = false; // rarely used. disabled for perf so we can rely on transform.GetPositionAndRotation. | ||
|
||
// BEGIN CUSTOM CHANGE ///////////////////////////////////////////////// | ||
// TODO rename to avoid double negative | ||
public bool disableSendingThisToClients = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flags enum
// only sync when changed hack ///////////////////////////////////////// | ||
[Header("Sync Only If Changed")] | ||
[Tooltip("When true, changes are not sent unless greater than sensitivity values below.")] | ||
public bool onlySyncOnChange = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Flags enum
27feb01
to
0795681
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix typos
Assets/Mirror/Components/NetworkTransform/NetworkTransformHybrid2022.cs
Outdated
Show resolved
Hide resolved
Assets/Mirror/Components/NetworkTransform/NetworkTransformHybrid2022.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix typos
Assets/Mirror/Components/NetworkTransform/NetworkTransformHybrid2022.cs
Outdated
Show resolved
Hide resolved
Assets/Mirror/Components/NetworkTransform/NetworkTransformHybrid2022.cs
Outdated
Show resolved
Hide resolved
…id2022.cs Co-authored-by: MrGadget <[email protected]>
…id2022.cs Co-authored-by: MrGadget <[email protected]>
…id2022.cs Co-authored-by: MrGadget <[email protected]>
…id2022.cs Co-authored-by: MrGadget <[email protected]>
…id2022.cs Co-authored-by: MrGadget <[email protected]>
…id2022.cs Co-authored-by: MrGadget <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing mirror icon ;)
Vector3 lastDeserializedBaselinePosition = Vector3.zero; | ||
Quaternion lastDeserializedBaselineRotation = Quaternion.identity; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"assigned, but never used"
6d6d31b
to
6ece0c7
Compare
TODO DONT MERGE YET:
Changing Mirror from Reliable to (optional) Unreliable takes significant effort.
Let's do this with incremental PRs, each of them tested in a production game.
This PR is step 1: NetworkTransform with Reliable baseline + Unreliable deltas for proper change detection!
Old NetworkTransform
The previous NetworkTransform implements a hacky, 95% correct change detection for Unreliable since bandwidth would be too high otherwise. This PR changes this to a 100% correct change detection - so we'll want this even if we don't go any further!
Benchmarks
Mirror Benchmark:
Same bandwidth, faster server + client perf.