Opened 8 years ago

Last modified 3 years ago

#4210 new defect

Increase the observer limit to 4096

Reported by: elexis Owned by:
Priority: Should Have Milestone: Backlog
Component: Network Keywords:
Cc: Patch:

Description

Today two of the best lobby players had a match and the game actually ran into the 16 client observerlimit.

It should be possible to host games with a practically unlimited amount of clients / observers. enet supports 4096 clients at most. Instead of hardcoding the limit, it could just use max(32, settingsValue) when calling enet_host_create (thus not having to allocate for 4096 peers in advance).

The downside is that it means a running server won't support more than 32 observers if the game was started with a limit of at most 32.

Perhaps the memory allocated by enet is so few that 4096 can be allocated, but I doubt it.

There could also be a default.cfg boolean entry that will make the server allocate 4096 clients instead of max(32, limit).

Change History (2)

comment:1 by elexis, 8 years ago

In 18719:

Increase the maximum observer limit to 32 for the upcoming release, refs #4210.

comment:2 by wraitii, 3 years ago

In 25156:

Netcode: allow observers to lag behind the live game.

Observers no longer lag the game for players. There is still some time to serialise the game when sending it to a joining observer, and depending on the chosen 'max lag' the game may stop while observers sufficiently catch up, but this impact too is reduced.

  • Make the NetServerTurnManager ignore players marked as 'observers' for the purpose of ending a turn, effectively making it possible for observers to lag without it affecting the players in any way.
  • Add a config option (network.observermaxlag) that specifies how many turns behind the live game observers are allowed to be. Default to 10 turns, or 2 seconds, to keep them 'largely live'.
  • The controller is not treated as an observer.
  • Implement a simple UI to show this delay & allow the game to speed up automatically to try and catch up. This can be deactivated via network.autocatchup.
  • Move network options to the renamed 'Network / Lobby' options page.
  • Do not debug_warn/crash when receiving commands from the past - instead warn and carry on, to avoid DOS and "coop play" issues.

Refs #5903, Refs #4210

Differential Revision: https://code.wildfiregames.com/D3737

Note: See TracTickets for help on using tickets.