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

Explain the network protocol and its current limitations #150

Closed
philpax opened this issue Feb 22, 2023 · 7 comments
Closed

Explain the network protocol and its current limitations #150

philpax opened this issue Feb 22, 2023 · 7 comments
Labels
documentation Improvements or additions to documentation meta:good first issue Good for newcomers

Comments

@philpax
Copy link
Contributor

philpax commented Feb 22, 2023

The guide should have a document explaining the current state of the network protocol, what our next steps are, and what the current limitations are.

Here's a quick list of facts that can be used to write up a more complete document:

  • We currently only support desktop clients, and use QUIC through the quinn library as our communication protocol.
  • We are actively working on web deployments. To begin with, we may use WebSockets (due to their support across all browsers), but we would like to adopt WebTransport as soon as possible. This is dependent on browser support and wasm-bindgen availability.

  • The HTTP (TCP) port is 8999 and the QUIC (UDP) port is 9000.

  • We synchronise all entities with at least one component marked with the Networked attribute. Only the components marked Networked will be sent to the client.
  • Most core components are Networked. This may have unintended ramifications in terms of cheating, especially for hostile clients.
  • By default, custom components are not Networked. This is something users have to opt into.
  • The client is fundamentally designed around runtime flexibility of logic, which is non-ideal for avoiding cheaters. Further R&D is required, but it is likely that there is no silver bullet and the solution will be game-dependent.

  • All gameplay logic is currently server-authoritative.
  • We currently do not have any form of latency-hiding, including prediction, rollback, or clientside logic.
  • We previously had rollback, but removed it due to its relative inflexibility.
  • Our plan is to introduce clientside and shared logic that can be used for user-defined prediction with runtime assistance, but this will take some time.
@philpax philpax added documentation Improvements or additions to documentation meta:good first issue Good for newcomers labels Feb 22, 2023
@xunilrj
Copy link

xunilrj commented Feb 23, 2023

I am interested in helping with this. @philpax

@ggambetta
Copy link

Happy to brainstorm about client-side prediction and server reconciliation :) I've written a bit about this.

@philpax
Copy link
Contributor Author

philpax commented Feb 23, 2023

I am interested in helping with this. @philpax

Go for it! Fork the repo, add a Markdown file to docs/src, and add a link to it under the SUMMARY.md Reference section. It's just mdbook, so you should be able to work on it locally.

Once you get started, I'll assign the issue to you 👌

@philpax
Copy link
Contributor Author

philpax commented Feb 23, 2023

Happy to brainstorm about client-side prediction and server reconciliation :) I've written a bit about this.

Awesome! I've seen your articles before and they're great - I've shared them with other people to help explain the intricacies of networking.

We can't do any work on prediction until we have #6 - but I'll definitely catch up with you and others once we get there 😄

@canadaduane
Copy link

canadaduane commented Feb 24, 2023

Have you considered using WebRTC at first, for its ability to support UDP? Here is an implementation example of a javascript server & client: https://geckos.io/

@arthuro555
Copy link

For UDP on the web, geckos has a few problems that make it neat for small projects but unpractical at scale, notably requiring all the ports of a machine to be open, not working in docker/kubernetes...
See geckosio/geckos.io#245

Instead, although support is still limited to chrome-based browsers, using WebTransport (based on QUIC) would likely be a better choice. Although there is no rust implementation yet, there is a C++ one: https://github.com/google/quiche

@philpax
Copy link
Contributor Author

philpax commented Feb 27, 2023

Matchbox could potentially be used for UDP traffic over the web, but using WebTransport is likely preferable anyhow. I'm not sure if WT will work with pure QUIC (i.e. our existing Quinn), or if there's another layer that needs to be implemented first. More research is definitely needed in this area!

philpax added a commit that referenced this issue May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation meta:good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants