From 4e94b5b37b70a851dc51202d6cf85e3597e07d1b Mon Sep 17 00:00:00 2001 From: 1brucben <1benjbruce@gmail.com> Date: Wed, 23 Apr 2025 21:05:04 +0200 Subject: [PATCH] further calibration to nukes and population --- src/core/configuration/DefaultConfig.ts | 6 +++--- src/core/execution/PlayerExecution.ts | 8 ++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index 1f9c79b1e..da509f3d2 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -569,7 +569,7 @@ export class DefaultConfig implements Config { player.units(UnitType.City).length * this.cityPopulationIncrease(); if (player.type() == PlayerType.Bot) { - return maxPop / 2; + return maxPop / 3; } if (player.type() == PlayerType.Human) { @@ -651,7 +651,7 @@ export class DefaultConfig implements Config { } troopAdjustmentRate(player: Player): number { - const maxDiff = this.maxPopulation(player) / 1000; + const maxDiff = this.maxPopulation(player) / 500; const target = player.population() * player.targetTroopRatio(); const diff = target - player.troops(); if (Math.abs(diff) < maxDiff) { @@ -682,7 +682,7 @@ export class DefaultConfig implements Config { // Humans can be population, soldiers attacking, soldiers in boat etc. nukeDeathFactor(humans: number, tilesOwned: number): number { - return humans / Math.max(1, tilesOwned); + return humans / Math.max(2, tilesOwned); } structureMinDist(): number { diff --git a/src/core/execution/PlayerExecution.ts b/src/core/execution/PlayerExecution.ts index df86b96e6..bf6a3cd35 100644 --- a/src/core/execution/PlayerExecution.ts +++ b/src/core/execution/PlayerExecution.ts @@ -80,8 +80,12 @@ export class PlayerExecution implements Execution { } const popInc = this.config.populationIncreaseRate(this.player); - this.player.addWorkers(popInc * (1 - this.player.targetTroopRatio())); - this.player.addTroops(popInc * this.player.targetTroopRatio()); + this.player.addWorkers( + popInc * (1 - this.player.troops() / this.player.population()), + ); + this.player.addTroops( + (popInc * this.player.troops()) / this.player.population(), + ); this.player.addGold(this.config.goldAdditionRate(this.player)); const adjustRate = this.config.troopAdjustmentRate(this.player); this.player.addTroops(adjustRate);