mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 09:30:45 +00:00
minor fixes
This commit is contained in:
@@ -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
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.8 MiB After Width: | Height: | Size: 2.7 MiB |
@@ -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))
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user