packing tiles for more efficient transfer

This commit is contained in:
Evan
2025-02-01 12:05:11 -08:00
parent 2441abd7c8
commit 1bbb5c9ac3
8 changed files with 126 additions and 26 deletions
+2
View File
@@ -124,6 +124,8 @@ export class ClientGameRunner {
this.renderer.initialize()
this.input.initialize()
this.worker.start((gu: GameUpdateViewData) => {
const size = gu.packedTileUpdates.length * 4 / 1000
console.log(`game update size: ${size}kb`)
this.gameView.update(gu)
this.renderer.tick()
})
@@ -36,6 +36,10 @@ export class TerritoryLayer implements Layer {
}
tick() {
this.game.recentlyUpdatedTiles()
.forEach(t => this.enqueue(t))
if (!this.game.inSpawnPhase()) {
return
}