Search Unity

Resolved Maximum players/connections in multiplayer game built on Netcode?

Discussion in 'Netcode for GameObjects' started by PurplePineapples, Feb 23, 2022.

  1. PurplePineapples

    PurplePineapples

    Joined:
    Sep 21, 2017
    Posts:
    3
    Hi all. I was curious what the maximum number of players or connections is that a game built on netcode for gameobjects can handle.
    In the unity blog post 'choosing the right netcode for your game' there is a flow diagram with use-cases for the different networking solutions, with netcode recommended for games with 64 or fewer players in a match. Apart from this I cannot find an answer to this question in official documentation. Is 64 a hard limit that can't be overridden or is it a soft limit beyond which the framework will not scale well/perform poorly? Does UNET vs UTP transport layer influence this at all?
     
  2. luke-unity

    luke-unity

    Joined:
    Sep 30, 2020
    Posts:
    306
    There is no hard limit. Right now we are focusing on smaller scale games with small numbers of players. The exact amount your game is able to support will depend on your game genre and the complexity of your gameplay code.

    Building a game with 64+ players in the same session is a huge task. Often existing solutions don't provide everything needed to build a game like that so it's quite common for large scale games like that to build their own networking stack and optimize it for their specific use case.
     
    CodeSmile and AlexCine like this.
  3. PurplePineapples

    PurplePineapples

    Joined:
    Sep 21, 2017
    Posts:
    3
    I see, thank you for answering :)
     
  4. Tech_Bud

    Tech_Bud

    Joined:
    Jun 24, 2020
    Posts:
    18
    Would NGO be good for a game with 20 players? I want to make a game show/trivia game with about 20 players, whose positions don't need to be sent over the network as they will be in fixed positions. But I would like their rotations to be tracked.
     
  5. CosmoM

    CosmoM

    Joined:
    Oct 31, 2015
    Posts:
    204
    That would be very doable, especially since it’s not a fast-paced game with, say, hundreds of networked bullets flying about. ;)
     
    Tech_Bud likes this.
  6. Tech_Bud

    Tech_Bud

    Joined:
    Jun 24, 2020
    Posts:
    18
    Thanks, I saw one of your posts mentioning that you use Unity transport. I'm not too sure on the difference between NGO and unity transport. Would I be correct to assume that Unity transport should be used for games with more demanding network requirements, as opposed to NGO which should be used for smaller scaled multiplayer games?
     
  7. CosmoM

    CosmoM

    Joined:
    Oct 31, 2015
    Posts:
    204
    NGO always needs a transport layer for network communication. Unity Transport is included with current versions of NGO for that reason, although you can replace it by another transport package (e.g. Photon) if you like — and likewise, Unity Transport can be used in other multiplayer solutions. So no, it’s not really an alternative to NGO but more a part of it.
     
    Mauschelbaer and Tech_Bud like this.
  8. Gray_FoxWare

    Gray_FoxWare

    Joined:
    Jan 31, 2019
    Posts:
    16
    the new Photon fusion can have up 200 players.
     
  9. itisMarcii_

    itisMarcii_

    Joined:
    Apr 5, 2022
    Posts:
    111
    Currently the only treshhold is due a bug with the MaxPacketQueueSize. Since there is for some reasons a hard limit on that value, which will be changed/fixed in the future.
    The reason is that, on connection, all the world state information will be loaded at once, filling the MaxPacketQueueSize to its treshhold.

    Besideds that, i had 200+ Clients running. I expect that there can run a lot more if that issue is fixed.
     
    Topthink likes this.
  10. simon-lemay-unity

    simon-lemay-unity

    Unity Technologies

    Joined:
    Jul 19, 2021
    Posts:
    441
    Is this issue the stack overflow for large values of
    MaxPaquetQueueSize
    ? If so, it should now be fixed in version 1.2.0 of the Unity Transport Package (which version 1.0.1 of Netcode for GameObjects depends on).
     
    Topthink likes this.
  11. itisMarcii_

    itisMarcii_

    Joined:
    Apr 5, 2022
    Posts:
    111

    Its the same issue I already mentioned back then and you already replied towards :)

    So yes :D
     
    Topthink likes this.
  12. Topthink

    Topthink

    Joined:
    Sep 18, 2016
    Posts:
    12
    Okay, I want to put my RPG online (my RPG is substantially developed). I'm pretty sure I won't need a fast tick rate and it seems like Netcode for GameObjects (NGO) may suit my needs. But lets say there is a CCU limit of some sort. Is it possible to get around that by having 50 or 100 users in one instance/zone and then having a similar number of users in another instance/zone and another and another and so forth with perhaps thousands of players total. YET, they all exist in the same "game" and can move from instance to instance etc? Of course, they would maintain their stats and equipment and so forth. I have substantial C# and Unity experience although I have little network/multiplayer experience.
     
  13. Sensistaar

    Sensistaar

    Joined:
    Nov 12, 2021
    Posts:
    3

    What you mean can be done by what is called a "Realm". For example Diablo by Blizzard uses realms. You could have your character saved to the realm and then 10 servers that are hosting a specific zone and players can join one of the servers. The downside is that they need to disconnect and connect to another zone with the realm methode.
     
    Topthink likes this.
  14. Topthink

    Topthink

    Joined:
    Sep 18, 2016
    Posts:
    12
    Thanks for your input. I'm going to look into that to see if that is a potential solution.
     
  15. Topthink

    Topthink

    Joined:
    Sep 18, 2016
    Posts:
    12
    I'll likely look at that game by Blizzard. I've never played it but I'd like to see how it's done now that you mention it.

    I'm working on a side issue now. My favorite game company is Paradox. Last I saw they had 662 employees. My company has just one employee. LoL. Me. (Although I'm retired so I spend mostly full time on my games.) But, because I'm all alone here, when I get on these side issues everything else comes to a halt. I really appreciate that you took the time to help me though.
     
  16. JamesW940516

    JamesW940516

    Joined:
    May 19, 2023
    Posts:
    31
    Hi
    Is there any update with CCU of NGO?
    Why don't we talk more about this.
    This is a kind of core performance of Netcode isn't it?
    Thank you.
     
    Topthink likes this.
  17. games9333847

    games9333847

    Joined:
    Oct 22, 2023
    Posts:
    1
    yeah
     
    Topthink likes this.
  18. Topthink

    Topthink

    Joined:
    Sep 18, 2016
    Posts:
    12

    Not sure what you're referring to here. I know they recently increased the number of "free" players you can have over at Unity Gaming Services. The new number of free CCU players is now 50. I think it used to be 20.

    If you're referring to how many users can simultaneously play NGO, well, I'm not sure. I'm certain there would be factors to consider other than CCU. My impression is that the size of the terrain, the number of Mobs/NPCs, and even the number of things like structures and trees, etc. would play a factor although I'm not sure how much each of those would impact the CCU, perhaps a tiny amount, perhaps a large amount.

    The reason I'm even on this thread today is because I'm planning on starting this week to test CCU limits on NGO.

    The game I'm designing is an MMO with most zones being around 1,000 meters square and built by Unity's Terrain Tool. I'd like to have one game, with one player base, but many of these one KM square zones. Ideally, if the number of players exceeds NGO's ability to handle the CCUs, then the server would open another instance. Players would retain any loot, gold, etc that they recovered during their exploits.

    Well, that's my plan for today that I'll begin testing this week. I don't know if I can do this on NGO or if I would need to use something like Netcode for Entities or Fish-Net, etc.
     
  19. DaddyJr

    DaddyJr

    Joined:
    Sep 29, 2018
    Posts:
    4
    so how was it? im planning an mmo too for my learning, im thinking of mirror, fish-net or photon if NGO performance doesnt scale well.
     
  20. joeyiglesias83

    joeyiglesias83

    Joined:
    Nov 25, 2023
    Posts:
    7
    Subscribing bump, as I too am looking to build a game with a bit larger scope of player base and world size.
     
  21. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,847
    How many players does NGO support?

    I can provide the DEFINITE answer, it‘s really not rocket science:

    It depends! :cool:

    Please consider that this question is as relevant and informative as the answer to this question:
    „How many frames per second does Unity support?“

    I’m afraid both are stupid, unanswerable questions without context. :p

    Some clever marketing has fooled us into believing that there are major limiting differences between realtime networking frameworks. There are very little, provided their implementation is technically sound.

    You could easily have several hundreds of players on a single server, no issues at all, if all they do is spawn and sit still and not interact with anyone or anything. That means the overall network bandwidth would be close to zero KB/s. The limiting factor would be the initial synch of a new player who needs to get all other client‘s current position (but even that could be optimized away if they spawn at deterministic predetermined locations).

    On the other hand, if you have the players move, rotate and scale continuously every frame with hundreds of enemy AI agents roaming around this generates a steady stream of traffic per player - a bandwidth you can measure and visualize ingame with NGOs multiplayer tools. It is absolutely VITAL to monitor these stats from the start, since the traffic generated by the game code is what limits the number of concurrent players above all else!

    The server also has to run the simulation at the given network tickrate without choking, and while you can rent very high end systems the rental cost increases with the specs - thus you are well advised to optimize for CPU and bandwidth!

    Most important is how much traffic each client sends and receives and how that relates to a typical user‘s respective upload and download speeds. These depend on whether the user is on a home broadband network, or on the road with a spotty 3G connection. That means a desktop game is able to support far more concurrent players than a mobile game.

    Lastly, your game architecture and design of what needs network synchronization is ultimately the most limiting factor in terms of number of supported players. There are often tremendous inefficiencies programmed into the game that significantly increase bandwidth consumption such as synchronizing every predictably / deterministically moving projectile over the network every frame.

    Or setting an inapproriate network tick rate - 128 ticks per second is what the most competitive games are using at most, yet a few forum posters had revealed tick rates to be set at 200 or more, with one even using 500 Hz!

    Generally speaking, if you ask „how many players does Netcode support?“ you are also communicating that you don‘t (yet) know enough about how networked games work and are likely going to design and architect your first game(s) in a suboptimal way so that any such number given to you is rendered moot until you spend the effort to learn and redesign, refactor the game. Not once, not several times, but continuously.

    Which is to say: stop number-hunting and start implementing a couple simple online games or prototypes before you delve into creating your grand online project. :)

    In summary:
    Your level of networking and multiplayer game expertise needs to scale with the number of players you want to support. Everyone can do a four player game as their first title. A sixteen player game will seriously challenge a first-time online multiplayer developer, if only to keep the rental costs down. A 64+ player game is simply out of the question for your first online multiplayer titles, and yet that’s still far away from entering the elusive realms of „massive“ multiplayer titles (typically ranging between 250 to 2,500 CCUs per server).

    That is what‘s mostly going to limit your game‘s CCU: you! Your own skill level in designing, architecting and implementing networking and multiplayer game mechanics. Not even Photon with their advertised „200 players“ or any other such claims from any network framework will help you out of this conundrum.

    Btw, I read recently (can’t find the source right now) that NGO is advertised as designed for casual cooperative games with up to 16 players. A number and statement that are likely temporary and going to change once NGO has been unified with Netcode for Entities (see the Netcode Unification card), the latter supports all necessary features for competitive action games and higher player counts.

    Also, Relay service currently allows a maximum number of 100 connections.
     
    Last edited: Feb 13, 2024