diff --git a/src/core/configuration/Config.ts b/src/core/configuration/Config.ts index af00edb88..77499c1be 100644 --- a/src/core/configuration/Config.ts +++ b/src/core/configuration/Config.ts @@ -142,7 +142,6 @@ export interface Config { maxPopulation(player: Player | PlayerView): number; cityPopulationIncrease(): number; boatAttackAmount(attacker: Player, defender: Player | TerraNullius): number; - boatMaxDistance(): number; boatMaxNumber(): number; allianceDuration(): Tick; allianceRequestCooldown(): Tick; diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index 3eebde133..d8d724630 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -279,9 +279,6 @@ export class DefaultConfig implements Config { boatMaxNumber(): number { return 3; } - boatMaxDistance(): number { - return 500; - } numSpawnPhaseTurns(): number { return this._gameConfig.gameType == GameType.Singleplayer ? 100 : 300; } diff --git a/src/core/execution/FakeHumanExecution.ts b/src/core/execution/FakeHumanExecution.ts index 0b4a02abc..097b8950d 100644 --- a/src/core/execution/FakeHumanExecution.ts +++ b/src/core/execution/FakeHumanExecution.ts @@ -282,19 +282,14 @@ export class FakeHumanExecution implements Execution { if (closest == null) { return; } - if ( - this.mg.manhattanDist(closest.x, closest.y) < - this.mg.config().boatMaxDistance() - ) { - this.mg.addExecution( - new TransportShipExecution( - this.player.id(), - other.id(), - closest.y, - this.player.troops() / 5, - ), - ); - } + this.mg.addExecution( + new TransportShipExecution( + this.player.id(), + other.id(), + closest.y, + this.player.troops() / 5, + ), + ); } private handleUnits() { @@ -403,7 +398,7 @@ export class FakeHumanExecution implements Execution { } private warshipSpawnTile(portTile: TileRef): TileRef | null { - const radius = this.mg.config().boatMaxDistance() / 2; + const radius = 250; for (let attempts = 0; attempts < 50; attempts++) { const randX = this.random.nextInt( this.mg.x(portTile) - radius, @@ -418,12 +413,6 @@ export class FakeHumanExecution implements Execution { } const tile = this.mg.ref(randX, randY); // Sanity check - if ( - this.mg.manhattanDist(tile, portTile) >= - this.mg.config().boatMaxDistance() - ) { - continue; - } if (!this.mg.isOcean(tile)) { continue; } diff --git a/src/core/execution/TransportShipExecution.ts b/src/core/execution/TransportShipExecution.ts index 0f9055c4c..14eaa6419 100644 --- a/src/core/execution/TransportShipExecution.ts +++ b/src/core/execution/TransportShipExecution.ts @@ -65,7 +65,7 @@ export class TransportShipExecution implements Execution { this.lastMove = ticks; this.mg = mg; - this.pathFinder = PathFinder.Mini(mg, 10_000, false, 2); + this.pathFinder = PathFinder.Mini(mg, 10_000, false, 10); this.attacker = mg.player(this.attackerID); diff --git a/src/core/game/PlayerImpl.ts b/src/core/game/PlayerImpl.ts index c1c30f8e8..684f9cb59 100644 --- a/src/core/game/PlayerImpl.ts +++ b/src/core/game/PlayerImpl.ts @@ -728,17 +728,11 @@ export class PlayerImpl implements Player { if (!this.mg.isOcean(tile)) { return false; } - const spawns = this.units(UnitType.Port) - .filter( - (u) => - this.mg.manhattanDist(u.tile(), tile) < - this.mg.config().boatMaxDistance(), - ) - .sort( - (a, b) => - this.mg.manhattanDist(a.tile(), tile) - - this.mg.manhattanDist(b.tile(), tile), - ); + const spawns = this.units(UnitType.Port).sort( + (a, b) => + this.mg.manhattanDist(a.tile(), tile) - + this.mg.manhattanDist(b.tile(), tile), + ); if (spawns.length == 0) { return false; }