feat: 6849 loading screen by data - #8046
Conversation
|
Windows and Mac build successful in Unity Cloud! You can find a link to the downloadable artifact below. |
|
PR #8046, run #23942270238 Builds: Windows change, Windows baseline, macOS change, macOS baseline Intel Core i3
|
dalkia
left a comment
There was a problem hiding this comment.
Leaving some comments for possible simplifications
…en-by-data # Conflicts: # Explorer/Assets/DCL/Infrastructure/ECS/StreamableLoading/AssetBundles/LoadAssetBundleSystem.cs
Address PR review feedback and assembly cycle constraints. - Drop IStreamableLoadingProgressHandler interface, use BCL IProgress<float> directly. StreamableLoadingState implements it. - Move HEAD content-length lookup out of WebRequestController layer into LoadAssetBundleSystem. WebRequestController no longer references streamable loading concepts (avoids DCL.Network to ECS.Unity cycle). - Replace progressHandler param with (expectedContentLength, progressReporter) pair across SendAsync chain. - Extract byte-weighted progress bookkeeping from GatherGltfAssetsSystem into SceneByteProgressTracker (separately testable). - Use HashSet<Entity> for tracked entities instead of Dictionary; read ContentLength fresh from StreamableLoadingState at finish time. - Fix silent cancellation leak in polled SendRequest path: switch to UniTask.Yield(token) so OperationCanceledException propagates. - Drop redundant SetProgress(0) and SetContentLength(-1) init in LoadAssetBundleSystem; pool reset already handles it. ContentLength unknown sentinel is now -1 consistently.
SceneByteProgressTracker now memoizes ContentLength on registration in a Dictionary<Entity, long>, so CreditFinish/CreditDeath can credit the stored size without re-reading StreamableLoadingState. GatherGltfAssetsSystem only calls ReadLoadingState while an entity is still in LoadingState.Loading. Average-size estimation is replaced with a fixed UNKNOWN_ASSET_BYTES (1 KB) weight for assets that finished before their size was observed. This makes the unknown-slot contribution to effectiveTotal symmetric with the credit applied in CreditFinish, removing the prior drift between snapshot-time and compute-time averages.
Add BYTE_WEIGHTED_LOADING_PROGRESS so the HEAD round-trip and progress reporter in LoadAssetBundleSystem can be skipped at runtime. Flag off leaves state.ContentLength = -1 and progressReporter null, which collapses SceneByteProgressTracker math to count-based (every entity worth one UNKNOWN slot) for safe remote rollback. Tune the tracker so the on path looks better: - UNKNOWN_ASSET_BYTES from 1024 to 1 so cache hits stop skewing the bar away from real-download bytes. - Cap output below 1.0; AsyncLoadProcessReport.SetProgress(>=1f) auto-closes the loading screen and would fire mid finalize-wait window when in-progress credits saturate effectiveTotal. Only the explicit conclude path in GatherGltfAssetsSystem should report 1.0. - Lerp toward target each frame to absorb spikes from per-entity main AB completions and bursty UWR reports.
|
PR #8046, run #26216237624 Builds: Windows change, Windows baseline, macOS change, macOS baseline Framework 13 i7
|
- Drop dead Math.Max from ComputeAndClamp lerp guard. - Make smoothing frame-rate independent: take deltaTime parameter (GatherGltfAssetsSystem passes Update's t). - Log warning on GetDecompressedContentLength HEAD failures instead of swallowing silently; cancellations stay silent. - Add SceneByteProgressTrackerShould with 11 cases covering register idempotency, credit balance, monotonicity, unknown-size weighting, in-progress reset, and dt-gated smoothing. - Expose SceneLifeCycle internals to DCL.EditMode.Tests.
|
PR #8046, run #26220799532 Builds: Windows change, Windows baseline, macOS change, macOS baseline Framework 13 i7
|
|
PR #8046, run #26233784698 Builds: Windows change, Windows baseline, macOS change, macOS baseline Framework 13 i7
|
|
PR #8046, run #26281706672 Builds: Windows change, Windows baseline, macOS change, macOS baseline Framework 13 i7
|
…en-by-data # Conflicts: # Explorer/Assets/DCL/PluginSystem/World/AssetBundlesPlugin.cs
|
PR #8046, run #26942264212 Builds: Windows change, Windows baseline, macOS change, macOS baseline How to read this table
Framework 13 i7
|
|
PR #8046, run #26945250405 Builds: Windows change, Windows baseline, macOS change, macOS baseline How to read this table
Framework 13 i7
|
DafGreco
left a comment
There was a problem hiding this comment.
✔️ PR reviewed and approved by QA on both platforms following instructions playing both happy and un-happy path
Regressions for this ticket had been performed in order to verify that the normal flow is working as expected:
- [ ✔️ ] Backpack and wearables in world
- [ ✔️ ] Emotes in world and in backpack
- [ ✔️ ] Teleport with map/coordinates/Jump In
- [✔️ ] Chat and multiplayer
- [ ✔️ ] Profile card
- [✔️ ] Camera
- [✔️ ] Settings
Evidence without flag ✅
20260604-1032-53.9187944.mp4
Evidence with flag ✅
Pull Request Description
What does this PR change?
Replaces count-based scene loading progress with byte-weighted tracking so the loading bar reflects actual download volume rather than asset count. Implementation is gated behind a new feature flag (
byte-weighted-loading-progress) for safe remote rollback.Closes #6849.
Key pieces:
SceneByteProgressTrackeraggregates per-entity byte progress, credits finishes/deaths, and smooths output frame-rate independently.LoadAssetBundleSystemissues aHEADrequest (newGetDecompressedContentLengthOpon the web request controller) to learn each asset's decompressed size, then reports streamed bytes viaIProgress<float>.GatherGltfAssetsSystemdrives the tracker each frame and reports the smoothed value toAsyncLoadProcessReport.ContentLengthstays at -1 and the progress reporter is null; the tracker math collapses to count-based behaviour, matching today's loading screen.Other notes:
SceneByteProgressTrackerShould(11 cases) covering register idempotency, credit balance, monotonicity, unknown-size weighting, in-progress reset, and dt-gated smoothing.Test Instructions
Dont forget to test LSD as well.
Test Steps
alfa-byte-weighted-loading-progresson (editor defaults to on; remotely toggle via the feature flag service or--feature-flagarg), enter the same scene, and observe the loading screen.Additional Testing Notes
Quality Checklist
Code Review Reference
Please review our Code Review Standards before submitting.