diff --git a/src/core/configuration/DevConfig.ts b/src/core/configuration/DevConfig.ts index d72b57aa3..e5dc3bdda 100644 --- a/src/core/configuration/DevConfig.ts +++ b/src/core/configuration/DevConfig.ts @@ -25,6 +25,9 @@ export const devConfig = new class extends DefaultConfig { turnIntervalMs(): number { return 100 } + tradeShipSpawnRate(): number { + return 10 + } // boatMaxDistance(): number { // return 5000 // } diff --git a/src/core/worker/Worker.worker.ts b/src/core/worker/Worker.worker.ts index abfc37aed..adbc3edc1 100644 --- a/src/core/worker/Worker.worker.ts +++ b/src/core/worker/Worker.worker.ts @@ -51,7 +51,7 @@ function initializeMap(data: { gameMap: GameMap }) { }; }); self.postMessage({ type: 'initialized' }); - processingInterval = setInterval(computeSearches, 100000) as unknown as number; + processingInterval = setInterval(computeSearches, .1) as unknown as number; } function findPath(terrainMap: TerrainMap, miniTerrainMap: TerrainMap, req: SearchRequest) { diff --git a/src/core/worker/WorkerClient.ts b/src/core/worker/WorkerClient.ts index e5cffc9b4..99dfbb858 100644 --- a/src/core/worker/WorkerClient.ts +++ b/src/core/worker/WorkerClient.ts @@ -63,15 +63,11 @@ export class ParallelAStar implements AStar { findPath(): Promise { const requestId = crypto.randomUUID(); this.promise = new Promise((resolve, reject) => { - const timeout = setTimeout(() => { - reject("Path timeout"); - }, 100000); const handler = (e: MessageEvent) => { if (e.data.requestId != requestId) { return; } - clearTimeout(timeout); this.worker.removeEventListener('message', handler); if (e.data.type === 'pathFound') {