Skip to content

Automatic per-map min & max player limits, many warmup and player count and Welcome message things

bones_was_here requested to merge bones_was_here/playernums into master

Misc cleanups for warmup and welcome message

Separate and improve MapReadSizes()

Ensure maps with small minimum player count can be selected for voting when player count is low or zero, even if their minimum would otherwise be too high, to prevent maplist fallback (which ignores sizes). Setting (for example) every CTF map to min 4 and every DM map to min 3 is a viable config with this code.

Add g_maplist_sizes_specparty, reduces player count used when selecting maps to allow for a consistent spectator population.

Better debugging messages.

Fix inconsistent ReadyCount() calling logic

timeout_status was checked at only 1 call site, and readiness changes during a timeout were sometimes ignored.

ReadyCount() was sometimes called when not in warmup.

Remove AvailableTeams(), instead store team number in existing teamplay global

Implement automatic per-map min & max player limits

This was the main goal of this branch, but it grew to include many related improvements, fixes and refactors.

Enabled by g_warmup -1 and g_maxplayers -1 respectively.

Map settings are loaded from .sizes files and are rounded to a multiple of the number of teams. At the midpoint, min players is rounded down and max players is rounded up. Neither can exceed engine maxplayers which is also rounded down if necessary.

g_warmup -1 means stay in warmup until enough players have joined, then switch to g_warmup_limit and wait for ready players. "Enough" has a lower limit of 2 or 2 * number of teams, so this can be useful on maps with no set minimum.

Display minplayers and maxplayers in welcome message

Display map shortname and longname in welcome message

Display Unlimited Warmup or Waiting for %d players (g_warmup -1) in hud timer subtext

Remove unnecessary client global shortmapname

Display current and maximum player numbers on scoreboard

Prevent "Begin!" announcement & centreprint when returning to warmup

Applicable to ReadyRestart() / qc_cmd_sv resetmatch, switching from unlimited to timed warmup (g_warmup -1), and countdown abort (g_warmup -1).

Improve centreprint shown when max player limit blocks joining

Fix unnecessary inflation of g_warmup_majority_factor in some cases

For example with 10 players joined and g_warmup_majority_factor 0.8 the old code required 9 players to be ready, new code requires 8. Behaviour is unchanged when joined players * factor is not an integer.

Also improve cvar description.

g_warmup -1: abort countdown if player count falls too low

Includes translatable chatcon + centreprint notification for this case.

Use a translatable chatcon notification for "Match is restarting..."

Make MOTD header fancier in welcome message

This is intended to be visually nicer with a typical multi-line MOTD.

Clean up welcome message newlines


vcall allready still overrides all g_warmup conditions and starts the match immediately (it doesn't change ready status).

Edited by bones_was_here

Merge request reports