further calibration to nukes and population

This commit is contained in:
1brucben
2025-04-23 21:05:04 +02:00
parent 245986e15d
commit 4e94b5b37b
2 changed files with 9 additions and 5 deletions
+3 -3
View File
@@ -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 {
+6 -2
View File
@@ -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);