ReviewOS

stacks/the-settlers-iii-remake

Match reference RGB555 and RGB565 channel expansion in DAT decoding

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

The DAT reader expands RGB555/RGB565 channels by bit replication. The supplied pinned remake instead truncates channel * 255 / maxChannel for body, landscape and GUI conversion. Intermediate channel values differ, although black and fully saturated test colors agree.

Hand-encoded public-decoder reproduction:

  • RGB565 word 0x2204 returns RGBA [33,65,33,255]; the reference returns [32,64,32,255].
  • RGB555 word 0x1084 returns [33,33,33,255]; the reference returns [32,32,32,255].

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

Acceptance:

  • Correct RGB channel expansion in the owning DAT decoder, using independently worked expected values and the pinned reference contract. Preserve torso grayscale conversion, transparency, signed anchors, format selection, section alignment and allocation bounds.
  • Add a failing byte-level regression for intermediate values in both formats, and cover every 5-bit and 6-bit channel level. Existing saturated-color examples alone cannot detect the mismatch.
  • Rebuild affected original media through the maintained converter and retain updated source/pixel provenance. Refresh composed-frame expectations independently; do not simply accept newly generated snapshots as proof.
  • Verify representative body, landscape and GUI pixels, existing compositions and all affected asset manifests. Preserve simulation rules, saves and replay checksums.
  • Run unit/browser checks, types, lint, assets and build, then verify committed CI before closure.

This is consistency with the supplied reference decoder, not a measured Gold runtime color claim. Player palette selection and original map-slot mapping remain separate in #211; full content work remains in #20.

7 days ago

RGB555 and RGB565 conversion now uses the supplied reference's channel expansion. Intermediate colors agree with independent decoding of body, landscape and interface frames; transparency, anchors and torso intensity remain intact.

The full unit suite, asset verification, type checks, lint and build passed. All 500 browser checks passed with no collected console or request errors, including the full ten-minute rival battle. CI results.

The first CI attempt exposed an HTTP 500 from the original download host. The downloader now retries transient server failures within its existing total deadline and still requires the pinned checksum. Permanent errors and incorrect bytes remain failures.

Player-specific torso coloring continues in #211. This establishes agreement with the supplied source, not measured Gold runtime colors.

Sign in to comment on this issue.