From 2419f77f1741890ac40344ffd2cb23976aec5b42 Mon Sep 17 00:00:00 2001 From: FloPinguin <25036848+FloPinguin@users.noreply.github.com> Date: Fri, 13 Mar 2026 19:54:39 +0100 Subject: [PATCH] =?UTF-8?q?Rearrange=20homepage=20game=20boxes=20&=20tune?= =?UTF-8?q?=20special=20modifier=20probabilities=20=F0=9F=8E=B2=20(#3420)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description: **Homepage layout:** Reorder the game mode cards so FFA is the left (large) box, Teams is the upper-right box, and Special Games is the lower-right box. Mobile order updated to match (FFA → Teams → Special). **Special game modifiers:** - Adjusted modifier count roll to 40%/40%/15%/5% for 1/2/3/4 modifiers (was 30%/40%/20%/10%) because having so many special games with 3/4 modifiers while we only have 8 modifiers in the pool is a bit dumb (from the 8 modifiers two are mutually exclusive and 4 should be quite rare). - Changed ticket counts in `SPECIAL_MODIFIER_POOL` so isAlliancesDisabled and isHardNations are more rare. ## 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/client/GameModeSelector.ts | 48 ++++++++++++++++------------------ src/server/MapPlaylist.ts | 26 +++++++++--------- 2 files changed, 36 insertions(+), 38 deletions(-) diff --git a/src/client/GameModeSelector.ts b/src/client/GameModeSelector.ts index 20319614b..088498226 100644 --- a/src/client/GameModeSelector.ts +++ b/src/client/GameModeSelector.ts @@ -150,35 +150,30 @@ export class GameModeSelector extends LitElement {
- - ${special + + ${ffa ? html`` - : ffa - ? html`` - : nothing} + : nothing} - - + + ${teams || special + ? html`` + : nothing} - -
- ${special ? this.renderSpecialLobbyCard(special) : nothing} -
+
${ffa ? this.renderLobbyCard(ffa, this.getLobbyTitle(ffa)) @@ -189,6 +184,9 @@ export class GameModeSelector extends LitElement { ? this.renderLobbyCard(teams, this.getLobbyTitle(teams)) : nothing}
+
+ ${special ? this.renderSpecialLobbyCard(special) : nothing} +
diff --git a/src/server/MapPlaylist.ts b/src/server/MapPlaylist.ts index bb37e0d3c..2cd9e0280 100644 --- a/src/server/MapPlaylist.ts +++ b/src/server/MapPlaylist.ts @@ -109,14 +109,14 @@ 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(8).fill("isCompact"), - ...Array(1).fill("isCrowded"), - ...Array(1).fill("isHardNations"), - ...Array(8).fill("startingGold"), - ...Array(1).fill("startingGoldHigh"), - ...Array(1).fill("goldMultiplier"), - ...Array(1).fill("isAlliancesDisabled"), + ...Array(8).fill("isRandomSpawn"), + ...Array(16).fill("isCompact"), + ...Array(3).fill("isCrowded"), // should be quite rare as it causes max-size lobbies + ...Array(1).fill("isHardNations"), // should be quite rare because it's just for the PvPvE enjoyers + ...Array(16).fill("startingGold"), + ...Array(4).fill("startingGoldHigh"), // should be quite rare because it's very crazy + ...Array(6).fill("goldMultiplier"), + ...Array(1).fill("isAlliancesDisabled"), // should be quite rare because it removes a key element of OpenFront ]; // Modifiers that cannot be active at the same time. @@ -515,16 +515,16 @@ export class MapPlaylist { count?: number, countReduction: number = 0, ): PublicGameModifiers { - // Roll how many modifiers to pick: 30% → 1, 40% → 2, 20% → 3, 10% → 4 - const modifierCountRoll = Math.floor(Math.random() * 10) + 1; + // Roll how many modifiers to pick: 40% → 1, 40% → 2, 15% → 3, 5% → 4 + const modifierCountRoll = Math.floor(Math.random() * 100) + 1; const k = Math.max( 0, (count ?? - (modifierCountRoll <= 3 + (modifierCountRoll <= 40 ? 1 - : modifierCountRoll <= 7 + : modifierCountRoll <= 80 ? 2 - : modifierCountRoll <= 9 + : modifierCountRoll <= 95 ? 3 : 4)) - countReduction, );