From 64d13a46bdd096f02a8b350cc0870548ed27756f Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 13 Feb 2025 11:50:15 -0800 Subject: [PATCH 1/5] bugfix: bots were not losing troops in attack. rebalanced difficulties. --- src/core/configuration/DefaultConfig.ts | 6 +++--- src/core/execution/AttackExecution.ts | 2 +- src/core/execution/BotExecution.ts | 2 -- src/core/execution/FakeHumanExecution.ts | 6 ++++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index 2c21ee40a..b97d1363d 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -387,11 +387,11 @@ export class DefaultConfig implements Config { case Difficulty.Easy: return maxPop * 0.5; case Difficulty.Medium: - return maxPop * 0.7; - case Difficulty.Hard: return maxPop * 1; - case Difficulty.Impossible: + case Difficulty.Hard: return maxPop * 1.5; + case Difficulty.Impossible: + return maxPop * 2; } } diff --git a/src/core/execution/AttackExecution.ts b/src/core/execution/AttackExecution.ts index b016539e6..d85434947 100644 --- a/src/core/execution/AttackExecution.ts +++ b/src/core/execution/AttackExecution.ts @@ -44,7 +44,7 @@ export class AttackExecution implements Execution { private startTroops: number | null = null, private _ownerID: PlayerID, private _targetID: PlayerID | null, - private sourceTile: TileRef | null, + private sourceTile: TileRef | null = null, private removeTroops: boolean = true, ) {} diff --git a/src/core/execution/BotExecution.ts b/src/core/execution/BotExecution.ts index 7fde24e19..956fb90a8 100644 --- a/src/core/execution/BotExecution.ts +++ b/src/core/execution/BotExecution.ts @@ -103,8 +103,6 @@ export class BotExecution implements Execution { this.bot.troops() / 20, this.bot.id(), toAttack.isPlayer() ? toAttack.id() : null, - null, - null, ), ); } diff --git a/src/core/execution/FakeHumanExecution.ts b/src/core/execution/FakeHumanExecution.ts index d3921adca..682c3e44f 100644 --- a/src/core/execution/FakeHumanExecution.ts +++ b/src/core/execution/FakeHumanExecution.ts @@ -26,6 +26,7 @@ import { closestTwoTiles } from "./Util"; import { calculateBoundingBox, simpleHash } from "../Util"; import { andFN, manhattanDistFN, TileRef } from "../game/GameMap"; import { ConstructionExecution } from "./ConstructionExecution"; +import { renderTroops } from "../../client/Utils"; export class FakeHumanExecution implements Execution { private firstMove = true; @@ -545,13 +546,14 @@ export class FakeHumanExecution implements Execution { } sendAttack(toAttack: Player | TerraNullius) { + console.log( + `${this.player.name()} sending troops ${renderTroops(this.player.troops() / 5)}`, + ); this.mg.addExecution( new AttackExecution( this.player.troops() / 5, this.player.id(), toAttack.isPlayer() ? toAttack.id() : null, - null, - null, ), ); } From 9dc326e06a3a43d835f8637a9f11c8b1125fb0f2 Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 13 Feb 2025 11:51:25 -0800 Subject: [PATCH 2/5] rename intense difficulty => impossible --- src/client/components/Difficulties.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/components/Difficulties.ts b/src/client/components/Difficulties.ts index 88765855d..77913b355 100644 --- a/src/client/components/Difficulties.ts +++ b/src/client/components/Difficulties.ts @@ -5,7 +5,7 @@ export enum DifficultyDescription { Easy = "Relaxed", Medium = "Balanced", Hard = "Intense", - Impossible = "Challenging", + Impossible = "Impossible", } @customElement("difficulty-display") From b859e5417b30830f2ce1c71fbff15a71b84be8c2 Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 13 Feb 2025 15:19:54 -0800 Subject: [PATCH 3/5] make impossible harder --- src/core/configuration/DefaultConfig.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index b97d1363d..fa7fa48ba 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -360,9 +360,9 @@ export class DefaultConfig implements Config { case Difficulty.Medium: return 5_000 * (playerInfo?.nation?.strength ?? 1); case Difficulty.Hard: - return 15_000 * (playerInfo?.nation?.strength ?? 1); - case Difficulty.Impossible: return 20_000 * (playerInfo?.nation?.strength ?? 1); + case Difficulty.Impossible: + return 50_000 * (playerInfo?.nation?.strength ?? 1); } } return this.creativeMode() ? 1_000_000 : 25_000; From f2d50a79b87018f1bbacbebb8b1c03912ca9ea12 Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 13 Feb 2025 15:36:41 -0800 Subject: [PATCH 4/5] capitalize yes/no on traitor display --- src/client/graphics/layers/PlayerPanel.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/graphics/layers/PlayerPanel.ts b/src/client/graphics/layers/PlayerPanel.ts index 567626d5a..bfd0c4c19 100644 --- a/src/client/graphics/layers/PlayerPanel.ts +++ b/src/client/graphics/layers/PlayerPanel.ts @@ -186,7 +186,7 @@ export class PlayerPanel extends LitElement implements Layer {
Traitor
- ${other.isTraitor() ? "yes" : "no"} + ${other.isTraitor() ? "Yes" : "No"}
From 2f8a746a525c8f9b0482c217824e5c344ed5eb26 Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 13 Feb 2025 20:34:02 -0800 Subject: [PATCH 5/5] greatly reduce attack bonus for large attacks. --- src/core/configuration/DefaultConfig.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index fa7fa48ba..cbed881bb 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -301,7 +301,7 @@ export class DefaultConfig implements Config { if (defender.isPlayer()) { return { attackerTroopLoss: - within(defender.troops() / (2.5 * attackTroops), 0.1, 10) * mag, + within(defender.troops() / attackTroops, 0.5, 2) * mag, defenderTroopLoss: defender.troops() / defender.numTilesOwned(), tilesPerTickUsed: within(defender.troops() / (5 * attackTroops), 0.2, 1.5) * speed,