Opened 4 years ago

Closed 3 years ago

Last modified 3 years ago

#3254 closed enhancement (fixed)

[PATCH] Increase maximum client limit while keeping 8 player limit

Reported by: elexis Owned by: elexis
Priority: Nice to Have Milestone: Alpha 20
Component: Network Keywords: patch
Cc: Patch:

Description

You can't play 4v4s with spectators, since the game limits you to 8 clients.

The c++ code is optimized for 8 players (for example the chosen variable types). However since all observers count as player -1, the client limit could be increased to more than 8 (for example 16) without affecting the code that deals with players.

Attachments (2)

t3254_increase_max_clients_v1.patch (501 bytes) - added by elexis 4 years ago.
t3254_arbitrary_observer_limit_v1.patch (6.1 KB) - added by elexis 3 years ago.

Download all attachments as: .zip

Change History (14)

comment:1 Changed 4 years ago by elexis

It is sufficient to change the constant in NetServer.cpp

#define MAX_CLIENTS					8

which is used when initializing the server:

m_Host = enet_host_create(&addr, MAX_CLIENTS, CHANNEL_COUNT, 0, 0);

We could make it 10 until the performance is significantly better.

With unix systems you can start a server with 9 clients and test it. The gamesetup works fine, the additional players are just not assigned.

Another idea might be to make it a setting, so that the host can chose the maximum number of clients. However I don't think it is necessary and we shouldn't give the players too many options, as long as we don't have an "advanced options" tab.

Changed 4 years ago by elexis

comment:2 Changed 4 years ago by elexis

Keywords: patch review added
Milestone: BacklogAlpha 19
Summary: Increase maximum client limit while keeping 8 player limit[PATCH] Increase maximum client limit while keeping 8 player limit

Notice now we have

  • A way to ban unwanted clients (#3241)
  • Joining games as observer after the game started (#3242)
  • New pathfinder which has significantly better performance (never caused lag of death in the last 20-30 testgames with double the population that a18 supported)

I'm not fond of a new gamesetup setting as that menu is crowded already and we don't want to spam users with many small options (option creep).

comment:3 Changed 4 years ago by elexis

Milestone: Alpha 19Alpha 20

comment:4 Changed 4 years ago by elexis

Playing with 12 clients has been tested extensively by maxticatrix, fatherbushido, ffm and me and it's quite awesome.

Would anyone mind increasing the limit?

comment:5 Changed 4 years ago by elexis

How I come up with 10 or 12:

8 is too few as noone can spectate a 4v4.

10 or 12 means allowing 2 or 4 spectators on a 4v4.

More than that would be nice too, but it's probably too much for the current peformance of the game. The lag primarily becomes problematic when disconnects and rejoins occur (#3264 #3700).

Furthermore it would be nice to have some tools to address some observer-related and lag-related issues:

  • disable late-observer-joins after the game started
  • show the ping of clients
  • show the "simulation-ping" of clients
  • turn chat off selectively (#3380)
  • select the number of observer slots in the gamesetup
  • allow only a list of selected friends to late-join
Last edited 3 years ago by elexis (previous) (diff)

comment:6 Changed 3 years ago by elexis

In 17620:

Allow 10 clients to conncet to the server by default (allows 8 players and 2 observers). Refs #3254.

comment:7 Changed 3 years ago by elexis

Keywords: review removed

Leaving this ticket open since it would be ideal to be able to change the value using a chat command like "/max_clients 12" (Thus not adding to option creep and not adding a gameattribute)

Changed 3 years ago by elexis

comment:8 Changed 3 years ago by elexis

Keywords: review added
  • Allows to change the arbitrary limit in the options (changable ingame)
  • Using a reasonable limit (24 clients) since memory is allocated in advance
  • Also fixes #3671 by considering disconnected players
  • Also sends the user a correct disconnect reason instead of letting the attempting rejoining client timeout if the server is full

comment:9 Changed 3 years ago by Itms

Milestone: Alpha 20Alpha 21

comment:10 Changed 3 years ago by elexis

Owner: set to elexis
Resolution: fixed
Status: newclosed

In 17881:

Allow hosting matches with 8 players and up to 16 observers, fixes #3254.
The host can change the number of allowed observers in running games.

Make sure that joining observers won't take the "slot" of disconnected players, fixes #3671.

Send clients a new disconnect reason "Server full" instead of letting them timeout.

comment:11 Changed 3 years ago by elexis

Keywords: review removed
Milestone: Alpha 21Alpha 20

comment:12 Changed 3 years ago by elexis

Component: Core engineNetwork

(set component to network)

Note: See TracTickets for help on using tickets.