The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

0 votes

I'm working on a multiplayer 2D Shooter, and I managed to make it support multiple players locally pretty well. Currently it supports up to 6 players, and I don't intend to put much more than that.

But I have no idea how to port it to the online network and enable players to create their room/servers, and I didn't found any good content about this.

in Engine by (55 points)

1 Answer

+1 vote
Best answer
  1. Do you want to host the game servers?
  2. Or do you want the players to host their own server?

I would write a "game tracker" (which could be an http server) which keeps track of the opened games.
Then if a player wants to join, the game tracker has to provide the ip of the server.

For 1. you have to start the server when a player "creates" a new game. (Register it on your game tracker). Then tell the players the ip.

For 2. the server creator tells your tracking server that there is a new server it must track.
Then make shure (maybe with godots new miniUpnp wrapper) that the port is forwarded on the servers network. Then the players ask the tracking server for the ip, then connect like normal.

by (107 points)
selected by

Oh yeah, I want the players to host their own servers.

Thanks for the tips!

I'll start the search now. Let me know if you know some good sources/tutoriais for me to apply it to my project.

I've written a prototype a few month ago. We also need something like this for our new game, maybe i could opensource it. (but don't nail me on this please :) )

This sounds great. Let me know if you made it opensource xD

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.