From 05a2338fead3174eaa120f6b7600c94727e389c7 Mon Sep 17 00:00:00 2001 From: 1brucben <1benjbruce@gmail.com> Date: Sun, 1 Jun 2025 03:06:27 +0200 Subject: [PATCH 1/3] Another Balance Change (#987) ## Description: Reduces attack speed for large attacks. A further 10% increase in attacker losses. minor 5% decrease in pop growth. Attacks against Terra Nullius fade away as in v22. This addresses the community poll finding that many players consider current troop movements to be too fast. The latter two changes help nerf attacking and slowdown snowballing. ## 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 - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: 1brucben --- src/core/configuration/DefaultConfig.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index 8c2cfd898..5e31ef4d6 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -66,8 +66,8 @@ const numPlayersConfig = { } as const satisfies Record; const TERRAIN_EFFECTS = { - [TerrainType.Plains]: { mag: 1, speed: 0.8 }, // higher speed, lower damage - [TerrainType.Highland]: { mag: 1.15, speed: 1 }, + [TerrainType.Plains]: { mag: 1.1, speed: 0.8 }, // higher speed, lower damage + [TerrainType.Highland]: { mag: 1.2, speed: 1 }, [TerrainType.Mountain]: { mag: 1.3, speed: 1.25 }, } as const; @@ -230,7 +230,7 @@ export class DefaultConfig implements Config { falloutDefenseModifier(falloutRatio: number): number { // falloutRatio is between 0 and 1 // So defense modifier is between [3, 1] - return 3 - falloutRatio * 2; + return 2 - falloutRatio; } SAMCooldown(): number { return 75; @@ -536,7 +536,7 @@ export class DefaultConfig implements Config { ? this.traitorDefenseDebuff() : 1; const baseTroopLoss = 16; - const baseTileCost = 23; + const baseTileCost = 30; const attackStandardSize = 10_000; return { attackerTroopLoss: @@ -545,15 +545,15 @@ export class DefaultConfig implements Config { tilesPerTickUsed: baseTileCost * within(defenderDensity, 3, 100) ** 0.2 * - (attackStandardSize / attackTroops) ** 0.075 * + (attackStandardSize / attackTroops) ** 0.1 * speed * - within(attackRatio, 0.1, 20) ** 0.4, + within(attackRatio, 0.1, 20) ** 0.35, }; } else { return { attackerTroopLoss: 16 * mag, defenderTroopLoss: 0, - tilesPerTickUsed: 31 * speed, + tilesPerTickUsed: 492 * speed * within(attackTroops, 1, 10000) ** -0.3, }; } } @@ -646,7 +646,7 @@ export class DefaultConfig implements Config { //population grows proportional to current population with growth decreasing as it approaches max // smaller countries recieve a boost to pop growth to speed up early game const baseAdditionRate = 10; - const basePopGrowthRate = 1200 / max + 1 / 150; + const basePopGrowthRate = 1100 / max + 1 / 160; const reproductionPop = 0.9 * player.troops() + 1.1 * player.workers(); let toAdd = baseAdditionRate + basePopGrowthRate * reproductionPop; const totalPop = player.totalPopulation(); From dfea816bff4b47a1f9283434bf5b0e1d2c69d3d8 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Sat, 31 May 2025 18:11:02 -0700 Subject: [PATCH 2/3] make bots weaker (#985) ## Description: I believe many of the complains of the game being too slow in the beginning is due to bots being stronger in v23 than v22. This PR weakens bots significants and it feels much closer to v22. ## 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 - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: --- src/core/configuration/DefaultConfig.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index 5e31ef4d6..9fb503cfe 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -512,16 +512,12 @@ export class DefaultConfig implements Config { if (attacker.isPlayer() && defenderIsPlayer) { if ( - attackerType === PlayerType.Human && + (attackerType === PlayerType.Human || + attackerType === PlayerType.FakeHuman) && defenderType === PlayerType.Bot ) { - mag *= 0.8; - } - if ( - attackerType === PlayerType.FakeHuman && - defenderType === PlayerType.Bot - ) { - mag *= 0.8; + mag *= 0.6; + speed *= 0.6; } } if (attackerType === PlayerType.Bot) { From 6ea430fc58de517a854fb339e40afa2212e9af10 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Sat, 31 May 2025 18:11:11 -0700 Subject: [PATCH 3/3] Remove shield icon from bots (#986) ## Description: Bots have much different meta than nations or humans, so their defense number is misleading. ## 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 - [x] I understand that submitting code with bugs that could have been caught through manual testing blocks releases and new features for all contributors ## Please put your Discord username so you can be contacted if a bug or regression is found: --- src/client/graphics/layers/NameLayer.ts | 57 ++++++++++++++----------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/src/client/graphics/layers/NameLayer.ts b/src/client/graphics/layers/NameLayer.ts index 0d56c76e4..c2a1fea45 100644 --- a/src/client/graphics/layers/NameLayer.ts +++ b/src/client/graphics/layers/NameLayer.ts @@ -9,7 +9,13 @@ import targetIcon from "../../../../resources/images/TargetIcon.svg"; import traitorIcon from "../../../../resources/images/TraitorIcon.svg"; import { PseudoRandom } from "../../../core/PseudoRandom"; import { Theme } from "../../../core/configuration/Config"; -import { AllPlayers, Cell, nukeTypes, UnitType } from "../../../core/game/Game"; +import { + AllPlayers, + Cell, + nukeTypes, + PlayerType, + UnitType, +} from "../../../core/game/Game"; import { GameView, PlayerView } from "../../../core/game/GameView"; import { createCanvas, renderNumber, renderTroops } from "../../Utils"; import { TransformHandler } from "../TransformHandler"; @@ -211,27 +217,29 @@ export class NameLayer implements Layer { troopsDiv.style.marginTop = "-5%"; element.appendChild(troopsDiv); - const shieldDiv = document.createElement("div"); - shieldDiv.classList.add("player-shield"); - shieldDiv.style.zIndex = "3"; - shieldDiv.style.marginTop = "-5%"; - shieldDiv.style.display = "flex"; - shieldDiv.style.alignItems = "center"; - shieldDiv.style.gap = "0px"; - const shieldImg = document.createElement("img"); - shieldImg.src = this.shieldIconImage.src; - shieldImg.style.width = "16px"; - shieldImg.style.height = "16px"; + if (player.type() !== PlayerType.Bot) { + const shieldDiv = document.createElement("div"); + shieldDiv.classList.add("player-shield"); + shieldDiv.style.zIndex = "3"; + shieldDiv.style.marginTop = "-5%"; + shieldDiv.style.display = "flex"; + shieldDiv.style.alignItems = "center"; + shieldDiv.style.gap = "0px"; + const shieldImg = document.createElement("img"); + shieldImg.src = this.shieldIconImage.src; + shieldImg.style.width = "16px"; + shieldImg.style.height = "16px"; - const shieldSpan = document.createElement("span"); - shieldSpan.textContent = "0"; - shieldSpan.style.color = "black"; - shieldSpan.style.fontSize = "10px"; - shieldSpan.style.marginTop = "-2px"; + const shieldSpan = document.createElement("span"); + shieldSpan.textContent = "0"; + shieldSpan.style.color = "black"; + shieldSpan.style.fontSize = "10px"; + shieldSpan.style.marginTop = "-2px"; - shieldDiv.appendChild(shieldImg); - shieldDiv.appendChild(shieldSpan); - element.appendChild(shieldDiv); + shieldDiv.appendChild(shieldImg); + shieldDiv.appendChild(shieldSpan); + element.appendChild(shieldDiv); + } // Start off invisible so it doesn't flash at 0,0 element.style.display = "none"; @@ -300,11 +308,10 @@ export class NameLayer implements Layer { const density = renderNumber( render.player.troops() / render.player.numTilesOwned(), ); - const shieldDiv = render.element.querySelector( - ".player-shield", - ) as HTMLDivElement; - const shieldImg = shieldDiv.querySelector("img"); - const shieldNumber = shieldDiv.querySelector("span"); + const shieldDiv: HTMLDivElement | null = + render.element.querySelector(".player-shield"); + const shieldImg = shieldDiv?.querySelector("img"); + const shieldNumber = shieldDiv?.querySelector("span"); if (shieldImg) { shieldImg.style.width = `${render.fontSize * 0.8}px`; shieldImg.style.height = `${render.fontSize * 0.8}px`;