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

Is there any compression? #157

Open
vassembly opened this issue Nov 28, 2023 · 6 comments
Open

Is there any compression? #157

vassembly opened this issue Nov 28, 2023 · 6 comments

Comments

@vassembly
Copy link

Delta diffs maybe? Or anything else to support huge player counts.

@elementbound
Copy link
Contributor

I don't see delta diffs viable, since state and input properties are sent as unreliable, so at the time we receive a delta, we may or may not have the preceding state to use as reference.

However, an opportunity to reduce data usage is the properties. Currently, the full path of each property is included in the dictionary used to describe state. These names could be replaced with simple indices.

The other thing is channels - currently no channels are specified, the default ones are used. Using specific channels might improve performance.

Created issues for both. Let me know if you have any other ideas or concerns!

@vassembly
Copy link
Author

well, delta compression allows you to send diffs of data, that means, you don't have to send relatively big data all the time, but rather, small pieces of it reliably. sorry for the confusion, just making sure we talk about the same thing

@vassembly
Copy link
Author

theres a good article by valve about source engine networking. You may find it useful

@elementbound
Copy link
Contributor

Yes, I was aware of the diff part. I didn't consider sending deltas over a reliable channel though!
Do you have any stats on how much traffic this saves? For example, players move around most of the time, so it wouldn't save that much bandwidth. For non-rollback properties, like player health, MultiplayerSynchronizer can be configured to sync only when the value changes.

@elementbound
Copy link
Contributor

Created #173 as a first step for improving netfox in this regard.

@TeTpaAka
Copy link

Yes, I was aware of the diff part. I didn't consider sending deltas over a reliable channel though!

I wouldn't recommend sending state data over a reliable channel. The main reason not to use reliable channels is that dropping a single packet delays the arrival of all following packets, which results in noticeable stutter.

I don't see delta diffs viable, since state and input properties are sent as unreliable, so at the time we receive a delta, we may or may not have the preceding state to use as reference.

Fortunately, you don't actually need the preceding state. You just need a preceding state. If the client tells the server which tick it last received, the server can use that tick as reference for the following state diffs.

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

No branches or pull requests

3 participants