Skip to content

foscail: convert UI-art EPFs (setoa/Legend/national) instead of raw-only - #20

Merged
baughj merged 1 commit into
mainfrom
feature/ui-epf-palettes
Aug 2, 2026
Merged

foscail: convert UI-art EPFs (setoa/Legend/national) instead of raw-only#20
baughj merged 1 commit into
mainfrom
feature/ui-epf-palettes

Conversation

@baughj

@baughj baughj commented Jul 26, 2026

Copy link
Copy Markdown
Member

Converts the UI / interface EPFs that Foscail previously left as raw extractions, so tooling (Brigid theming) can consume old-client UI art as PNG.

Background

EPF is a palettized format; the converter routes each EPF to a palette by filename family (efct/mefc → effpal, item → itempal, khan → khanpal). Everything else — UI / interface art — had no known palette convention and was left raw. A census found this is 410 of 28,797 EPFs (1.4%), all in three archives: setoa (286), Legend (83), national (41).

A probe of that art showed the palettes ship in the archives; identifying which was the whole job (no reverse-engineering needed).

Change

ConvertEpf's unknown-family fallthrough now resolves the UI palette in priority order:

  1. same-name .pal beside the EPF (field001.epf → field001.pal; f*, Backpal*, …)
  2. gui00.pal — setoa GUI chrome shares it
  3. legend.pal — this archive's, or a sibling Legend.dat (national ships none of its own and borrows Legend's, the same cross-archive pattern khan uses for khanpal.dat)

This intentionally reverses the prior "modern archive keeps unknown families raw" stance, now that the convention is known. Known families still route to their own tables before reaching this path.

Verification

Corpus effect (7.41): setoa 771 → 2,673 images, Legend15,289, national 77 → 129 — the ~410 previously-raw families now convert. Eyeballed the major clusters (setoa chrome, Legend emotes, name-matched field, national town-maps/paper) — all render correctly, not plausible-but-wrong.

4 new AssetConverterTests cover each rule and the precedence; the obsolete "never falls back" test is rewritten to the new contract. Full suite green: Foscail 20, DALib 947.

Caveat

The gui00 / legend.pal conventions are empirically confirmed (probe of 7.41 art), not binary-traced. Fine for extraction; a rung-1 trace could confirm later if needed. The .tbl siblings (emo*.tbl, story*.tbl) are not palettes and are out of scope — per-variant recoloring would be a separate layer.

Generated with Imbas imbas@eris.co

Unknown-family EPFs (UI/interface art) were left as raw extractions. Their
palettes ship in the archives; a probe of the 7.41 setoa/Legend/national art
identified the convention, so ConvertEpf now resolves it in priority order:

  1. a same-name .pal beside the EPF (field001.epf -> field001.pal, f*, ...)
  2. setoa GUI chrome -> gui00.pal
  3. legend.pal -> this archive's, or a sibling Legend.dat (national ships
     none of its own and borrows Legend's, like khan uses khanpal.dat)

This intentionally reverses the old "modern archive keeps unknown families
raw" stance now that the palette convention is known (probe-confirmed for
chrome, emotes, town-maps, paper, name-matched field art). Known families
still route to their own tables before reaching this path.

Corpus effect (7.41): setoa 771 -> 2,673 images, Legend +~15k, national
77 -> 129; the ~410 previously-raw EPFs now convert. Palettes are empirically
grounded, not binary-traced.

Adds 4 AssetConverter tests (gui00, name-match precedence, sibling legend.pal,
legend.pal with family tables present) and rewrites the now-obsolete
"never falls back" test to the new contract.

Co-Authored-By: Imbas <imbas@eris.co>
@baughj
baughj merged commit 1ccaf33 into main Aug 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant