feat(debug_ui): performance, ECS inspector and console panels #878
No reviewers
Labels
No labels
Context: Bug
Context: Enhancements
Platform: Android
Platform: Linux
Platform: Web
Platform: Windows
Platform: iOS
Platform: macOS
Release
Target: CI
Target: CLI
Target: Dependency
Target: Engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
SakulFlee/Orbital!878
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/debug-ui-panels-v2"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A new
orbital_debug_uicrate providing three floating Iced panels overthe game render, toggled with F1:
FrameTimingsas last/avg/min/max. This is the data that used to existonly as the once-a-second
TIMINGlog line.component types each one holds and their current values. The world is
flat, since nothing in the engine uses
Parent/Children, so there isno scene-graph shape to show.
Each panel is a pure
fn(&World) -> Element, which is the modelorbital_icedalready uses, so there is no snapshot to keep in sync and noper-panel program state.
The panels are registered as
IcedLayerRenderer<DebugMessage>pushedstraight into
register_overlays, rather than throughIcedUiState.That keeps their message enum out of the application's own panel
messages — a library should not force its messages on its users — and
avoids the module-ordering constraint
IcedUiStateimplies.Panel visibility lives in the
DebugUiStateresource and is checked byeach panel's view, not via
IcedState::set_visible: the toggle is a keypress handled by an ECS system, so the renderer's own copy of the state
would never see it. A hidden panel renders a two-widget blank tree, which
still fills the window (the runtime builds one full-window
UserInterfaceper panel) but costs almost nothing to build.The ECS tree is capped at 200 rows. A world can hold hundreds of
thousands of entities, and the tree is rebuilt every frame, so
materialising a row per entity would stall the render loop long before
the list was scrolled. Component values are truncated to 200 characters
for the same reason.
Release builds compile the module out entirely unless
allow_in_release(true)is set, so a shipped game pays neither the buildcost nor the per-frame panel cost.
The edge-detection state for the toggle lives in
DebugUiStateratherthan its own resource: the ECS has no
IntoSystemimpl taking twoResMutparameters, so a toggle system cannot update two resources.The all-in-one template's hand-rolled FPS HUD is removed — that is what
the Performance panel is for — and
DebugUiModuleis added to it and tothe
multi_moduleexample.Also fixes a clippy lint in
entity_components' sort from the ECSintrospection change.