feat: let a custom game mode define its own team size - #574
Open
LCrew wants to merge 1 commit into
Open
Conversation
Follows the api change that lets game_modes carry players_per_team and allow_short_handed_start. The size lives on the mode rather than on each lobby: a mode is a set of plugins and cvars built for a particular shape of match, and a host picking "Retakes" should not also have to know it is a 3v3. So the two fields are edited in Application Settings -> Game Modes, and the draft wizard's mode step only reports them, as a badge on each mode card. In the room, a mode that allows it unlocks a Start Short-Handed button once both sides hold at least one player, with a confirm step -- starting short cannot be walked back, as everyone still on their way in loses the seat. The confirm disarms itself if someone joins and the lobby fills. start() now goes through the startDraftGame action instead of setting the status directly, because narrowing the lobby has to happen server-side before the trigger and the draft pick pattern read its capacity. With no custom mode selected none of this engages: perTeam falls back to the match type's count and the start gate keeps its original equality. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G8LmkD3i1HyGjbcxAZ5Crz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
A custom game mode can already change the plugins and cvars a match runs under, but not its shape. The api PR lets a mode declare its own team size; this is the UI for setting it and using it.
Where the setting lives
On the mode, not on each lobby — a mode is a set of plugins and cvars built for a particular shape of match, and a host picking "Retakes" shouldn't also have to know it's a 3v3.
So the two fields are edited in Settings → Application → Game Modes, and the draft wizard's mode step only reports them, as a badge on each mode card (
3v3,Can start short). That also avoids an ordering problem: the mode is chosen on step 2, so a control on step 1 would be dead until then.In the room
A mode that allows it unlocks Start Short-Handed once both sides hold at least one player, with a confirm step — starting short can't be walked back, as everyone still on their way in loses the seat. The confirm disarms itself if someone joins and the lobby fills.
start()now goes through thestartDraftGameaction instead of setting the status directly, because narrowing the lobby has to happen server-side before the trigger and the draft pick pattern read its capacity. Authorization is unchanged: the action'sisOrganizerOrHostmatchesis_draft_game_organizerexactly (host, ormatch_organizerand above).Zero change by default
With no custom mode selected,
perTeamfalls back to the match type's count and the start gate keeps its original equality.forceReadyisfalseunless the mode opts in, socanStart === startReady— the button behaves exactly as before.Tested
Deployed to a live install alongside the api change: a mode with
players_per_team = 1produces a 1v1 draft lobby and sends 2 players, which the game server then honours. Existing Competitive lobbies still require 10.Notes for review
generated/zeusis untouched — worth ayarn codegenonce the api migrations are applied.