Search Unity

Networking question

Discussion in 'Multiplayer' started by ColossalDuck, Feb 26, 2010.

  1. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    So, the max number of players for unity is 32 and if you put 49 it would count as %49 of 16. Am I correct?

    If so, could I not put 400 and have 64 players max?
     
  2. Moredice_legacy

    Moredice_legacy

    Joined:
    Jan 31, 2010
    Posts:
    101
    Where'd you get that max number from?

    There is no max cap.
     
  3. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    I don't remember where I got that number from! But if there is no max cap then why is it bad to go beyond 32 players (I don't know where I got that information either :oops: ).
     
  4. Moredice_legacy

    Moredice_legacy

    Joined:
    Jan 31, 2010
    Posts:
    101
    The number 32 inherits from the maximum cap of 32 network groups you can create using the built-in Unity networking. The network groups helps separating network traffic and network messages, allowing you to for example send network data over one group (using it as a channel), and using a second group to send network chat messages. In effect, you can dynamically control your network traffic better using these groups. And if you're familiar with World of Warcraft, using the network groups in Unity would be the same as creating a general chat for each zone in the game (having one zone per group, allowing only those in the group to receive those messages).

    If someone said it was the maximum cap of players, they were wrong. If they said it was bad to go beyond 32 players, they don't quite know all the possibilities.

    You can have as many players as you like, the only limit will be how well-written the code of your server and/or clients are. In the end, you will reach a limit anyway, but that goes far beyond 32 if you got a good server-machine (if you got a standalone dedicated server) with well-written code.

    This is one of the bigger challenges if you're wanting to create a MMO with some hundred players. In theory, it's possible - but hard to accomplish.
     
  5. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    Wow, I sure am glad I asked. Thanks a bunch for your help and unconfusing me. This is really good news. :D
     
  6. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    If they said that for the Unity Networking, they knew very well what they were talking about. You can get up to 64 potentially a bit higher, but you will hit a barrier early after due to the amount of network communication that a single thread that handles networking and the whole world update just can't hold up with and as Unity does not allow connections to multiple servers at the same time, you can not just split stuff.

    All the nice manual message targeting on the server to get a "SetScope" for RPCs does not cut it


    If you naturally developped an own backend solution and use sockets, there are no limits (aside of what your architecture limits it to)
     
  7. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    hmm... Well, I won't need 64 players probably 45-50. Is it recommended to make a server backend or would it be fine to use unity (with the right coding of course)?
     
  8. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    With that amount of players you are fine to use Unity if you are going to host it on dedicated gaming targeted root hosts :)
     
  9. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    Good stuff, this news is ultimate. :D

    I just needed to know for future reference.
     
  10. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    I should add: you likely would want to use scoping / RPC NetworkPlayer targeting to reduce the network traffic.

    With all - all sync it could be a bit hefty for the end users.
    But technically there is nothing preventing you from going that way
     
  11. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
    Sounds good.
     
  12. Moredice_legacy

    Moredice_legacy

    Joined:
    Jan 31, 2010
    Posts:
    101
    @killer1390:

    As dreamora said, using scopes and player-targeted RPC can help out quite a bit if you're within the 64-player range. Developing your own backend will solve any problems Unity will encounter once you hit a certain amount of players above 64 (the invisible cap). Then again, developing your own backend is a lot of work - but worth it (and rather required) if you do need a huge lot of networked players.
     
  13. ColossalDuck

    ColossalDuck

    Joined:
    Jun 6, 2009
    Posts:
    3,246
  14. patricklorio

    patricklorio

    Joined:
    Feb 26, 2010
    Posts:
    6
    You can have as many players as you want to, just have to set it up in the code, which can be limited or unlimited