## How a server runs its matches: lobby size, timers and team size. Defaults come from ## Tuning; a server or test changes them per instance. class_name MatchRules extends RefCounted ## The most participants in one match, bots included. var max_players: int = Tuning.SOLO_PLAYERS ## The lobby counts down once this many participants have joined. var min_players: int = Tuning.MATCH_MIN_PLAYERS ## Players on a team. 1 is solo. var team_size: int = 1 ## With enough players, the lobby waits this long for more before counting down. A ## full lobby counts down at once. var lobby_ticks: int = roundi(Tuning.MATCH_LOBBY_SECONDS * Tuning.TICK_RATE_HZ) var countdown_ticks: int = roundi(Tuning.MATCH_COUNTDOWN_SECONDS * Tuning.TICK_RATE_HZ) var results_ticks: int = roundi(Tuning.MATCH_RESULTS_SECONDS * Tuning.TICK_RATE_HZ) ## Fill empty places with bots when the match starts. var fill_with_bots: bool = true ## Rules for a server that skips the lobby: the match starts on the first tick. static func immediate() -> MatchRules: var rules: MatchRules = MatchRules.new() rules.lobby_ticks = 0 rules.countdown_ticks = 0 return rules