Skip to content

fix: Prevent startup rendering delay by waiting for first render state#1124

Merged
braedonsaunders merged 1 commit into
mainfrom
claude/fix-startup-rendering-delay-B0qId
Jan 30, 2026
Merged

fix: Prevent startup rendering delay by waiting for first render state#1124
braedonsaunders merged 1 commit into
mainfrom
claude/fix-startup-rendering-delay-B0qId

Conversation

@braedonsaunders

Copy link
Copy Markdown
Owner

The terrain map was rendering before buildings, units, and minerals for a few seconds at startup. This was caused by the loading screen completing before entity data arrived from the game worker.

Changes:

  • Add waitForFirstRenderState() method to WorkerBridge that resolves when the first render state with entities is received from the worker
  • Update WebGPUGameCanvas to await this method after spawning entities, ensuring all game objects are ready before the loading screen fades out and the countdown begins
  • Make GameWorker send an initial render state immediately after spawning entities (before the game loop starts), so the main thread receives entity data during initialization

This integrates with the existing Phaser overlay countdown - entities are now guaranteed to be visible before the countdown starts.

https://claude.ai/code/session_013CXJ1mTpfxWUY7FHXT54gY

The terrain map was rendering before buildings, units, and minerals for
a few seconds at startup. This was caused by the loading screen completing
before entity data arrived from the game worker.

Changes:
- Add waitForFirstRenderState() method to WorkerBridge that resolves when
  the first render state with entities is received from the worker
- Update WebGPUGameCanvas to await this method after spawning entities,
  ensuring all game objects are ready before the loading screen fades out
  and the countdown begins
- Make GameWorker send an initial render state immediately after spawning
  entities (before the game loop starts), so the main thread receives
  entity data during initialization

This integrates with the existing Phaser overlay countdown - entities are
now guaranteed to be visible before the countdown starts.

https://claude.ai/code/session_013CXJ1mTpfxWUY7FHXT54gY
@braedonsaunders braedonsaunders merged commit dd687eb into main Jan 30, 2026
4 checks passed
@braedonsaunders braedonsaunders deleted the claude/fix-startup-rendering-delay-B0qId branch January 30, 2026 03:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants