fix: Prevent startup rendering delay by waiting for first render state#1124
Merged
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
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