Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Multiplayer Limitations

Discussion in 'Multiplayer' started by scottobot21, Jun 13, 2008.

  1. scottobot21

    scottobot21

    Joined:
    Jun 13, 2008
    Posts:
    5
    I am looking to do a networked Unity project that can accommodate about 200-300 users per server instance. It is not a "high action" type of application --- mostly walking around and chatting with other users. Can anyone offer some insight into whether this is feasible using Unity's current networking capabilities? Is it recommended to use Unity as a dedicated server or some other server technology?
     
  2. scottobot21

    scottobot21

    Joined:
    Jun 13, 2008
    Posts:
    5
    I guess, from what I've been reading on the forums, implementing multiplayer like I've described isn't really supported out of the box, nor is it proven with any implementation of Unity thus far (all the multiplayer examples I've seen seem to support a small number of users).
     
  3. MikeHergaarden

    MikeHergaarden

    Joined:
    Mar 9, 2008
    Posts:
    1,027
    It could be possible if you make sure to not send updates of all players TO all players.

    Atm you would need to add an extra class to make sure to only send updates of close objects.


    However, I am not sure about the networking capacity, I will test it for 50-100 players in a few months myself.
     
  4. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    If you cleverly use the networking, it should be possible if you reduce the sending frequency of data to a usefull level and make sure you only send what is really needed (for a heightmap based game for example, you wouldn't need to send y position if y is the up-down direction of your terrain).

    The range based approach suggested above is a must have as well and clever usage of visible blocking objects in your world so you can restrict the data syncronization even further by clever usage of appropriate technics like PVS, sectors or your own approach basing on the design.

    Without that kind of things it does not mather what engine and networking you use, it will not work.
    There is no out of the box technology that allows you to have more than 128 players
     
  5. SixTimesNothing

    SixTimesNothing

    Joined:
    Dec 26, 2007
    Posts:
    167
    i'm working on multiplayer project with a lot less players than that, but with multiple units per player (it's kind of a mini, mini-MMORTS/RTT thingy) and i've been having the same thoughts about problems with network traffic. but i'm still probably around 1-2 months off having a technical demo that will give any real data about maximum unit/player capacity. i'm also planning on limiting the number of players (and hence units) that each player needs to get updates from, but i'm helped out by the fact that on average half of the players in a game will be in orbit and the other half will be on the planet below (it's a sci-fi game. obviously), so they will never need to see each other. also given the larger scale of RTS games and hence the slower relative speed of units, i think it will be acceptable to have much less frequent state synchronisation than that of an RPG or FPS game.

    but i'll definitely post my findings about server and client capacity when i have something. i'm using a dedicated unity-based server, and i'm interested to see whether it'll be the server or the client application that suffers the worst performance loss as the number of player and/or units increases.
     
  6. tsphillips

    tsphillips

    Joined:
    Jan 9, 2006
    Posts:
    359
    Scottobot21, yes it is feasible. Benxing Entertainment is currently building out a system that is expected to handle at least 20,000 simultaneous users. We are using Unity for the clients and custom "secret sauce" for the back end. I would not recommend using a single Unity instance as a server to handle 200+ simultaneous clients, since it is not optimized for that function.
     
  7. scottobot21

    scottobot21

    Joined:
    Jun 13, 2008
    Posts:
    5
    With the release of Unity 2.1, does any of this change? I mean...is it more feasible now, with the new networking enhancements, to have a couple hundred users per server using Unity's built-in server?
     
  8. zumwalt

    zumwalt

    Joined:
    Apr 18, 2007
    Posts:
    2,287
    Unity has the backbone of Rakknet by JenkinsSoftware

    Rakknet

    What can it handle:
    Tested to 65555 connections per port, instansiated multiple instances up to 100 ports aka 100* 65555 listeners 6,555,500 player load test in simulation, sent 25k packets, 255k packets, 512k packets and 1 meg packets randomly across all ports in load test, no loss.

    Created a Mac standalone server, seperate thread per server port listener, setup 4 Desktop XP's, 2 Desktop Vista 32bit, and 3 Laptop XP on the network, split the users to load the connections and test the login/out, and transfer of information.

    Unity is built its networking around Rakknet, this request is not a limitation of Rakknet, maybe (and doubltfully) a limitation of the implimentation of Rakkent in Unity, highly unlikely.
     
  9. tsphillips

    tsphillips

    Joined:
    Jan 9, 2006
    Posts:
    359
    What you are really looking for is middleware. Unity is used to build clients. While it does have some peer-to-peer networking "stuff" built in for convenience, it is not designed to work as middleware. For large scale applications (like an MMO), the networking middleware can be extremely complex and highly specialized. There are various middleware components on the market, some free and some not. The first one that comes to mind is SmartFoxServer, which I believe is free for a small number of simultaneous connections.
     
  10. Brian-Kehrer

    Brian-Kehrer

    Joined:
    Nov 7, 2006
    Posts:
    411
    The good news is you can write your own server, or 'secret sauce' in mono, if you know what you are doing.

    If you want 200+ users, you must know what you are doing. If you don't have any idea where to start, I'd either find someone who does, or scale back the project.

    We wrote our own network layer, and while we don't have 200 people testing atm, 200 should be trivial.