I’m using ENet with only 1 server and 1 client (essentially peer to peer). I’ve been following the networking guide from the docs. However I was wondering if there is a way to set this up without the host being required to port forawrd. So I was wondering if there are any guides on how to setup NAT with ENet on godot?
Can UPnP be used with ENet? I got to UPnP in the documentation, but I thought it was an alternative rather than something that could be used with ENet.
So if I understand the docs correctly, I need to only add the port I will be using for peer.create_server, via upnp, and then remove it when I’m done with it? Is that all? If that is the case thanks a lot, I will try to test it out tommorow!
Yes this is for sure what you want, I’m sure of upnp functionality, but I haven’t integrated it yet into my multiplayer game yet so I’m unaware of any caveats.
@gaboot is right, @CabalCrow upnp needs to be enabled on a router to work. There are many opinions that it is unsafe to enable it on routers, and some manufacturers do not enable it by default. Alternatives exist, like PCP, but Godot does not have an implementation and has a similar problem of general support on all hardware.
The Godot docs on UPnP do mention these facts. If you want to learn more the general term for this is called NAT traversal. Although you will probably be better off with UPnP as it’s over 20 years old where PCP is just over 10 years and I don’t think UPnP is going anywhere anytime soon.
Yeah I had some issues with UPnP, even though I had it enabled on my router. It seems it is behind CGNAT, which makes it harder (impossible?) for me to port forward. This is why I started considering NAT punch through for which I found that plugin. That being said the guides on how to use it with godot seems limited. I guess I will have to look into how NAT punch through is done generally and try to go for an implementation if I can’t get the plugin to work.