From 006da79b8098dc1d614ae848381277e367acf761 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Fri, 13 Sep 2024 09:10:26 -0700 Subject: [PATCH] rebalance, expansion terrain agnostic --- TODO.txt | 3 --- src/core/configuration/DefaultConfig.ts | 14 +++++------ src/core/execution/AttackExecution.ts | 33 +++++++++++-------------- 3 files changed, 22 insertions(+), 28 deletions(-) diff --git a/TODO.txt b/TODO.txt index 8378d95bf..214b2426d 100644 --- a/TODO.txt +++ b/TODO.txt @@ -112,10 +112,7 @@ --- v3 Release - * store cookies -* BUG: when clicking on enemy sometimes boat goes all the way around -* names dissappear too much (maybe screen size) * names dissapear on bottom of screen * UI: win condition & popup * UI: boats diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index cc2cad788..f3fbc4231 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -42,15 +42,15 @@ export class DefaultConfig implements Config { speed = 10 break case TerrainType.Highland: - mag = 30 + mag = 20 speed = 20 break case TerrainType.Mountain: - mag = 90 + mag = 40 speed = 40 break } - // speed = mag + speed = mag if (attacker.isPlayer() && defender.isPlayer()) { if (attacker.type() == PlayerType.Bot && defender.type() == PlayerType.FakeHuman) { @@ -69,9 +69,9 @@ export class DefaultConfig implements Config { } } else { return { - attackerTroopLoss: mag, + attackerTroopLoss: Math.max(10, mag / 1.5), defenderTroopLoss: 0, - tilesPerTickUsed: within(this.startTroops(attacker.info()) / (attackTroops * 5), .2, 3) * speed + tilesPerTickUsed: within(this.startTroops(attacker.info()) / (attackTroops * 5), .2, 3) * Math.max(10, speed / 1.5) } } } @@ -105,7 +105,7 @@ export class DefaultConfig implements Config { maxTroops(player: Player): number { let max = Math.sqrt(player.numTilesOwned()) * 3000 + 50000 - return Math.min(max, 1_000_000) + return Math.min(max, 2_000_000) } troopAdditionRate(player: Player): number { @@ -118,7 +118,7 @@ export class DefaultConfig implements Config { // console.log(`to add ${toAdd}`) if (player.type() == PlayerType.FakeHuman) { - toAdd *= 1.2 + toAdd *= 1.1 } if (player.type() == PlayerType.Bot) { toAdd *= .8 diff --git a/src/core/execution/AttackExecution.ts b/src/core/execution/AttackExecution.ts index bffd97574..b2ad77ba5 100644 --- a/src/core/execution/AttackExecution.ts +++ b/src/core/execution/AttackExecution.ts @@ -152,27 +152,24 @@ export class AttackExecution implements Execution { if (this.targetCell != null) { dist = manhattanDist(tile.cell(), this.targetCell) } - // if() { - + // if (numOwnedByMe > 2) { + // numOwnedByMe = 10 + // } + // let mag = 0 + // switch (tile.terrain()) { + // case TerrainType.Plains: + // mag = 1 + // break + // case TerrainType.Highland: + // mag = 2 + // break + // case TerrainType.Mountain: + // mag = 3 + // break // } - if (numOwnedByMe > 2) { - numOwnedByMe = 10 - } - let mag = 0 - switch (tile.terrain()) { - case TerrainType.Plains: - mag = 1 - break - case TerrainType.Highland: - mag = 2 - break - case TerrainType.Mountain: - mag = 3 - break - } this.toConquer.enqueue(new TileContainer( neighbor, - dist / 100 + this.random.nextInt(0, 3) - numOwnedByMe * 2 + mag, + dist / 100 + this.random.nextInt(0, 2) - numOwnedByMe, // + mag, this.mg.ticks() )) }