#Online Multiplayer options for web-based clients

1 messages · Page 1 of 1 (latest)

hollow viper
#

I am complete noob to networking and trying to understand exactly what are my options when it comes to making an online multiplayer game in Godot 4.3.

Reading through the docs:

https://docs.godotengine.org/en/stable/tutorials/networking/high_level_multiplayer.html

"...Most notably, the HTML5 platform currently offers WebSockets and WebRTC support but lacks some of the higher-level features, as well as raw access to low-level protocols like TCP and UDP."
(Meaning, direct TCP/UDP is not supported? But doesn't HTML basically run off of TCP protocol??)

https://docs.godotengine.org/en/stable/tutorials/export/exporting_for_web.html#limitations

"Low level networking is not implemented due to lacking support in browsers."
(Again--no TCP/UDP.)

"Currently, only HTTP client, HTTP requests, WebSocket (client) and WebRTC are supported."
(Meaning, ENet is not supported? Also since it uses UDP under the hood?)

==========

TLDR:

For HTML online multiplayer games, one must use either direct HTTP, WebSocket or WebRTC.
TCP/UDP and ENet are not supported.

Is that basically right?
Thanks!

https://gafferongames.com/post/why_cant_i_send_udp_packets_from_a_browser/

finite void
#

To clarify, high-level multiplayer is easier to use (more oriented to be human readable). So you should def. go for that if you're new to networking.

You can make the entire game work with just what's in the High-level multiplayer tutorial

hollow viper
#

https://docs.godotengine.org/en/stable/tutorials/networking/high_level_multiplayer.html#hosting-considerations

"... Godot's high-level multiplayer API only uses UDP, so you must forward the port in UDP, not just TCP."

".,..Godot's high-level multiplayer API uses a modified version of ENet which allows for full IPv6 support."

Can someone please define exactly what is meant by "high-level multiplayer API?"
Is it just anything using / interfacing with the MultiplayerAPI class (such as MultiplayerPeer)?

Does this mean that none of the classes inheriting / using the MultiplayerAPI (such as MultiplayerPeer) are going to work with web exports (looking at you, WebRTCMultiplayerPeer and WebSocketMultiplayerPeer.) Due to no UDP over web. This seems counterintuitive.

Thanks

hollow viper
#

Either that or a SSL cert error. I can't get web exports using multiplayer api to work at all

hollow viper
#

Nor can I get them to work without using multiplayer api, apparently 🤷‍♂️

hollow viper
#

So after a bunch of trial and error, I still have not gotten a functional WebSocket demo to work outside of the editor.
Any tips would be appreciated. For now I am switching back to ENet and using Windows .exe connected to a VPN/tunneling service such as Radmin VPN or Playit.gg.
Would prefer client running in the browser but if it doesn't work, it doesn't work.
Thanks

finite void
#

I think you'd have a better chance reporting this on github.
At worst you'll get an answer as to what you could be doing wrong.

#

Or #1235176210477355098 if anything.

hollow viper