Skip to content

[1/3] art: give the Hidden Garden parallax layers from a depth key - #143

Merged
arudaev merged 1 commit into
mainfrom
art/142-garden-layers
Oct 24, 2026
Merged

arudaev merged 1 commit into
mainfrom
art/142-garden-layers

Conversation

@arudaev

@arudaev arudaev commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

What and why

You asked for layers like the art. The Hidden Garden had one flat rear layer above the path, so nothing moved at its own depth. It now has docs/04's stack: sky 0.1 · far 0.25 · mid 0.6 · rear, water, path 1.0 · foreground 1.2. No hand-painted masks were used:

  1. depth_layers.py key: sunburst repaints the finished chunk as a flat-colour depth key, one colour per band. Masks come from the board's own picture, as AGENTS rule 2 requires.
  2. masks:
    • every pixel snaps to the nearest key colour and specks are voted away;
    • near the sky, the real pixel decides. Measured on the chunk: open sky ≈ (40–60, 120–140, 240), hazy far treetops ≈ (80, 120, 180), so "sky" means blue > 200.
    • Leaf fringes of the big near tree go to the rear layer.
    • The path, water and foreground keep their exact rules, which win.
  3. fill: for sky, far and mid, the model paints what the nearer layers hide, behind the layer's own skyline. The painting is kept only on pixels the nearer layers own, so at rest the stack still rebuilds the art exactly (export_stage.py --verify). When the camera moves, it reveals painted scenery, never holes.
  4. compare.py parallax: renders the region from export.json at several camera positions, the way the game draws it.

The plan diagram, palette and rules are in docs/09 – Parallax layers from a depth key.

Comparison (AGENTS.md rule 4)

hg-0-0-parallax.png shows the chunk at camera x = 0, 440 and 880. The top row is the approved chunk, unchanged; in the next two each layer has moved by its own speed.

parallax

Known and accepted: at x = 880 the far forest's left end shows a short vertical edge behind the mid trees. There is no plate past the ends of a tree line on purpose: the model painted sun glow with a flat top there.

Lane B

The loader in Codex's stack places a parallax layer at chunk.x × 2160. On any chunk after the first that puts it off-screen, Rusty Creek included. I commented the fix on #116. This region is one chunk, so it is correct either way until then.

How to test

python scripts/compare.py parallax art/stages/hidden-garden --at 0 300 600 880 --out tmp/parallax.png
python scripts/export_stage.py art/stages/hidden-garden --out tmp/stages --verify

In the game, open ?region=hidden-garden once lane B's stage loader (#116 →) is merged, and walk right: the sky barely moves, the forest drifts and the reeds go by at walking speed.

Stack

#148 replaces the per-chunk slow plates with region-wide plates in chunk tiles and moves the fill plates out of git.

Issue

Closes #142

Verification

  • python -m unittest discover -s scripts -p "test_*.py": 87 OK (test_depth_layers.py: snapping, specks, the sky edge, hazy treetops, the skyline, which masks are written)
  • split_layers.py --check and export_stage.py --verify: exact
  • check_docs.py

@arudaev arudaev self-assigned this Oct 23, 2026
@vercel

vercel Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
wincs Ready Ready Preview Oct 23, 2026 11:31pm UTC

Request Review

@github-actions github-actions Bot added area:art Sprite sheets, stage plates, direction pack area:stage Chunks, layers, collision, clean/anomaly states area:pipeline Rerunnable art and export scripts area:docs Design docs, README, contributor guides labels Oct 23, 2026
@arudaev arudaev changed the title art: give the Hidden Garden parallax layers from a depth key [1/2] art: give the Hidden Garden parallax layers from a depth key Oct 24, 2026
@arudaev arudaev changed the title [1/2] art: give the Hidden Garden parallax layers from a depth key [1/3] art: give the Hidden Garden parallax layers from a depth key Oct 24, 2026
@arudaev
arudaev added this pull request to stack #152 October 24, 2026 00:37
@arudaev
arudaev merged commit 1397868 into main Oct 24, 2026
11 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:art Sprite sheets, stage plates, direction pack area:docs Design docs, README, contributor guides area:pipeline Rerunnable art and export scripts area:stage Chunks, layers, collision, clean/anomaly states

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[M3-S2b] Hidden Garden: parallax layers from a depth key

1 participant