delete num fake humans config, this is set by map json file

This commit is contained in:
evanpelle
2024-10-08 20:45:18 -07:00
parent 7235b73b6c
commit e1f7d395f2
6 changed files with 2 additions and 32 deletions
-22
View File
@@ -145,28 +145,6 @@ class Client {
g.stop();
});
}
numFakeHumans(lobby: Lobby): number {
const gameHash = simpleHash(lobby.id)
const totalNumFakeHumans = this.config.numFakeHumans(lobby.id)
const timeLeft = lobby.msUntilStart
const rand = new PseudoRandom(gameHash)
const startTimes: number[] = []
const lobbyTime = this.config.gameCreationRate()
for (let i = 0; i < totalNumFakeHumans; i++) {
startTimes.push(rand.nextInt(0, lobbyTime))
}
startTimes.sort()
let currNumFakeHumans = 0
for (const joinTime of startTimes) {
if (timeLeft < joinTime) {
currNumFakeHumans++
}
}
return currNumFakeHumans
}
}
function refreshUsername(): string {
+1 -1
View File
@@ -98,7 +98,7 @@ export class ClientGame {
this.renderer.initialize()
this.input.initialize()
this.gs.addExecution(...this.executor.spawnBots(this.gs.config().numBots()))
this.gs.addExecution(...this.executor.fakeHumanExecutions(this.gs.config().numFakeHumans(this.gameID)))
this.gs.addExecution(...this.executor.fakeHumanExecutions())
this.gs.addExecution(new WinCheckExecution(this.eventBus))
this.intervalID = setInterval(() => this.tick(), 10);
-1
View File
@@ -31,7 +31,6 @@ export interface Config {
gameCreationRate(): number
lobbyLifetime(): number
numBots(): number
numFakeHumans(gameID: GameID): number
numSpawnPhaseTurns(): number
startTroops(playerInfo: PlayerInfo): number
-3
View File
@@ -46,9 +46,6 @@ export class DefaultConfig implements Config {
numBots(): number {
return 400
}
numFakeHumans(gameID: GameID): number {
return simpleHash(gameID) % 40
}
turnIntervalMs(): number {
return 100
}
-4
View File
@@ -26,10 +26,6 @@ export const devConfig = new class extends DefaultConfig {
// return 10 * 10
// }
// numFakeHumans(gameID: GameID): number {
// return 1
// }
// startTroops(playerInfo: PlayerInfo): number {
// // if (playerInfo.isBot) {
// // return 5000
+1 -1
View File
@@ -85,7 +85,7 @@ export class Executor {
return new BotSpawner(this.gs, this.gameID).spawnBots(numBots).map(i => this.createExec(i))
}
fakeHumanExecutions(numFakes: number): Execution[] {
fakeHumanExecutions(): Execution[] {
const execs = []
for (const nation of this.gs.nations()) {
execs.push(new FakeHumanExecution(