Setting up a Unity Masterserver - how to do it correctly?

Hi everyone,

I have been struggling with creating a multiplayer game for a long time now. I didn’t really know how to do it, and how all the network related stuff works, so I started to watch tutorials (like this one, that explained a lot: CG Cookie | Learn Blender, Online Tutorials and Help - CG Cookie | Learn Blender, Online Tutorials and Feedback) and read documentations.

I am now able to set up a MasterServer (content downloaded from the unity website) on my laptop. So i have two consoles running: one MasterServer.exe and one Facilitator.exe. I can connect to the masterserver and register my game from any device within my home network, or outside. Also, when having two or more devices connected to each other via the masterserver WITHIN my home network, everything seems to be working fine - it’s like having a decent multiplayer game.

But there comes the problem. When switching my android device(Yes, I made a build for android) to 3g instead of wifi (so that is is not a part of my home network anymore) it CAN connect to the masterserver (I have port forwarded everything correctly! :smiley: , and you can see the masterserver.exe and facilitator.exe receiving and sending data ) but it cannot connect to my game running on my laptop. The error “Receiving NAT punchthrough attempt from target XXXXX failed” shows up.

So here are my questions:

-Is it true that the Master Server won’t work if it is in a NAT network? (see: NAT Punch-through) So do I need to host it somewhere? or can disable NAT in some way to make the server work properly?

-Is using the masterserver actually a good idea? Isn’t it too outdated or is it unstable or always having problems? anyone having experience with this?

-Is it a better option to hire a server - something like photon or smartfox?

This is what I’m trying to reach: Making a simple multiplayer scene where clients “all over the world” can connect to, whether they are in a home network, outside using mobile internet, or something else…

Any help is appreciated!

Thank you so much in advance!!

The thing I recommend and am currently using is Photon. Check it out on the asset store but in essence it is a server which works in the cloud and they host for you completely free (20 connections at once) and you can then pay for more licenses if you want it. These give you 200, 500 connections or unlimited something like that.

Perhaps a to late answer but the master server seems to work just fine for you, its just giving the address and port to the game server on your laptop with port and everything. Same as any other lobby would do.

But then you want to connect to that server and the problem occurs. That is you can not find the server running in you gameclient on your laptop. You would I presume have to port forward that port to your laptop in your router.