Search Unity

Unity master server

Discussion in 'Multiplayer' started by PeteRoobol, May 7, 2009.

  1. PeteRoobol

    PeteRoobol

    Joined:
    May 7, 2009
    Posts:
    7
    (First) Hi All

    We are excitedly on the cusp of having our first unity multplayer fps ready.

    Currently it uses the unity masterserver, with room select like in the network demos- all works fine at one network location, connect through lobby to in game views and rpcs, its beautiful compared to our older shockwave tcp games.

    The problem is when we try to connect from diffent locations, say home office, the room appears but will not connect.

    After this last week of scouring archive, retesting, head banging wall we noticed this is also true of several other online unity games by other developers...?

    Today we'll try to build the masterserver and get running off one of our own servers, retest.

    Short of trying to find and hire a NAT punchthrough specialist can anyone give us any pointers.

    Many thanks
    pete
     
  2. DocSWAB

    DocSWAB

    Joined:
    Aug 28, 2006
    Posts:
    615
    If you are connecting through your firewall, you may have to open UDP ports to see through, even if the NAT punchthrough reports that it works.

    Check the Master Server documentation, but I think it's UDP port range something like 23000 - 50000, which includes the game UDP port as well as the master server and facilitator port.

    I've also had to turn off some other router firewall settings to be able to connect to our game instance (allowing more inbound traffic). If I tried harder, I could probably figure out how to allow the traffic in a more targeted way.

    I don't think running your own Master server will make a difference in what you're seeing.
     
  3. PeteRoobol

    PeteRoobol

    Joined:
    May 7, 2009
    Posts:
    7
    Hi Steve

    Thanks for the reply, we tried allowing ports and setting firewall pemissions on both our computers and routers- still no joy. It's such a shame as on the same network its sweet.

    This is a worry for us as there's no way we can expect end user to do this.

    Just to know we are not laughing at the moon are there any current examples of unity network games that do work?

    I think we'll quietly public beta the game and monitor feedback access- short of waiting for improved future network punchthrough we could also explore SMS or Photon as additional options but with the current per game license costs would need to know the return is worth it.

    Cheers
    Pete
     
  4. DocSWAB

    DocSWAB

    Joined:
    Aug 28, 2006
    Posts:
    615
    There are numerous Unity games that make networking work, including some very large ones. WolfQuest is on, but at this point by no means the largest.

    I've been reviewing the process now and can be a bit clearer about what's needed:

    For a user to JOIN a game, their router must enable outbound UDP traffic on the port number you choose for your game to run on in addition to the Master Server and Facilitator ports. Or just allow all outbound services (Sometimes called "NAT only" or "Firewall off" on router firewall settings.

    For the machine hosting the game (or centrally or peer), it the router firewall must also allow INBOUND services on the game, master server, and facilitator ports (or be in DMZ mode or not block any inbound services)

    AND the UDP port for the game traffic must be forwarded to that computer through the router to deal with NAT.

    This is all pretty standard fare for playing networked games, and anyone who plays online games like this ends up having to do some configuring.

    If you are using a central server and not peer to peer, and you have control over its network connection, you might be able to get around the requirement for the game host router to have port forwarding set up if it has a public IP address. The Unity network protocols deal with public (non-NAT) connections differently.

    But the basic access of the router allowing incoming UDP traffic on those ports for client games is a bare minimum.

    Good luck!