ReviewOS

stacks/the-settlers-iii-remake

Render original movable shadow masks with correct sequence mapping

#214
Closed chris opened this 7 days ago ·
7 days ago

The browser currently draws the same oval under every visible settler. The supplied reference reads separate original shadow masks and attaches them to each body frame. The demo contains these masks, so the current oval loses the source shape, anchor, action frame and opacity.

Primary sources at paulwedeck/settlers-remake@6ad8c42:

  • AdvancedDatFileReader: shadow section 0x5982, independent sequence alignment, the special file-11 specialist shift, and body-to-shadow attachment.
  • ShadowTranslator: displaced headers; an opaque run emits the stored value 136 without consuming body-color bytes.
  • SettlerImage and unified shader: signed layer bounds, body/torso precedence, shadow alpha and depth behavior.

Raw demo section inventory confirms body/torso/shadow sequence counts of 60/60/60 in file 10, 239/226/239 in file 11, and 34/25/26 in file 12. A body's direct table index, or the generic torso offset, is therefore not sufficient evidence of the right shadow. Follow the actual shadow mapping and source-version rules.

Acceptance:

  • Import the available original shadow masks for the currently imported movable sequences. Keep exact source selectors, hashes, frame identity, transparent regions and signed anchors in the content provenance.
  • Implement the bounded shadow RLE format at the DAT decoder source. Reject truncated tables, malformed runs, invalid dimensions and allocation bombs. Do not read nonexistent per-pixel color bytes.
  • Resolve shadow mapping separately from torso mapping, including legitimate missing layers and the reference's file-specific alignments. Test absent prefixes, specialist shifts and differing frame counts with independent expected results.
  • Replace the generic oval with the matching original shadow. Preserve source layer precedence and scene occlusion; a missing original shadow must not become a fabricated oval. Keep player colors and body pixels unchanged.
  • Derive frame selection and visibility only from the same actual simulation scene as the body. Drawing stays read-only, fog conceals foreign shadows, and paused or reduced-motion rendering invents no work.
  • Exercise representative carrier, soldier and geologist poses with independently decoded pixels, overlapping layers, signed anchors, missing shadows, fog, pause, save/reload and disposal. Keep memory bounded and verify real browser output.
  • Run complete unit/browser, asset, type, lint and production build checks and retain verified CI diagnostics. Original media remains local under the existing publication policy.

Source owner: stacksjs/the-settlers-iii-remake. Parent #20; follows the RGB correction in #213 and separate player-color layers in #211. Full additional profession/faction animation coverage, Gold executable measurements and native presentation remain broader work.

This is supplied-reference fidelity work. No original Gold executable is available, and passing it must not be described as measured Gold runtime equivalence.

7 days ago

The DAT decoder now reads original shadow runs without consuming body-color bytes and preserves their alpha value and signed anchors. Independent original-data checks cover the imported mappings, including the shorter shadow prefix and specialist-table shift. The converter now emits 3,525 shadow frames; the reference's 122 unattached late bowman-strike frames remain explicitly absent.

The browser pixel suite passed 12,673 checks across 32 poses, with fog, pause, save/load, missing layers, opaque-layer precedence and disposal coverage. A steep-terrain case verifies the reference depth offset and rejects the shortcut of painting every shadow below every body. The published renderer reproduced the missing-shadow pixel failure before the new path passed.

Atlas reference and bounds validation is also shared by startup and the build verifier. Complete local gates and production CI verification are next. This remains supplied-reference fidelity work, not Gold runtime observation.

7 days ago

The full CI run passed the existing gameplay suites, including the production-paced rival battle. The new shadow suite stopped on a single-channel rounding difference in Linux Canvas: 48,65,36 versus the floating-point expectation 49,65,36.

The expectation now composites independently decoded original mask values over measured ground through native Canvas. Final pixels are still compared exactly, with no tolerance. All 12,673 local pixel checks pass; the renderer and original masks are unchanged. The complete Linux gate is being repeated before closing this issue.

7 days ago

Original movable shadows now use their source masks, signed anchors, action frames and independent sequence mapping. The generic oval is removed. Layer ordering follows the reference map-row depth offset, including the steep-terrain case where another unit can fall between a shadow and its body.

The complete Linux CI run passed lint, types, original asset import/verification, 388 unit tests, the production build and 504 browser checks across 14 suites. The original diagnostic archive was downloaded and verified against its GitHub digest and ZIP checksums; every suite reports no console errors or failed requests, and the full production-paced battle completed.

The shadow suite checks 12,673 independent pixels across 32 poses, with fog, pause, save/load, missing layers, body/torso precedence, source depth occlusion and disposal. The Linux compositor expectation is exact and the previous renderer still fails the same source-pixel regression.

This completes the currently imported movable-shadow scope. Additional profession/faction animation coverage, original Gold runtime measurements and native presentation remain broader work. Terrain coverage seams and cache retention are tracked separately in #215 and #216.

Sign in to comment on this issue.