From 1220a331ba4fac4c3b4e8eae70decea542c947e2 Mon Sep 17 00:00:00 2001 From: FloPinguin <25036848+FloPinguin@users.noreply.github.com> Date: Thu, 19 Mar 2026 22:48:17 +0100 Subject: [PATCH] =?UTF-8?q?Remove=20modifiers=20from=20normal=20FFA/Team?= =?UTF-8?q?=20games=20(And=20increase=20chance=20of=20gold=20multiplier=20?= =?UTF-8?q?for=20special=20games,=20decrease=20random=20spawn)=20?= =?UTF-8?q?=F0=9F=8E=B2=20(#3471)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description: Normal (FFA and Team) public games no longer roll random modifiers. Special games remain fully unaffected and continue to use random modifiers as before. I also increased the gold multiplier ticket count in the special modifier pool from 1 to 4 because of player feedback. Edit: And because I saw complaints of too much random spawn I decreased the chance of it. ## Please complete the following: - [X] I have added screenshots for all UI updates - [X] I process any text displayed to the user through translateText() and I've added it to the en.json file - [X] I have added relevant tests to the test directory - [X] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: FloPinguin --- src/server/MapPlaylist.ts | 90 +++++++-------------------------------- 1 file changed, 16 insertions(+), 74 deletions(-) diff --git a/src/server/MapPlaylist.ts b/src/server/MapPlaylist.ts index 5dd7dbaa7..23d01f219 100644 --- a/src/server/MapPlaylist.ts +++ b/src/server/MapPlaylist.ts @@ -110,13 +110,13 @@ type ModifierKey = // Each entry represents one "ticket" in the pool. More tickets = higher chance of selection. const SPECIAL_MODIFIER_POOL: ModifierKey[] = [ - ...Array(4).fill("isRandomSpawn"), + ...Array(2).fill("isRandomSpawn"), ...Array(8).fill("isCompact"), ...Array(1).fill("isCrowded"), ...Array(1).fill("isHardNations"), ...Array(8).fill("startingGold"), ...Array(1).fill("startingGoldHigh"), - ...Array(1).fill("goldMultiplier"), + ...Array(4).fill("goldMultiplier"), ...Array(1).fill("isAlliancesDisabled"), ]; @@ -144,84 +144,35 @@ export class MapPlaylist { const playerTeams = mode === GameMode.Team ? this.getTeamCount(map) : undefined; - const modifiers = this.getRandomPublicGameModifiers(playerTeams); - const { startingGold } = modifiers; - let { isCompact, isRandomSpawn, isCrowded, isHardNations } = modifiers; - - // Duos, Trios, and Quads should not get random spawn (as it defeats the purpose) - if ( - playerTeams === Duos || - playerTeams === Trios || - playerTeams === Quads - ) { - isRandomSpawn = false; - } - - // Hard nations modifier only applies when nations are present (not HvN, which is always hard) - if (mode === GameMode.Team) { - isHardNations = false; - } - - // Check if compact map would leave every team with at least 2 players - if ( - isCompact && - mode === GameMode.Team && - !(await this.supportsCompactMapForTeams(map, playerTeams!)) - ) { - isCompact = false; - } - - // Crowded modifier: if the map's biggest player count (first number of calculateMapPlayerCounts) is 60 or lower (small maps), - // set player count to MAX_PLAYER_COUNT (or 60 if compact map is also enabled) - let crowdedMaxPlayers: number | undefined; - if (isCrowded) { - crowdedMaxPlayers = await this.getCrowdedMaxPlayers(map, isCompact); - if (crowdedMaxPlayers === undefined) { - isCrowded = false; - } else { - crowdedMaxPlayers = this.adjustForTeams(crowdedMaxPlayers, playerTeams); - } - } - - // Create the default public game config (from your GameManager) return { donateGold: mode === GameMode.Team, donateTroops: mode === GameMode.Team, gameMap: map, - maxPlayers: - crowdedMaxPlayers ?? - (await this.lobbyMaxPlayers(map, mode, playerTeams, isCompact)), + maxPlayers: await this.lobbyMaxPlayers(map, mode, playerTeams, false), gameType: GameType.Public, - gameMapSize: isCompact ? GameMapSize.Compact : GameMapSize.Normal, + gameMapSize: GameMapSize.Normal, publicGameModifiers: { - isCompact, - isRandomSpawn, - isCrowded, - isHardNations, - startingGold, + isCompact: false, + isRandomSpawn: false, + isCrowded: false, + isHardNations: false, isAlliancesDisabled: false, }, - startingGold, difficulty: - isHardNations || playerTeams === HumansVsNations - ? Difficulty.Hard - : Difficulty.Medium, + playerTeams === HumansVsNations ? Difficulty.Hard : Difficulty.Medium, infiniteGold: false, infiniteTroops: false, maxTimerValue: undefined, instantBuild: false, - randomSpawn: isRandomSpawn, + randomSpawn: false, nations: mode === GameMode.Team && playerTeams !== HumansVsNations ? "disabled" : "default", gameMode: mode, playerTeams, - bots: isCompact ? 100 : 400, - spawnImmunityDuration: this.getSpawnImmunityDuration( - playerTeams, - startingGold, - ), + bots: 400, + spawnImmunityDuration: this.getSpawnImmunityDuration(playerTeams), disabledUnits: [], } satisfies GameConfig; } @@ -234,6 +185,7 @@ export class MapPlaylist { const excludedModifiers: ModifierKey[] = []; + // Check if compact map would leave every team with at least 2 players const supportsCompact = mode !== GameMode.Team || (await this.supportsCompactMapForTeams(map, playerTeams!)); @@ -241,6 +193,7 @@ export class MapPlaylist { excludedModifiers.push("isCompact"); } + // Duos, Trios, and Quads should not get random spawn (as it defeats the purpose) if ( playerTeams === Duos || playerTeams === Trios || @@ -268,6 +221,8 @@ export class MapPlaylist { isHardNations, } = poolResult; + // Crowded modifier: if the map's biggest player count (first number of calculateMapPlayerCounts) is 60 or lower (small maps), + // set player count to MAX_PLAYER_COUNT (or 60 if compact map is also enabled) let crowdedMaxPlayers: number | undefined; if (isCrowded) { crowdedMaxPlayers = await this.getCrowdedMaxPlayers(map, isCompact); @@ -484,19 +439,6 @@ export class MapPlaylist { return TEAM_WEIGHTS[0].config; } - private getRandomPublicGameModifiers( - playerTeams?: TeamCountConfig, - ): PublicGameModifiers { - return { - isRandomSpawn: Math.random() < 0.05, // 5% chance - isCompact: Math.random() < 0.05, // 5% chance - isCrowded: Math.random() < 0.05, // 5% chance - startingGold: Math.random() < 0.05 ? 5_000_000 : undefined, // 5% chance - isHardNations: Math.random() < 0.025, // 2.5% chance - isAlliancesDisabled: false, - }; - } - private getRandomSpecialGameModifiers( excludedModifiers: ModifierKey[] = [], count?: number,