Skip to content

Commit 10c171b

Browse files
author
DavidQ
committed
Level 18.8 overlay integration with telemetry system.
Enable Telemetry Overlay to reflect live system metrics.
1 parent 2570b89 commit 10c171b

7 files changed

Lines changed: 61 additions & 22 deletions

File tree

docs/dev/CODEX_COMMANDS.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ MODEL: GPT-5.4-codex
22
REASONING: medium
33

44
COMMAND:
5-
Integrate overlay system with mission system:
6-
- Connect Mission Feed overlay to mission state updates
7-
- Ensure live updates reflect correctly
8-
- Preserve existing overlay behavior
5+
Integrate overlay system with telemetry system:
6+
- Connect Telemetry Overlay to telemetry data
7+
- Ensure real-time updates
8+
- Preserve overlay behavior and performance
99

1010
Package ZIP to <project folder>/tmp/

docs/dev/COMMIT_COMMENT.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
Level 18.7 overlay integration with mission system.
2-
Enable Mission Feed overlay to reflect live mission state.
1+
Level 18.8 overlay integration with telemetry system.
2+
Enable Telemetry Overlay to reflect live system metrics.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[ ] Mission Feed updates with state
1+
[ ] Telemetry Overlay updates with data
22
[ ] Overlay cycle unaffected
33
[ ] No regression in other overlays
4-
[ ] Stable behavior
4+
[ ] Stable performance

docs/pr/BUILD_PR.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,30 @@
1-
# BUILD_PR_LEVEL_18_7_OVERLAY_MISSION_SYSTEM_INTEGRATION
1+
# BUILD_PR_LEVEL_18_8_OVERLAY_TELEMETRY_SYSTEM_INTEGRATION
22

33
## PLAN
44

55
### Purpose
6-
Integrate overlay system with mission system so Mission Feed and related overlays respond to mission state changes.
6+
Integrate overlay system with telemetry system so Telemetry Overlay reflects live system metrics and state.
77

88
### Goals
9-
- Sync Mission Feed overlay with mission state
10-
- Ensure overlay updates reflect live mission progress
11-
- Maintain overlay cycle behavior
9+
- Sync Telemetry Overlay with telemetry data
10+
- Ensure real-time updates
11+
- Maintain overlay stability and performance
1212

1313
---
1414

1515
## BUILD
1616

1717
### Scope
18-
- Hook overlay system into mission state updates
19-
- Ensure Mission Feed overlay reflects current mission data
20-
- No changes to overlay positioning or cycling
21-
- No UI redesign
18+
- Connect overlay system to telemetry data sources
19+
- Ensure Telemetry Overlay updates in real time
20+
- No changes to overlay cycle behavior or positioning
2221

2322
### Test Steps
24-
1. Trigger mission updates
25-
2. Verify Mission Feed overlay updates
23+
1. Generate telemetry data
24+
2. Verify Telemetry Overlay updates
2625
3. Cycle overlays and confirm consistency
2726
4. Confirm no regression in other overlays
2827

2928
### Expected
30-
- Mission Feed reflects live state
29+
- Telemetry Overlay reflects live data
3130
- Overlay system remains stable

samples/phase-17/1712/GameplayMetricsTelemetryScene.js

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ GameplayMetricsTelemetryScene.js
77
import { createBottomRightDebugPanelStack, drawStackedDebugPanel } from '/src/engine/debug/index.js';
88
import RealGameplayMiniGameScene from '/samples/phase-17/1708/RealGameplayMiniGameScene.js';
99
import { getRequiredLevel17OverlayStackConfig } from '/samples/phase-17/shared/overlayStackBySampleConfig.js';
10+
import { getTabDebugOverlayTelemetrySnapshot } from '/samples/phase-17/shared/tabDebugOverlayCycle.js';
1011
const OVERLAY_UI_LAYER = 'ui-layer';
1112
const OVERLAY_MISSION_FEED = 'mission-feed';
1213
const OVERLAY_MISSION_READY = 'mission-ready';
@@ -56,10 +57,22 @@ export default class GameplayMetricsTelemetryScene extends RealGameplayMiniGameS
5657
speedHistory: [],
5758
fpsHistory: [],
5859
collisionHistory: [],
60+
overlay: {
61+
activeId: '',
62+
activeIndex: 0,
63+
stackSize: 0,
64+
cycleKey: '',
65+
statusLabel: 'none',
66+
},
5967
};
6068
this.setDebugOverlayCycleKey(DEBUG_OVERLAY_CONFIG.cycleKey);
6169
this.setDebugOverlayPersistenceKey(DEBUG_OVERLAY_CONFIG.persistenceKey);
6270
this.setDebugOverlayCycleMap(DEBUG_OVERLAY_CONFIG.overlays, DEBUG_OVERLAY_CONFIG.initialOverlayId || OVERLAY_UI_LAYER);
71+
this.refreshOverlayTelemetrySnapshot();
72+
}
73+
74+
refreshOverlayTelemetrySnapshot() {
75+
this.telemetry.overlay = getTabDebugOverlayTelemetrySnapshot(this.tabDebugOverlays);
6376
}
6477

6578
step3DPhysics(dtSeconds, engine) {
@@ -93,6 +106,7 @@ export default class GameplayMetricsTelemetryScene extends RealGameplayMiniGameS
93106
pushSample(this.telemetry.speedHistory, speed);
94107
pushSample(this.telemetry.fpsHistory, this.telemetry.avgFps);
95108
pushSample(this.telemetry.collisionHistory, this.lastCollisionCount);
109+
this.refreshOverlayTelemetrySnapshot();
96110
}
97111

98112
render(renderer) {
@@ -113,8 +127,8 @@ export default class GameplayMetricsTelemetryScene extends RealGameplayMiniGameS
113127
`maxSpeed=${this.telemetry.maxPlayerSpeed.toFixed(2)}`,
114128
`objects=${objectCount} coresRemaining=${remainingCores}`,
115129
`collisions=${this.telemetry.collisionsTotal}`,
116-
`actions=${this.telemetry.actionEvents}`,
117-
`stateTransitions=${this.telemetry.stateTransitions}`,
130+
`actions=${this.telemetry.actionEvents} transitions=${this.telemetry.stateTransitions}`,
131+
`overlay=${this.telemetry.overlay.statusLabel} key=${this.telemetry.overlay.cycleKey}`,
118132
]);
119133

120134
drawTelemetrySparkline(

samples/phase-17/shared/tabDebugOverlayCycle.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,28 @@ export function getTabDebugOverlayStatusLabel(controller) {
323323
return `${active.label} (${index + 1}/${controller.overlays.length})`;
324324
}
325325

326+
export function getTabDebugOverlayTelemetrySnapshot(controller) {
327+
if (!controller || !Array.isArray(controller.overlays) || controller.overlays.length === 0) {
328+
return {
329+
activeId: '',
330+
activeIndex: 0,
331+
stackSize: 0,
332+
cycleKey: String(controller?.cycleKey || ''),
333+
statusLabel: 'none',
334+
};
335+
}
336+
337+
const activeIndex = normalizeActiveIndex(controller);
338+
const activeEntry = controller.overlays[activeIndex] || null;
339+
return {
340+
activeId: activeEntry?.id || '',
341+
activeIndex,
342+
stackSize: controller.overlays.length,
343+
cycleKey: String(controller.cycleKey || ''),
344+
statusLabel: getTabDebugOverlayStatusLabel(controller),
345+
};
346+
}
347+
326348
export function resetTabDebugOverlayPersistenceForTests() {
327349
for (const key of overlayPersistenceKeys.values()) {
328350
if (typeof localStorage !== 'undefined') {

tests/runtime/Phase17Sample1712GameplayMetricsTelemetry.test.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ function assertTelemetryOverlayAndCounters() {
105105
scene.step3DPhysics(0.2, { input: makeInput(['KeyD']) });
106106
assert.equal(scene.telemetry.playerSpeed > 0, true, 'Telemetry should report positive player speed after movement.');
107107
assert.equal(scene.telemetry.avgFps > 0, true, 'Telemetry should report FPS.');
108+
assert.equal(scene.telemetry.overlay.stackSize, 4, 'Telemetry should include overlay stack telemetry details.');
109+
assert.equal(scene.telemetry.overlay.activeId, 'ui-layer', 'Telemetry should report active overlay id in real time.');
108110

109111
const firstCore = scene.cores.find((core) => core.collected === false);
110112
positionPlayerOnCore(scene, firstCore);
@@ -126,6 +128,7 @@ function assertTelemetryOverlayAndCounters() {
126128
assert.equal(renderer.texts.some((text) => text.includes('Telemetry Overlay')), false, 'Telemetry panel should not render by default.');
127129

128130
pressOverlayCycle(scene);
131+
assert.equal(scene.telemetry.overlay.activeId, 'mission-feed', 'Telemetry should update active overlay id after overlay cycling.');
129132
const missionFeedRenderer = createRendererProbe();
130133
scene.render(missionFeedRenderer);
131134
assert.equal(missionFeedRenderer.texts.some((text) => text.includes('Mission Feed')), true, 'First G press should cycle to Mission Feed.');
@@ -140,6 +143,7 @@ function assertTelemetryOverlayAndCounters() {
140143
scene.render(telemetryRenderer);
141144
assert.equal(telemetryRenderer.texts.some((text) => text.includes('Telemetry Overlay')), true, 'Third G press should cycle to Telemetry Overlay.');
142145
assert.equal(telemetryRenderer.texts.some((text) => text.includes('playerSpeed=')), true, 'Telemetry overlay should render player-speed metrics.');
146+
assert.equal(telemetryRenderer.texts.some((text) => text.includes('overlay=Telemetry Overlay')), true, 'Telemetry overlay should render live overlay telemetry state.');
143147
assert.equal(telemetryRenderer.texts.some((text) => text.includes('UI Layer')), false, 'Only one debug overlay should be visible at a time.');
144148
}
145149

0 commit comments

Comments
 (0)