From 0dbc246a638cefd86f1615c01562c923bf36e3dc Mon Sep 17 00:00:00 2001 From: Evan Date: Sat, 5 Apr 2025 17:14:56 -0700 Subject: [PATCH] reduce transport frequency for fakehumanexecution, make transport render more efficient --- src/client/graphics/layers/UnitLayer.ts | 5 ++--- src/core/configuration/DevConfig.ts | 2 +- src/core/execution/FakeHumanExecution.ts | 6 +++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/client/graphics/layers/UnitLayer.ts b/src/client/graphics/layers/UnitLayer.ts index b7a64b772..44b645988 100644 --- a/src/client/graphics/layers/UnitLayer.ts +++ b/src/client/graphics/layers/UnitLayer.ts @@ -500,14 +500,14 @@ export class UnitLayer implements Layer { // Clear previous area for (const t of this.game.bfs( unit.lastTile(), - manhattanDistFN(unit.lastTile(), 3), + manhattanDistFN(unit.lastTile(), 2), )) { this.clearCell(this.game.x(t), this.game.y(t)); } if (unit.isActive()) { // Paint trail - for (const t of trail.slice(-4)) { + for (const t of trail.slice(-1)) { this.paintCell( this.game.x(t), this.game.y(t), @@ -531,7 +531,6 @@ export class UnitLayer implements Layer { ); } - // Paint territory for (const t of this.game.bfs( unit.tile(), manhattanDistFN(unit.tile(), 1), diff --git a/src/core/configuration/DevConfig.ts b/src/core/configuration/DevConfig.ts index 5750fdc90..259ccccad 100644 --- a/src/core/configuration/DevConfig.ts +++ b/src/core/configuration/DevConfig.ts @@ -41,7 +41,7 @@ export class DevConfig extends DefaultConfig { } numSpawnPhaseTurns(): number { - return this.gameConfig().gameType == GameType.Singleplayer ? 40 : 100; + return this.gameConfig().gameType == GameType.Singleplayer ? 70 : 100; // return 100 } diff --git a/src/core/execution/FakeHumanExecution.ts b/src/core/execution/FakeHumanExecution.ts index 12356920e..d0063aa6c 100644 --- a/src/core/execution/FakeHumanExecution.ts +++ b/src/core/execution/FakeHumanExecution.ts @@ -150,12 +150,12 @@ export class FakeHumanExecution implements Execution { ); if (enemyborder.length == 0) { - if (this.random.chance(5)) { + if (this.random.chance(10)) { this.sendBoatRandomly(); } return; } - if (this.random.chance(10)) { + if (this.random.chance(20)) { this.sendBoatRandomly(); return; } @@ -513,7 +513,7 @@ export class FakeHumanExecution implements Execution { const src = this.random.randElement(oceanShore); - const dst = this.randOceanShoreTile(src, 250); + const dst = this.randOceanShoreTile(src, 150); if (dst == null) { return; }