## 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 ## The match ends when one team is left standing. The tutorial (A12) turns this off, ## so a player alone on the island plays on until the tide ends it. var last_team_wins: bool = true ## Every player starts with Tuning.TUTORIAL_KIT in hand (A12). var starting_kit: bool = false ## 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 ## Rules for the tutorial (A12): one player alone, straight onto the barge, with a ## weapon to learn on, and no ending until the tide's own. static func tutorial() -> MatchRules: var rules: MatchRules = MatchRules.immediate() rules.max_players = 1 rules.min_players = 1 rules.fill_with_bots = false rules.last_team_wins = false rules.starting_kit = true return rules