Godot Version
Godot-Stable-4.5.1
Question
I want to learn to make server-based multiplayer for a Godot browser game. What resources should use, and where should I start?
Godot-Stable-4.5.1
I want to learn to make server-based multiplayer for a Godot browser game. What resources should use, and where should I start?
Thanks! I guess the best place to start is to learn to make an HTTP server. Any particular resources or tutorials you would recommend when it comes to networking?
You do not have to make an HTTP server, you can use the same Godot project with --headless/exported as a dedicated server. Follow along with the high-level multiplayer tutorial(s) but you may have to use WebRTCMultiplayerPeer instead of ENetMultiplayerPeers for web based games.
I’ve used high-level multiplayer for Godot before, but I don’t think it will work for the kind of project I’m trying to make, in part because I want to have a much more granular control over the data sent between the server and clients. Moreover, I don’t want users of the client to have access to the code that is being used to run the server for security reasons, and so I want to have defined separate client/user systems.
You are supposed to run the headless version of godot on your server though, that’s the whole point. People wouldn’t have access to that at all.
Cool! Then yeah HTTP + Websockets will do you well, I’ve written my own Websockets for a game jam “Part of the Continuum”, fun experience but I love linux and systems programming. Using WebSocketPeer in Godot can be async-ified, you probably should steer away from high level multiplayer if you actively want to make your own server. And in making your own server you are pretty much on your own, connections through web socket are standardized and up to you to implement and respond appropriately to each Godot client’s requests.
This falls under “security by obscurity” which isn’t an effective method to secure anything. Remember to network like the KGB, trust but verify everything the client says.
Okay, am I missing something though, or would all of the server code also be contained in the client? It’s not just that I don’t want them to access the server (obviously), but I don’t want the client to be able to reverse engineer the server code from the client.
Thanks! And again, if you have any recommendations of specific resources to get started, that would be greatly appreciated.
For websockets I only read MDN’s documentation
For system’s programming I like Zig, and wrote a little about my experience writing the game server with linux’s epoll and openssl; it is by no means a tutorial, but does link to further tutorials at the bottom. Brushing over it again I am reminded that WebSockets will require a SSL certificate for secured connections (HTTPS is everywhere so bet on needing it).
Okay, thanks! I have no idea what I’m doing, but hopefully we’ll figure it out haha!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.