Skip to content

Add a tool to ingest mod entity art into the CDN layout#494

Closed
ptrlrd wants to merge 1 commit into
feat/mod-asset-directoryfrom
feat/mod-ingest-tool
Closed

Add a tool to ingest mod entity art into the CDN layout#494
ptrlrd wants to merge 1 commit into
feat/mod-asset-directoryfrom
feat/mod-ingest-tool

Conversation

@ptrlrd

@ptrlrd ptrlrd commented Jun 16, 2026

Copy link
Copy Markdown
Owner

Follow-up to the mod-asset directory (#493). This adds the tool that turns a community mod's art into the id-named layout the site falls back to.

What it does

tools/ingest_mod.py takes a mod key from data/mods.json and a source, and stages normalized art ready for CDN upload:

  • Source is a loose image folder (e.g. a cloned WatcherMod repo) or a Godot .pck. A .pck is unpacked statically with GDRE Tools, the same way update.py extracts the main game, so nothing needs the game running.
  • For each entity type in the mod's paths map, it converts every image to extraction/mods/<key>/<type>/<id>.webp.
  • Ids come from the source filename, lowercased, matching the in-game id convention the run and live pages resolve by.
  • Godot .import sidecars and non-image files are ignored.

The per-type subpaths and the source extension come from data/mods.json, so the input matches the layout the frontend expects. Output lands in extraction/, which is gitignored, so nothing binary gets committed.

Verified

Ran it against WatcherMod (github.com/lamali292/WatcherMod):

python3 tools/ingest_mod.py --key watcher --source /tmp/WatcherMod/Watcher/images
  cards: 92 image(s)
  relics: 9 image(s)
  - .../potions has no images, skipping
Done. 101 image(s) staged

The card and relic counts match the repo once the .import sidecars are excluded. The potions folder holds only subfolders and a script, so it is correctly skipped. Sample output is valid RGBA webp.

Notes

Stacked on #493 for the directory and /api/mods endpoint. The frontend wiring that resolves modded art on the live and run pages (main then beta then mod) is a separate change.

The run and live pages fall back to modded art after main and beta by
fetching a mod repo's id-named images. tools/ingest_mod.py takes a mod
key from data/mods.json plus a source (a loose image folder or a Godot
.pck unpacked statically with GDRE), normalizes each per-type folder to
id-named webp, and stages it under extraction/mods/<key>/<type>/<id>.webp
ready for CDN upload.

It reads the per-type subpaths and source extension from data/mods.json
so the input matches the layout the frontend already expects, ignores
Godot .import sidecars, and lowercases ids to match the in-game id
convention. Verified on WatcherMod: 92 cards and 9 relics staged.
@ptrlrd

ptrlrd commented Jun 16, 2026

Copy link
Copy Markdown
Owner Author

Folded into #496, which delivers the whole modded-card feature (directory, ingest, parse, bake, backend serving, and frontend resolution) in one MR.

@ptrlrd ptrlrd closed this Jun 16, 2026
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