Testing multiplayer game with computers at home

I have three desktop computers at home. I want to test out my multiplayer game through the internet with them, However, they are all behind the same router. I’ve had success connecting all of them to a server in the game, but when I try to get my friends to join from their house, they cannot. I need to debug what the problem is, but it would be much more convenient to troubleshoot with my computers at home. I heard I need different routers/modems for each computer in order to get them to connect to the game through the internet and not the lan network. Do I need to purchase another router and modem for one of the computers or is there a trick I can do?

Thanks

You’re most likely networking via local addresses (127.0.0.1 or 192.168.x.x). For your friends to play, you need to connect on your external IP find out here. Beyond that it’s possible that your IP disallows inward bound traffic requests unless you pay for a commercial or business internet, or pay for a static IP. This is common practice to ensure that people pay to be reachable.

I been using my Ipv4 address, which actually is 192.168.x.x. But doesnt work for my friends. I tried using my normal ip address that I can find on whatsMyIp, but doesnt work for my friends either.

However, when I use unities provided master server service instead of self hosting the master server, I can halfway reach my friends in the game. They see the game name in the server browser, but when they click on it to join no level is loaded and nothing happens. The bases of my networking system was done using the networking tutorial on blender cookie. http://cgcookie.com/unity/2011/12/20/introduction-to-networking-in-unity/

I asked a friend to create a game and have me join instead. I clicked on the game in the server list and got an error message. I forgot exactly what it said, but something like… could not connect to (their ip address), does the ip allow connections?

So if I understand correctly, I need to pay to self host the master server. Which im just testing for now so probably wont. However, I’m wondering why using unities free master server hosting does not let players join the game when they click on the game in the server list.

could someone point me in the right direction? If no one can help me with the main problem with players not being able to connect to the game over the internet, then is it possible to get one of my computers at home connect to game through the internet and not the lan network so I can debug it?

I follow the same tutorial.
To solve this I put a text field to put the Ip and a button to connect using the Ip on the text field and works. You can make a text field for the port too.

Where does the ip and port get put into? The network.connect arguments?

yes but think that the port needs to be converted to an int

How come the tutorial writes this though, Network.Connect(hostData*); They dont put in any specific ip or port.*

You must use the master server, and it mustn’t be hosted behind your NAT - it needs an independent view of everything.

If you’re using the master server correctly, passing the “use NAT” flag, and your friends can see your game but can’t join it, then it could be a problem with your router being too strict. Mapping the port explicitly should help in that case. It’s also possible that your friend’s router is causing the problem - again, making an explicit port mapping may help, though Unity doesn’t let you choose the source port so that’s questionable.

I let the game through the firewall in the settings of the windows firewall allowed programs, turned off the firewall in avast, and forwarded the correct port in my router settings I believe. But it still doesnt work. I’m completely new to this so dont know much of what im doing. How do I make a explicit port mapping?

The port mapping bit is what you did in your router. You need to forward UDP (not TCP) traffic on the port your game hosts on (the number in your InitializeServer call).

The firewall stuff might matter too, though Windows usually just alerts the user if the firewall is about to block something.

I forwarded the port number thats in the InitializeServer() function, although players still see the game in the browser, but cant connect to it.

what else do I need to do besides forward the port?

I’m so close to getting my game online. But I just need to know what I’m missing. I forwarded the port im using in the InitializeServer() function and made sure it was using UDP, disabled my avast firewall, and allowed the program through the windows firewall manually under allowed programs. What else do I need to do?

We face the same problem, did you solve yours?
Please share your result.

Thanks.

Manage your router’s firewall settings. Easiest solution would be to put the test pc’s in a so-called ‘DMZ’ or Demilitarised Zone, which stands for that these computers have a straight internet connection, while potentially unsafe it guarantees that no firewall or such will get in the way from the routers side.