diff --git a/src/core/GameRunner.ts b/src/core/GameRunner.ts index e79357265..983e63672 100644 --- a/src/core/GameRunner.ts +++ b/src/core/GameRunner.ts @@ -4,7 +4,7 @@ import { getConfig } from "./configuration/Config"; import { EventBus } from "./EventBus"; import { Executor } from "./execution/ExecutionManager"; import { WinCheckExecution } from "./execution/WinCheckExecution"; -import { Cell, DisplayMessageUpdate, Game, GameUpdateType, MessageType, MutableGame, NameViewData, Player, PlayerActions, PlayerID, PlayerProfile, UnitType } from "./game/Game"; +import { Cell, DisplayMessageUpdate, Game, GameUpdateType, MessageType, MutableGame, NameViewData, Player, PlayerActions, PlayerID, PlayerProfile, PlayerType, UnitType } from "./game/Game"; import { createGame } from "./game/GameImpl"; import { loadTerrainMap as loadGameMap } from "./game/TerrainMapLoader"; import { GameConfig, Turn } from "./Schemas"; @@ -62,8 +62,14 @@ export class GameRunner { this.game.addExecution(...this.execManager.createExecs(this.turns[this.currTurn])) this.currTurn++ const updates = this.game.executeNextTick() - // TODO: make name rendering more efficient in spawn phase. - if (this.game.inSpawnPhase() || this.game.ticks() % 30 == 0) { + + if (this.game.inSpawnPhase() && this.game.ticks() % 2 == 0) { + this.game.players() + .filter(p => p.type() == PlayerType.Human || p.type() == PlayerType.FakeHuman) + .forEach(p => this.playerViewData[p.id()] = placeName(this.game, p)) + } + + if (this.game.ticks() < 3 || this.game.ticks() % 30 == 0) { this.game.players().forEach(p => { this.playerViewData[p.id()] = placeName(this.game, p) }) diff --git a/src/core/configuration/DevConfig.ts b/src/core/configuration/DevConfig.ts index 7e4999d6f..9243c59a9 100644 --- a/src/core/configuration/DevConfig.ts +++ b/src/core/configuration/DevConfig.ts @@ -26,7 +26,7 @@ export class DevConfig extends DefaultConfig { unitInfo(type: UnitType): UnitInfo { const info = super.unitInfo(type) const oldCost = info.cost - info.cost = (p: Player) => oldCost(p) / 10000 + // info.cost = (p: Player) => oldCost(p) / 10000 return info }