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

feature: SyncMethod [Reliable/Unreliable]: Quake Hybrid #3908

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

miwarnec
Copy link
Collaborator

@miwarnec miwarnec commented Sep 30, 2024

image
credits to John Carmack for the feat that is the quake networking model.
credits to MrGadget for the hybrid idea to make it scale.

This PR contains:

SyncMethod built into Core
image

NetworkTransformHybrid"CORE" built on top of SyncMethod

TanksHybrid example with NTHybrid + Tank.cs syncing health as hybrid
https://gyazo.com/fa7011c362dd267f54340c4050e06623

TODO

  • add to features on github, asset store (this is huge!)
  • Weaver needs to support SyncMethod too

@@ -102,6 +103,38 @@ public struct EntityStateMessage : NetworkMessage
public ArraySegment<byte> payload;
}

// state update for unreliable sync.
// baseline is always sent over Reliable channel.
public struct EntityStateMessageUnreliableBaseline : NetworkMessage
Copy link
Collaborator

Choose a reason for hiding this comment

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

rename to EntityStateMessageReliableBaseline everywhere

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is for Unreliable SyncMethod, I think it's more obvious this way

Copy link
Collaborator

Choose a reason for hiding this comment

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

Prove it's not sent on the reliable channel and I'll agree.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the naming is based on SyncMethod, not on channel.
both ways are possible, but this is more obvious

Comment on lines +59 to +61
public static int unreliableBaselineRate = 1;
public static float unreliableBaselineInterval => unreliableBaselineRate < int.MaxValue ? 1f / unreliableBaselineRate : 0; // for 1 Hz, that's 1000ms
static double lastUnreliableBaselineTime;
Copy link
Collaborator

Choose a reason for hiding this comment

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

rename to ReliableBaseline everywhere

@MrGadget1024 MrGadget1024 added enhancement New feature or request work in progress Need more time to decide. Nothing to do here for now. labels Sep 30, 2024
@miwarnec miwarnec force-pushed the core-unreliable branch 4 times, most recently from 878d293 to 13e9cf6 Compare February 26, 2025 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request work in progress Need more time to decide. Nothing to do here for now.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants