diff --git a/TODO.txt b/TODO.txt index 75d1ff440..b1a62c70a 100644 --- a/TODO.txt +++ b/TODO.txt @@ -104,6 +104,14 @@ * BUG: fix tile per turn pacing issues DONE 9/9/2024 * Improve expansion directions (more uniform) 9/9/2024 +Uncaught Error: Player with id 0fbon not found + player https://tunnel.openfront.dev/bundle.js:2 + init https://tunnel.openfront.dev/bundle.js:2 + tick https://tunnel.openfront.dev/bundle.js:2 + tick https://tunnel.openfront.dev/bundle.js:2 + tick https://tunnel.openfront.dev/bundle.js:2 + intervalID https://tunnel.openfront.dev/bundle.js:2 + --- v3 Release * BUG: when clicking on enemy sometimes boat goes all the way around diff --git a/resources/images/TerrainMapFrontPage.png b/resources/images/TerrainMapFrontPage.png index 6b2d41e4b..6c050ebef 100644 Binary files a/resources/images/TerrainMapFrontPage.png and b/resources/images/TerrainMapFrontPage.png differ diff --git a/src/client/Client.ts b/src/client/Client.ts index 186f3bb91..5cc970374 100644 --- a/src/client/Client.ts +++ b/src/client/Client.ts @@ -147,7 +147,7 @@ class Client { const timeLeft = lobby.msUntilStart const rand = new PseudoRandom(gameHash) const startTimes: number[] = [] - const lobbyTime = this.config.lobbyLifetime() / this.config.gameCreationRate() + const lobbyTime = this.config.gameCreationRate() for (let i = 0; i < totalNumFakeHumans; i++) { startTimes.push(rand.nextInt(0, lobbyTime)) } diff --git a/src/client/ClientGame.ts b/src/client/ClientGame.ts index ce81f1523..4ed0a7bf9 100644 --- a/src/client/ClientGame.ts +++ b/src/client/ClientGame.ts @@ -132,7 +132,7 @@ export class ClientGame { this.renderer.initialize() this.input.initialize() this.gs.addExecution(...this.executor.spawnBots(this.gs.config().numBots())) - console.log('!!! number fake humans 15') + console.log('!!! number fake humans ') this.gs.addExecution(...this.executor.fakeHumanExecutions(this.gs.config().numFakeHumans(this.gameID))) this.intervalID = setInterval(() => this.tick(), 10); diff --git a/src/client/graphics/TerritoryRenderer.ts b/src/client/graphics/TerritoryRenderer.ts index 1fca22723..a2b9d9f16 100644 --- a/src/client/graphics/TerritoryRenderer.ts +++ b/src/client/graphics/TerritoryRenderer.ts @@ -69,8 +69,8 @@ export class TerritoryRenderer { } } ) - bfs(event.boat.tile(), dist(event.boat.tile(), 2)).forEach(t => this.paintCell(t.cell(), this.theme.borderColor(event.boat.owner().id()), 180)) - bfs(event.boat.tile(), dist(event.boat.tile(), 1)).forEach(t => this.paintCell(t.cell(), this.theme.territoryColor(event.boat.owner().id()), 150)) + bfs(event.boat.tile(), dist(event.boat.tile(), 2)).forEach(t => this.paintCell(t.cell(), this.theme.borderColor(event.boat.owner().id()), 200)) + bfs(event.boat.tile(), dist(event.boat.tile(), 1)).forEach(t => this.paintCell(t.cell(), this.theme.territoryColor(event.boat.owner().id()), 180)) } else { trail.forEach(t => this.paintTerritory(t)) this.boatToTrail.delete(event.boat) diff --git a/src/core/configuration/DefaultConfig.ts b/src/core/configuration/DefaultConfig.ts index c335014ea..e93c43843 100644 --- a/src/core/configuration/DefaultConfig.ts +++ b/src/core/configuration/DefaultConfig.ts @@ -20,7 +20,7 @@ export class DefaultConfig implements Config { return 400 } numFakeHumans(gameID: GameID): number { - return simpleHash(gameID) % 3 + return simpleHash(gameID) % 5 } turnIntervalMs(): number { return 100 @@ -53,10 +53,10 @@ export class DefaultConfig implements Config { speed = mag if (attacker.isPlayer() && defender.isPlayer()) { - if (attacker.type() == PlayerType.Bot && defender.type() != PlayerType.Bot) { + if (attacker.type() == PlayerType.Bot && defender.type() == PlayerType.FakeHuman) { mag *= 1.2 } - if (attacker.type() != PlayerType.Bot && defender.type() == PlayerType.Bot) { + if (attacker.type() == PlayerType.FakeHuman && defender.type() == PlayerType.Bot) { mag *= .8 } } @@ -64,7 +64,7 @@ export class DefaultConfig implements Config { if (defender.isPlayer()) { return { attackerTroopLoss: within(defender.troops() / attacker.troops() * mag, 1, 1000), - defenderTroopLoss: within(attacker.troops() / defender.troops(), 1, 1000), + defenderTroopLoss: defender.troops() / defender.numTilesOwned(), tilesPerTickUsed: within(defender.troops() / (attackTroops * 5), .2, 3) * speed } } else { @@ -121,7 +121,7 @@ export class DefaultConfig implements Config { toAdd *= 1.2 } if (player.type() == PlayerType.Bot) { - toAdd *= .6 + toAdd *= .8 } return Math.min(player.troops() + toAdd, max) diff --git a/src/core/execution/AttackExecution.ts b/src/core/execution/AttackExecution.ts index ebc8f9fa2..9bc60e020 100644 --- a/src/core/execution/AttackExecution.ts +++ b/src/core/execution/AttackExecution.ts @@ -64,6 +64,7 @@ export class AttackExecution implements Execution { // Existing attack on same target, add troops if (otherAttack._owner == this._owner && otherAttack.targetID == this.targetID && this.sourceCell == otherAttack.sourceCell) { otherAttack.troops += this.troops + otherAttack.refreshToConquer() this.active = false return } diff --git a/src/core/execution/BotExecution.ts b/src/core/execution/BotExecution.ts index a0f593521..b75787ccf 100644 --- a/src/core/execution/BotExecution.ts +++ b/src/core/execution/BotExecution.ts @@ -66,11 +66,11 @@ export class BotExecution implements Execution { return } } - if (owner.type() == PlayerType.Human) { - if (this.random.chance(2)) { - return - } - } + // if (owner.type() == PlayerType.Human) { + // if (this.random.chance(2)) { + // return + // } + // } } this.sendAttack(owner) }