Hello, I’ve been putzing with Unity’s NAT Punchthrough stuff and found out that my friend’s network is incompatible with mine. I want to make a game where one of the players is the host for two other players to both save money on servers and save time. What sort of work-arounds are there, if any, for Unity’s NAT Punchthrough incompatibilities? Do I have to tell players to open certain ports on their firewall?
To be specific…
My Network: ConnectionTesterStatus.LimitedNATPunchthroughPortRestricted
You’ll probably need to have players who are hosting games make sure that port forwarding is setup on their router if NAT punch through isn’t working.
So for example if a player wants to host a game on port 5000, they’ll need to have their router forward port 5000 to their machine’s IP address. Generally, anyone who is hosting a server needs to have a public IP address or port forwarding setup to allow clients to connect reliably. This is usually sidestepped by modern games by having some kind of third party service that hosts your games for you.
You could try using the Photon Unity Server by Exit Games, but there may be fees / licensing / total concurrent connection restrictions involved with that.
Hi, I am running into the same issue. The suggestion of using Photon Unity Server, do you mean that it has functions that are alternatives to NAT punchthrough, or using Photon as a third-party service of hosting the games?
So you tried using Photon and ran into the same problem? That's curious, I assumed that Photon would host the game that both clients connect to, thus eliminating the need for a direct connection between clients.
I just recently released a plugin on the asset store that handles NAT punch-through and automatic port forwarding. It is a really easy to use drop-in solution that requires almost no code modifications. All you really need to do is call StartHostAll() and StartClientAll() instead of the normal StartHost() and StartClient() calls.
Using the plugin you will be able to connect to hosts behind a router no problem without any manual port forwarding needed.
Hi, I am running into the same issue. The suggestion of using Photon Unity Server, do you mean that it has functions that are alternatives to NAT punchthrough, or using Photon as a third-party service of hosting the games?
– initialsHLSo you tried using Photon and ran into the same problem? That's curious, I assumed that Photon would host the game that both clients connect to, thus eliminating the need for a direct connection between clients.
– whyunoworkunity