Search Unity

Confused about networking

Discussion in 'Multiplayer' started by brred, Sep 1, 2012.

  1. brred

    brred

    Joined:
    Sep 1, 2012
    Posts:
    6
    I'm developing a game with networked multiplayer, and everything works fine. I've been using Unity's MasterServer and I understand that a MasterServer only hosts game information and mediates connections, but I don't understand how the servers themselves work. I understand that I would need to rent a server in order to release the game. Who provides the cheapest server rentals? What do GameSpy, Photon, SmartFox, etc. provide? Is it just network code and interfaces to use in unity, or do they provide physical servers too? What does it mean to build Unity's MasterServer on something? I think what I'm missing here is the relationship between a physical server, server software, and unity. Could somebody summarize the main concepts here please?


    It's for Android and iPhone btw
     
    Last edited: Sep 1, 2012
    HowWeLife likes this.
  2. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    You could easily find all this stuff on the website but here it goes...
    The master-server is a software application that indeed provides ways to unity servers and clients to connect to eachother through routers/firewalls and NAT.
    A unity server is a unity application where you execute the command "Network.InitializeServer" because then you are accepting client connections.
    Do you need a physical server ? If you need a master-server then yes because you need to host the software on a public ip so all clients can connect to it.
    Photon and SmartFox are both software applications (game servers) who basicly replace the unity networking.
     
  3. brred

    brred

    Joined:
    Sep 1, 2012
    Posts:
    6
    So Photon and SmartFox provide only the networking software and not a physical server? I'm trying to use a master server. Photon Cloud provides the physical server, but I have to implement the Photon SDK, correct?
     
  4. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    Sorry, never worked with Photon cloud but yes SmartFox and Photon have a software server application.
    I worked with SmartFox and thats basicly a server where you write your server code in (real)Java extensions which can then be attached to the software server.
     
  5. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    1. If you don't use Unity networking you require iOS / Android pro to do any multiplayer gaming as .NET sockets on mobile are a pro only feature.
    In this case you would rent a windows / linux dedicated machine with root access and host connection tester, master server and nat facilitator there
    2. To release a game with multiplayer on iOS / Android I would look at what you need.
    * Realtime Networking favors Photon Cloud seriously, because it will relay the whole information flow which removes the need for NAT punchthrough which fails far too often on mobile networks which do not allow it. Same holds for WiFi hotspots in the wild outside the homeuser space.
    * For asyncronous networking like a social MMO etc, there are different options. Player.IO is definitely a really strong one. But Moai is very strong solution too.

    If you do not need 3G then you could potentially go with Unity Networking and with setup as described in 1
     
  6. brred

    brred

    Joined:
    Sep 1, 2012
    Posts:
    6
    So I can't use Photon without Unity pro, correct? If I can't, what do I do from here with Unity networking? Do I build the Unity master server on a rented server? And what are some servers I could rent?
     
  7. appels

    appels

    Joined:
    Jun 25, 2010
    Posts:
    2,687
    wrong, you can.
    Don't go rent servers, run the master on your own computer or in the LAN at home so you can test for free.
    Only go rent a server if you realy need it.
     
  8. brred

    brred

    Joined:
    Sep 1, 2012
    Posts:
    6
    So if I were to host photon on my own computer for release (though my service is spotty sometimes), how could I do LAN or bluetooth connection options? I could use Unity networking for LAN but then I'd need to specialize my code for each case. What would then be the best course of action?
     
  9. quincunx

    quincunx

    Joined:
    Apr 22, 2012
    Posts:
    15
    Your server will be what talks to all your game clients. You will host your Master Server at another location (that will have far superior networking capabilities than your house) so that clients may connect together from wherever they may be.

    So you can go buy a physical server (dedi or vps, if you choose to go elsewhere than smartfox photon) which are going to be running your server software in order for your game (unity) to connect to. I hope that explains the relation.

    I am looking into using uLink for my networking middleware because they charge per game title (pay once per game, not monthly etc) and you can physically host the servers. ALSO, (this may benefit you a lot) they have a program that will convert all of your Unity MasterServer scripts etc into uLink format, so you don't need to re-write a single line of code.

    Here's a link to their trial. I hope this helped you in some way!
     
  10. EdelT

    EdelT

    Joined:
    Sep 5, 2012
    Posts:
    1
    Hi brred,

    if you are still looking for a solution. I also could recommend photon, especially when you are targetting Android and iOS systems. You could easily use Unity, develop via C# and deploy to your preferred plattforms. Sources, Documentation and Tutorials can be found here: http://doc.exitgames.com/photon-cloud/
     
  11. lvictorino

    lvictorino

    Joined:
    Jul 9, 2012
    Posts:
    31
    Ok, so everybody suggest to use Photon. Right. But what about the price? Isn't it a bit expensive for a game when you can actually be sure to reach your players on an overcrowded market ?
     
  12. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    We know that it's almost impossible to know how many users you will get. Especially for indies and smaller projects.
    We try to offer a simple and flexible pricing.
    You can host the server yourself for up to 100 concurrent users, which is about 5000 to 10000 customers. When you have more regular customers, you hopefully earn some money and upgrade the license. If not, get in contact with us.
    The Photon Cloud includes hosting (with a fixed server feature set and no persistence). Again, there is a free option (20ccu) and you can subscribe and cancel on demand.