How to multiplayer

4.3 godot steam

i was wondering if there s any guides of setting up multiplayer that actually works on diffirent pc not connected by lan so far i havent found any that actually duiscuss how to make a ready to work multiplayer system

I’m assuming you have already read the section in Godot’s documentation concerning multiplayer networking (see high-level multiplayer).

It is specifically mentioned that forwarding a port on your router is required to let non-LAN clients connect to your server:

If you have already forwarded your port (correctly), I’m afraid your issue will be very hard to debug unless you share the entire codebase for your project; networked games are typically much harder to debug.

If you wish to avoid the need for users to forward the port on their own router, you will have to research what a NAT is and how its behaviour can be integrated into your game’s server functionality.

From what I remember, one approach is to host a “matchmaking server” that clients connect to. After matching a set of clients with one another, the server appoints one client as the peer-server and is sent the correct (NAT-corrected) IP address for the other clients. I could be entirely wrong about this though! I am a seasoned beginner in this area and am still actively learning as well.

EDIT: I’m reading this article right now and so far it is providing a simple and clear explanation of how NATs work, and provides examples of how the NAT can be traversed in a peer-to-peer context.

1 Like

thanks ill read up on this !