LoadBalancingClient

is there any way to make it so the user doesn't disconnect when max ccu is reached, im not trying to find a way out of having to pay for more users but when theres 20 player, one always gets kicked and its getting really annoying

Best Answers

  • Kaiserludi
    Kaiserludi admin
    Answer ✓

    This only happens when you reach the plans CCU limit with the 20 or 100 CCU plan. From the 500 CCU plan onward surplus users beyond the limits of the plan won' t be automatically disconnected, but you can temporarily go beyond the plan's limits to give you time to upgrade your plan without rejecting any users.

  • Kaiserludi
    Kaiserludi admin
    Answer ✓

    Hi @JokerJosh.


    That sounds like an issue that is entirely unrelated to the plan's CCU limit.

    When the CCU limit is reached and the plan does not include a burst option to temporarily surpass the limit, then what happens, is that the surplus players will receive an error when they try to connect. Before the limit is actually reached, the CCU limit won't affect anything at all.

    So your issue of already connected players getting disconnected must be caused by something else.

    Are those 16 players all inside the same room? In that case the most likely reason is that you just generate too much traffic for the clients to keep up with and they get disconnected because they fail to respond to the server in a timely manner due to all the incoming data from other clients that they need to handle.

    Keep in mind that when every clients sends a certain type of message to every other client in the same room, then the amount of received messages of that type don't just increase linear to the amount of clients, but squared.

    So when you have 4 players and each of them sends 10 messages per second to everyone else, then that results in 4*4*10==160 messages (40 sent + 120 received ones), but for 16 players the same rate of 10 messages per second results in 16*16*10==2560 messages (160 sent + 2400 received ones). With increasing player numbers sooner or later the amount of messages will reach a point at which it is just to much for the receiving clients to handle and they will get disconnected. Depending on how many and how big messages every client sends on the clients hardware (mobile clients will run into problems much sooner than desktop clients) this point is usually reached at some point between 8 and 16 players.


    So if you want to put that many players into a single room, you need to implement some kind of interest management that makes sure that messages don't get sent to everyone, but only to clients for which they are relevant (i.e. if client A can't see client B, because it is too far away or hidden behind an obstacle, then it is pointless to let client B sent updates about it's current position to client A multiple times per second).


    For games with that many players per room you might also want to look into using Photon Fusion over PUN, as Fusion already implements some measures for you that allow you to have up to 64 players per room without issues.

Answers

  • Kaiserludi
    Kaiserludi admin
    Answer ✓

    This only happens when you reach the plans CCU limit with the 20 or 100 CCU plan. From the 500 CCU plan onward surplus users beyond the limits of the plan won' t be automatically disconnected, but you can temporarily go beyond the plan's limits to give you time to upgrade your plan without rejecting any users.

  • im aware it happens with those plans but is there any way i could make it so it just doesnt allow to player to join a room once theres max ccu because when theres 16 players, sometimes they get kicked from the game entirely

  • Kaiserludi
    Kaiserludi admin
    Answer ✓

    Hi @JokerJosh.


    That sounds like an issue that is entirely unrelated to the plan's CCU limit.

    When the CCU limit is reached and the plan does not include a burst option to temporarily surpass the limit, then what happens, is that the surplus players will receive an error when they try to connect. Before the limit is actually reached, the CCU limit won't affect anything at all.

    So your issue of already connected players getting disconnected must be caused by something else.

    Are those 16 players all inside the same room? In that case the most likely reason is that you just generate too much traffic for the clients to keep up with and they get disconnected because they fail to respond to the server in a timely manner due to all the incoming data from other clients that they need to handle.

    Keep in mind that when every clients sends a certain type of message to every other client in the same room, then the amount of received messages of that type don't just increase linear to the amount of clients, but squared.

    So when you have 4 players and each of them sends 10 messages per second to everyone else, then that results in 4*4*10==160 messages (40 sent + 120 received ones), but for 16 players the same rate of 10 messages per second results in 16*16*10==2560 messages (160 sent + 2400 received ones). With increasing player numbers sooner or later the amount of messages will reach a point at which it is just to much for the receiving clients to handle and they will get disconnected. Depending on how many and how big messages every client sends on the clients hardware (mobile clients will run into problems much sooner than desktop clients) this point is usually reached at some point between 8 and 16 players.


    So if you want to put that many players into a single room, you need to implement some kind of interest management that makes sure that messages don't get sent to everyone, but only to clients for which they are relevant (i.e. if client A can't see client B, because it is too far away or hidden behind an obstacle, then it is pointless to let client B sent updates about it's current position to client A multiple times per second).


    For games with that many players per room you might also want to look into using Photon Fusion over PUN, as Fusion already implements some measures for you that allow you to have up to 64 players per room without issues.

  • JokerJosh
    JokerJosh
    edited August 2022

    Hello again, at first that was the issue but I’m at 7% traffic but players are still getting disconnected, I went into a server that had 3 people and still got disconnected