Search Unity

Some questions on server hosting...

Discussion in 'Multiplayer' started by FuzzyQuills, Aug 21, 2014.

  1. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Hi. I have a game that uses Unity Networking. and atm, it uses the default master server in unity HQ. But this would be really clunky if I had to use the server once the game is released.

    How would I go about setting up my own server remotely? I can't do it at home, as the internet there isn't on all the time. I was considering google drive, but it can only host HTML, not full-blown server software! Failing that, I could use UDP sockets or something, but only Unity Pro has that... :(

    EDIT: Turns out there is a possibility of having the connection up all the time! I still wouldn't mind a solution that might work remotely though! :)
     
    Last edited: Aug 28, 2014
  2. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
  3. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,038
    You should be able to run the master server on a small VPS fairly cheaply. You only need a little space and 256MB RAM on a Linux server to build it, but could get away with less for a low-traffic server once it's actually running. All VPS hosts let you scale it up if your game starts getting popular.
     
  4. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Sorry for being a bit of a n00b, but what's a VPS host? I gather it's some sort of virtual private server? (just guessing... :D)
     
  5. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,038
    Yep, it's an isolated section of a server that acts like a full server (apart from having less resources) :)

    A domain name (preferably a subdomain) to point at it is advisable too. PM me if you need serious hand-holding.
     
  6. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    BTW, I got a compile error saying: "Unknown reference: FindParent" Is this something the ncurses library has? I also go the error about the "Height" But I was able to fix that easily, the only thing barring me is the FindParent error.

    In case you need some more info, here:
    CPU: Intel Atom N270 (Might question server performance, but a mini lappy can't be that bad... ;))
    RAM: 1GB (Might need more, I can upgrade to 2)
    OS: Linux Mint 15. (Could THIS be the problem?)
     
  7. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,038
    You should probably have the package "build-essential" installed at the very least. It should be in Mint, since it's based on Ubuntu. I'd need to see the rest of the error messages to even guess what it could be that's missing. There might be need to get "
    libncurses5-dev" or a similarly named package too.

    I can recommend Lubuntu over Mint for a laptop like that. It's real Ubuntu, but the default is an extremely lightweight desktop (Xubuntu is similar).
     
    Last edited: Aug 26, 2014
  8. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Yea, I actually had Xubuntu installed, but I ended up overwriting the install with Windows Vista (REALLY?! :D) at some point for some reason... Anyway, I can easily overwrite the install again to do this. That's the best thing about my mini: it is good for all sorts of testing! ;) I also like Xubuntu, as it has a nice theme that isn't much of a strain on resources. (gotta love the brushed metal... :))

    And is that what the package is called? I wondered why just typing "ncurses" came up with an obsolete package... :D Anyway, thank you for your help so far! :) I shall deploy in 3... 2... 1... :cool:
     
  9. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    I have successfully built the executables, and have them running on my Mini Laptop! :)
    I will post results soon.
    Once that happens... I shall seek out a good, free, not over-the-top VPS service! :D
     
  10. Arp-Leonhard

    Arp-Leonhard

    Joined:
    Dec 4, 2013
    Posts:
    2
    there is no such thing. just invest the 8$ a month for a really nice vps. it can also serve you for other purposes such as hosting your game's homepage, blog, forums, support, custom email, databanks and backups. basically every cheap hoster can get you this for a hand full of dollars a month.
     
  11. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,038
    Pick one :)
     
  12. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    @Arp-Leonhard: I actually have a good website host already: GOOGLE DRIVE! :D
    And I am sure there are free VPS services out there (I only need a simple 1GB free thing for the game server, and nothing else! ;))
     
  13. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    @orb: I worked it out: since I have technically got my own server at home, would it be possible to map my Dell Mini 9 (aka. the Master Server) to a dot.tk domain? I actually have two: the second one was created just for this purpose. ;)
     
  14. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,038
    I dunno. It's not recommended once you get to a larger number of users, though. The typical consumer modems will have trouble with many connections ;)
     
  15. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    What would you recommend then? I was also going to have it so that the game could use the test server at Unity HQ, should mine go down. and plus, I want to see how MY network can handle 1000 connections, and to do so, I need a way to access the server from anywhere, which means I need to map the computer to my domain name. (aka. gamemode-bedroomlogic.tk) This way, when I post my server test on the forums later, I can then assure everyone the server will point to the right one!

    BTW, here is screensot of my domain's DNS details:
    DNS_details.png
    Also note the IP address isn't correct, I forgot the public IP... :D Also know a reliable way to get the public address of the server? :)
     
  16. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,038
    http://www.whatismyip.com :)

    You can do what you want (as long as your ISP doesn't decide to shut you down!), but a home router-modem isn't good for reliable connections and response times with thousands of connecting users. The master server might be fine for a lower number, but a large number of users hitting it every 10th second will cause your 'net connection to suffer.
     
  17. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    @orb: again, I wish to test this to see how my network handles it. true, home networks aren't the best option in the world, but not everyone has a fibre-optic magician! (I wish I did... :D)

    BTW, I worked out how to map it to a domain! (Actually, it's a really n00b answer... ;)) I found out, *facepalm* that the router at home has port forwarding, and reading this: http://www.howtogeek.com/66214/how-to-forward-ports-on-your-router/ I worked out the basics of it. this means I can then map the public IP to the domains, then the port forwarding takes care of the rest.

    Here is how I think it would work. also note: I changed the domain names, I now have two dedicated domains, one for the master server, and one for the facilitator. (masterserver0-bedroomlogic.tk and facilitator0-bedroomlogic.tk respectively) I might also set up a connection tester in future...
    1. the user connects to the internet with the game. (let's assume my current game project, "ZAPPI" is being used to connect.)
    2. the parser in the network code retrieves the public IP from the DNS service at feenom.com (dot.tk domains are stored here) the router's port forwarding "forwards" therequests to the correct ports. (in this case, 4**** for master, 4**** for facilitator)
    3. the IP is retrieved, a connection is made, and the master server registers the correct hostdata: DONE
    This is how I think it works. please feel free to correct me if I am wrong. ;)

    EDIT: Removed the port numbers for security reasons... :D
     
    Last edited: Aug 28, 2014
  18. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Ok, for some reason, facilitator pings, but ms0-bedroomlogic.tk doesn't...
    maybe I should wait for DNS records to update? the facilitator ponts to the netgear router, (and thus, my Dell Mini 9) but the masterserver pops up 202.136.40.61, (NOT my public IP) now what? o_O

    BTW, if the same IP address but different port number is port forwarded, does this cancel each other out? I am confused a lot right now...

    EDIT: I also found the facilitator won't connect in-game. how to use the public IP? (or, at least, basic instructions on what to do to port-forward the router to my computer?)

    My current port-forwarding setup:
    External start port: 42000
    External end port: 42100

    I think the problem is here:
    Internal start port: <same as external start. maybe it should be different?>
    Internal end port: <same as external end. maybe it should be different?>

    Should I be worried? :D
     
    Last edited: Aug 28, 2014
  19. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,038
    The ping is probably lacking because your modem-router blocks some or all ICMP packages.

    Port forwarding is just what it implies: One range facing outwards is translated to a potentially different range on an internal computer. It's a bit of a headache to figure out sometimes when modems have different labels for everything. The simplest and most dangerous solution is just to stick your server in the DMZ, if your modem has that option.

    I also noticed that common network debugging tools simply won't use that domain name. I think that may be a problem, because you lose a ton of tools which could aid you in setting it up.
     
  20. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    I had a look around at DMZ type hosting, and it appears that might be the way to go, if it directly exposes the computer to the internet, as that is most likely the problem. (TOO MUCH... SECURITY!!!!) It runs Linux, and being that it is there purely to be a game server, an attack from transmitting to my laptop probably won't happen. or so I believe... ;)

    BTW, I figured out the URL problem: the .tk domains hadn't actually updated the DNS records yet... And that resulted in some weird issues! I found the new domain (ms0-bedroomlogic.tk) didn't work yet, but the older one (masterserver0-bedromlogic.tk) was somehow found in the DNS records. (of course, it timed out on the ping command) I also forgot to name them MS0 and FACILITATOR0 respectively! :eek:

    And the assumption that network debug tools won't use it... is somewhat wrong. I was able to ping the facilitator URL just fine.

    Basically, ignore the last post somewhat... :D
     
  21. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,038
    Yeah, DNS isn't instant. You can get lucky and see it in 10 minutes or less, but it takes 48 hours to propagate across the world. It just doesn't do that in a linear fashion :/

    Sure, you would be able to ping the name now that it HAS propagated. But that wasn't the case right away :)
     
  22. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    True... atm, the network at home is off, so I can't do testing yet. will have to wait till I get home to do that. I will also see if DMZ hosting works once I get there.

    I might also ask: is this URL accurate for port testing:
    http://www.yougetsignal.com/tools/open-ports/
     
  23. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Hi, I think I found the problem: would the NetworkManager in Linux cause problems? I found it wasn't running anymore... :D (That actually started happening since I fired up the master server and facilitator for the first time)

    EDIT: Giving a re-install of Xubuntu a go. (Had linux mint 15 before, now installing Xubuntu 14.04!) :D

    EDIT2: WHOAAA! DAT BOOT SCREEN!!! :D :)
     
    Last edited: Aug 30, 2014
  24. orb

    orb

    Joined:
    Nov 24, 2010
    Posts:
    3,038
    No idea what that does. I think it might be for wi-fi.
     
  25. FuzzyQuills

    FuzzyQuills

    Joined:
    Jun 8, 2013
    Posts:
    2,871
    Ok, I tried a different modem, and no-ip.com... so far, the DNS now points to public IP, but the actual computer isn't recieving anything! May have to check the firewall on the computer... :D

    I also saw something embarrasing: the modem that I am using now is ADSL1, yet it goes faster than the netgear ADSL2+ router! And I wonder why... :rolleyes: