feat: add scene content stats to the Current Scene debug widget#9457
Draft
dalkia wants to merge 2 commits into
Draft
feat: add scene content stats to the Current Scene debug widget#9457dalkia wants to merge 2 commits into
dalkia wants to merge 2 commits into
Conversation
Adds per-scene content statistics (entities, triangles, meshes/bodies, geometries, materials, textures, colliders, runtime content size and external content) to the "Current scene" debug widget, shown as current / maxcap (pct%) colored green/yellow/red against hardcoded caps derived from the scene's parcel count. Counting runs in a new scene-world system (SceneContentStatsSystem) gated by a demand flag the widget sets only while expanded, so it costs a single bool check per frame when the debug panel is closed or disabled. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Contributor
|
Warnings count reduced: 14593 => 14591 Warnings/errors in files changed by this PR (68) |
Contributor
|
Tests: 23922 passed, 0 failed ✅ |
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.
Pull Request Description
What does this PR change?
Adds per-scene content statistics to the "Current scene" debug widget so creators and devs can see, at a glance, how close the scene they are standing in is to its limits. Nine new rows appear at the top of the widget, each formatted
current / maxcap (pct%)and colored green (< 80%), yellow (80–99%) or red (≥ 100%):EntitiesMap.Count)MeshinstancesProfiler.GetRuntimeMemorySizeLong); there is no per-scene downloaded-bytes accumulator, so deployed size is not knowable at runtimeCaps are hardcoded from the documented Decentraland scene limitations, scaled by parcel count
n: trianglesn×10000, entitiesn×200, bodiesn×300, materialslog2(n+1)×20, textureslog2(n+1)×10, geometrieslog2(n+1)×200, content size15MB×n. Colliders (n×300) and external content (10) have no documented limit, so they use project-chosen constants. All caps live in one constants block inDebugViewCurrentSceneSystem.Formatting.cs.Architecture: a new scene-world system (
SceneContentStatsSystem,SyncedPresentationSystemGroup) counts every 30 frames and writes into a newSceneContentStatspayload onSceneRuntimeMetrics(now exposed to scene-world systems viaECSWorldInstanceSharedDependencies). The globalDebugViewCurrentSceneSystemsets aCollectionRequesteddemand flag only while the widget is expanded on the current scene — with the debug panel closed or disabled, the scene system does a single bool check per frame and nothing else. Counting is allocation-free (reusedHashSets / scratch list, non-allocGetSharedMaterials).Test Instructions
Steps (standard run):
Expected result:
The "Current scene" debug widget shows the nine new stat rows with colored
current / max (pct%)values for the scene you are standing in.Steps (fresh account):
Expected result:
Same as above after finishing onboarding.
Automation (if applicable):
N/A
Prerequisites
--debug)Test Steps
current / max (pct%)values colored green/yellow/redAdditional Testing Notes
Finishedstate, so values grow while a scene streams inQuality Checklist
Code Review Reference
Please review our Branch & PR Standards before submitting. It explains the automated review flow, QA/DEV approval requirements, and what each label does — especially useful for first-time contributors.
🤖 Generated with Claude Code