-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Add support for WebTransport #3899
Comments
My take on this is that it's way too soon to implement something like this. |
I agree that an attempt at a functional implementation at this time would be quite unproductive. The selection of available C/C++ libraries to implement a QUIC server is rather sparse. I nonetheless believe the feature proposal is worth keeping in mind - I anticipate that WebTransport adoption will be quite significant as it stabilizes, particularly within the niche of multiplayer browser games. |
The spec is stable and available in multiple browsers now, is it a good time to look at this again? |
Safari support is still missing as of December 2023: https://caniuse.com/webtransport |
This ticket requires #8770 and then HTTP/3 and QUIC. |
Describe the project you are working on
A real-time multiplayer browser game with an authoritative server.
Describe the problem or limitation you are having in your project
A client-server multiplayer game requires a network transport that minimizes latency. For a natively installed game, this would traditionally be accomplished using a bespoke "netcode" sent over UDP, and any additional requirements like reliability or ordering were handled at the application layer. But within a browser, the only options for real-time full-duplex communication is via WebSockets or WebRTC.
WebSockets are ill suited for multiplayer games because the enforced ordering/reliability of the underlying TCP transport causes unacceptable latency spikes and degrades gameplay experience, particularly in the case of FPS games, MOBAs, and other such "twitch gameplay".
WebRTC has an option to use an unreliable/unordered transport mechanism, but it is designed with peer-to-peer in mind. Using it in a server is very clunky and difficult because there are no easy-to-use, stable, performant WebRTC implementations beyond what is in the Chrome/Firefox browser, and the handshaking process is fraught with complexities like STUN/TURN that are meant to address issues that don't exist for a public server.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
With the release of Google Chrome v97, The long-awaited WebTransport API is here at last. Like WebSockets, WebTransport offers a way to perform bidirectional client-server messaging. However, unlike WebSockets, a WebTransport connection can be configured to use an unreliable/unordered transport for low-latency real-time communications, where packet loss is tolerable.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
WebTransportMultiplayerPeer
which inherits fromNetworkedMultiplayerPeer
.WebTransportClient
andWebTransportServer
, which inherit fromWebTransportMultiplayerPeer
.SendStream
andReceiveStream
for reliable/ordered transportWebTransportDatagramDuplexStream
for unreliable/unordered transportHere you can find some examples of how to use the JavaScript API for WebTransport.
If this enhancement will not be used often, can it be worked around with a few lines of script?
When building for HTML5, one could wrap the WebTransport object with Godot's own
JavaScriptObject
. However, a headless server build would need a fairly extensive module/plugin to use an external WebTransport server library.Is there a reason why this should be core and not an add-on in the asset library?
WebSocket, HTTP and WebRTC support are all core, so it makes sense to add WebTransport support to that as well.
The text was updated successfully, but these errors were encountered: