Skip to content

Commit ce16366

Browse files
author
DavidQ
committed
Draw manifest-declared game backgrounds across all render states without opaque suppression - PR 11.87
1 parent b332486 commit ce16366

6 files changed

Lines changed: 135 additions & 5 deletions

docs/dev/codex_commands.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Codex Command — PR 11.86
1+
# Codex Commands — PR 11.87
22

33
Model: GPT-5.4
44
Reasoning: high
55

6-
```bash
7-
codex exec --model gpt-5.4 --reasoning high "Apply PR 11.86. Enforce bezel stretch SSoT in game manifests: move/remove any stretchOverride.uniformEdgeStretchPx from asset-browser.assets.bezel or equivalent duplicate browser/chrome config, and keep/add it only on image.*.bezel manifest entries. Ensure image.asteroids.bezel has stretchOverride.uniformEdgeStretchPx set to 10. Do not add fallback bezel/background loading. Do not add aliases or duplicate contracts. Produce a report under docs/dev/reports."
6+
```powershell
7+
codex exec --model gpt-5.4 --reasoning high "Run BUILD_PR_11_87_MANIFEST_BACKGROUND_ALWAYS_VISIBLE. Make manifest-declared image.*.background draw in all render states, prevent opaque clears/fills from hiding a present background, preserve manifest-only chrome asset loading, and write targeted validation evidence to docs/dev/reports/PR_11_87_validation.md. Do not run the full sample suite. Return a repo-structured ZIP at tmp/PR_11_87_MANIFEST_BACKGROUND_ALWAYS_VISIBLE.zip."
88
```

docs/dev/commit_comment.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Keep bezel stretch override on image bezel manifest entries only - PR 11.86
1+
Draw manifest-declared game backgrounds across all render states without opaque suppression - PR 11.87
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# PR 11.87 Validation Placeholder
2+
3+
Codex must replace this with actual targeted validation evidence.
4+
5+
Required evidence:
6+
- Asteroids menu background visible.
7+
- Asteroids attract background visible.
8+
- Asteroids gameplay background visible.
9+
- No guessed background/bezel 404s.
10+
- No full sample suite run; targeted validation only.
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# BUILD_PR_11_87_MANIFEST_BACKGROUND_ALWAYS_VISIBLE
2+
3+
## Codex Task
4+
Implement the smallest safe change so manifest-declared backgrounds are always drawn and are not hidden by clear/fill behavior.
5+
6+
## Required Changes
7+
8+
### 1. Background rendering gate
9+
Find the background rendering helper/module, likely near:
10+
11+
```text
12+
src/**/backgroundImage.js
13+
```
14+
15+
Change the logic so a valid manifest-declared background is not restricted to gameplay-only modes.
16+
17+
Required behavior:
18+
19+
```text
20+
if manifest has image.*.background and image loaded:
21+
draw background for menu/title/attract/gameplay/pause/etc.
22+
else:
23+
keep existing safe empty/no-background behavior
24+
```
25+
26+
Do not add fallback paths.
27+
28+
### 2. Clear/fill behavior
29+
Find scene code that clears or paints full-screen dark fills before/after background draw, especially:
30+
31+
```text
32+
games/Asteroids/**/AsteroidsGameScene.js
33+
games/Asteroids/**/AsteroidsAttractAdapter.js
34+
```
35+
36+
When a manifest background is present:
37+
- do not paint an opaque clear/fill that hides it
38+
- keep overlays translucent if needed for readability
39+
- preserve foreground UI/text/asteroids/title drawing
40+
41+
### 3. Manifest-only rule
42+
Confirm bezel/background loading only comes from `game.manifest.json` entries like:
43+
44+
```json
45+
"image.asteroids.background": {
46+
"path": "/games/Asteroids/assets/images/deluxe.png",
47+
"kind": "image",
48+
"source": "workspace-manager"
49+
}
50+
```
51+
52+
Remove or reject any newly discovered guessed paths like:
53+
54+
```text
55+
/games/<Game>/assets/images/background.png
56+
/games/<Game>/assets/images/bezel.png
57+
```
58+
59+
### 4. No duplicated SSoT
60+
Do not add background display options under `asset-browser.assets.background`.
61+
Background image behavior belongs to `image.*.background` manifest entries and renderer behavior only.
62+
63+
## Validation
64+
Run targeted validation only:
65+
66+
```text
67+
Asteroids menu state: deluxe.png visible
68+
Asteroids attract state: deluxe.png visible, not hidden by full-screen dark rect
69+
Asteroids gameplay state: deluxe.png visible
70+
Asteroids pause state: deluxe.png visible if pause is available
71+
Browser console: no missing bezel/background 404s
72+
Search: no guessed background/bezel path fallback added
73+
```
74+
75+
Write evidence to:
76+
77+
```text
78+
docs/dev/reports/PR_11_87_validation.md
79+
```
80+
81+
## Constraints
82+
- No full sample suite.
83+
- No broad render architecture refactor.
84+
- No hardcoded default assets.
85+
- No alias/pass-through helpers.
86+
- No unrelated file changes.
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# PLAN_PR_11_87_MANIFEST_BACKGROUND_ALWAYS_VISIBLE
2+
3+
## Purpose
4+
Make manifest-declared game background images visible in all game presentation states, including menu/title/attract/pause, instead of being suppressed by gameplay-only render gates or hidden by clear/fill overlays.
5+
6+
## Problem
7+
Asteroids can declare a valid background image in `game.manifest.json`, but it is not visible because background rendering is gated to gameplay states and attract/menu rendering can paint near-opaque full-screen fills over it.
8+
9+
Known evidence from user validation:
10+
- `backgroundImage.js` only draws in gameplay states.
11+
- `AsteroidsGameScene.js` handles `session.mode === 'menu'`.
12+
- `AsteroidsAttractAdapter.js` draws a near-opaque full-screen dark rect in attract mode.
13+
- The manifest entry and `deluxe.png` are valid; this is render-state behavior, not a missing-file issue.
14+
15+
## Scope
16+
- Manifest-declared `image.*.background` is the source of truth for background loading.
17+
- If a background exists and loads, draw it for all states before scene-specific foreground overlays.
18+
- Do not clear/fill over a present background in a way that makes it invisible.
19+
- Allow menu/attract/pause overlays to be transparent/translucent only if the background remains visible.
20+
21+
## Out of Scope
22+
- No new default/fallback background paths.
23+
- No hidden sample/default assets.
24+
- No hardcoded `/assets/images/background.png` guesses.
25+
- No manifest schema expansion beyond using existing `image.*.background` entries.
26+
- No unrelated render refactors.
27+
28+
## Acceptance
29+
- Asteroids `deluxe.png` background is visible on menu/attract/gameplay/pause when declared in manifest.
30+
- No 404 for guessed background paths.
31+
- No hardcoded chrome asset fallback remains.
32+
- Background draw path is manifest-only.
33+
- Targeted validation documented in `docs/dev/reports/PR_11_87_validation.md`.

games/Asteroids/game/AsteroidsGameScene.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ import AsteroidsAttractAdapter from './AsteroidsAttractAdapter.js';
1414
import AsteroidsHighScoreService from '../systems/AsteroidsHighScoreService.js';
1515
import AsteroidsInitialsEntry from '../systems/AsteroidsInitialsEntry.js';
1616
import {
17-
ASTEROIDS_GAME_OVER_AUTO_EXIT_SECONDS, ASTEROIDS_GAME_OVER_RETURN_MODE } from "../rules/flowRules.js";
17+
ASTEROIDS_GAME_OVER_AUTO_EXIT_SECONDS, ASTEROIDS_GAME_OVER_RETURN_MODE
18+
} from "../rules/flowRules.js";
1819
import { ASTEROIDS_GAME_OVER_RETURN_STATUS } from "../rules/flowContent.js";
1920

2021
const HUD_FONT = '"Vector Battle", monospace';

0 commit comments

Comments
 (0)