fix(webgl): the browser menu before the game data — no ghost images, singleplayer waits for the data, compressed download (#2185 #2186 #2187) - #2196
Merged
Conversation
…singleplayer waits for the data, compressed download (#2185 #2186 #2187) On the first visit after an update the browser menu is usable long before the game data (56 files, ~20 MB of JSON, re-downloaded every release) is in. - ShellClearCamera: the launcher scene has no camera and the backdrop's camera needs the content, so nothing cleared the screen and every shell canvas left ghost images. A culling-mask-0 black clear now runs while no other camera draws to the screen (#2185). - BootBrowserSingleplayer waits behind the loading screen until ContentReady instead of starting the in-process server without content ("could not be started in this browser"); the loading screen shows the data download (ui.loading.data, all 14 languages) (#2186). - deploy/worldhost: caddy.encode zstd gzip — the JSON shrinks ~10-35x on the wire; the Unity build files (octet-stream) are not matched (#2187). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
Closes #2185
Closes #2186
Closes #2187
What happened
On the first visit after the v2026.10.2 update (
/play), the auto-opened "What's new?" stayed on screen after it was closed. Menu, loading screen and the "New world?" dialog were drawn on top of each other, the background was black and the logo smeared. "New world" → "Delete and start over" did nothing for a long time, then ended in "The world could not be started in this browser". A reload made it work.One root cause. The browser menu is up before the game data has downloaded and parsed. The data cache is stamped with the version, so every release re-downloads it: 56 files, ~20 MB of JSON, served uncompressed (measured live;
settlement_templates.json6.8 MB → 194 KB gzipped). During that window:Launcher.unityhas no camera, and the backdrop's camera (MenuBackground) waits for the content. So every overlay canvas left ghost images.BootBrowserSingleplayerstarted the in-process server withContent == null, and theGameServerconstructor threw (ui.sp.browser_failed). The loading screen sat at 0 % meanwhile.Changes
ShellClearCamera(new): created inAppShell.Awake; solid black, culling mask 0, depth -100. It enables itself inLateUpdateonly while no other enabled camera renders to the screen; cameras with a target texture (preview rigs) do not count. The backdrop, the intro, the editors and the world rig take over as before.AppShell.BootBrowserSingleplayer: waits behind the loading screen untilContentReady. It stops if the phase changes, and returns to the menu (content-error overlay with Retry) if the download fails.UiLoading: while the browser data is still loading, the title reads "Loading game data… n/56" and the bar follows the download. NewStreamingAssetsCache.RemoteFileTotal.ui.loading.data: all 14 languages, translated by hand.deploy/worldhost/docker-compose.yml:caddy.encode: zstd gzip. Caddy's default type list skips the Unity build files: they are Brotli-packed*.unityweband go out asapplication/octet-stream(checked live).docs/developer/WEBCLIENT_FEASIBILITY.md§"The menu before the game data"; TODO.md entry.Verification
scripts/locale-test-filter.py): 395 passed, 0 failed.scripts/build-client.ps1, Windows player): Build Finished, Result: Success; no generated files to commit.run-tests.ps1 -Suites UnityEdit): 176 total, 173 passed, 1 skipped. The newShellClearCameraEditModeTestspass 7/7. The 2 failures are the known ones already onmain:InputAbstractionEditModeTests.EveryAction_HasALabelKey_AndIsListedInARebindGroup(FeedCreature, since feat(creatures): begging herds — herds of 6–12, animals that beg for the food in your hand, a Feed action (Q); real giant sounds + a sand-sea VEGA line (#2018) #2023) and the staleChunkMesherGoldenEditModeTestsgolden.ui.loading.datais hand-translated in all 14 locales;tools/locale_report.pyshows 5268/5268 keys and clean for every language.Rollout
worldhostdeploy (deploy.yml). After that deploy, checkcurl -s -o /dev/null -D - -H 'Accept-Encoding: gzip' …/play/StreamingAssets/data/settlement_templates.json(expectsContent-Encoding), the same on…/play/Build/player-webgl.data.unityweb(expects none), and one browser load.🤖 Generated with Claude Code