feat(api): PNG→engine graphics index + map palette extensions (#6) - #359
Open
Aduersarius wants to merge 1 commit into
Open
feat(api): PNG→engine graphics index + map palette extensions (#6)#359Aduersarius wants to merge 1 commit into
Aduersarius wants to merge 1 commit into
Conversation
…ttes (Bitcoindefi#6) Bridge construction-mode PNGs into the shared grhIndex space with catalog validation against graficos.json (not a hardcoded ceiling), expose a graficos-shaped uploaded index, and let admins add palette entries (layers + blocked) via Postgres overrides merged into terrain reads.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves #6 — bridge uploaded PNGs into the engine
grhIndexspace and let admins add reusable palette entries (layers +blocked) without rewritingterrain.json.What landed
docs/uploaded-graphics-range.md):UPLOADED_GRAPHIC_INDEX_START = 1_000_000shared across API, schema CHECK, and clientgameLoader.graphicCatalog.ts): originals must exist in realgraficos(_optimized).json; uploaded IDs must exist ingame_uploaded_graphics. No hardcoded “max engine id” loophole.GET /game-data/graphics/index: graficos.json-shaped index for uploaded assets (complements existing metadata list + clientmergeUploadedGraphics).PUT/DELETE /admin/game-data/maps/:mapNum/palette→game_map_palette_overrides(JSONB layers preserve nulls). Merged intoGET .../terrain.paintTiles: validates every referenced grh against the same catalog.npx tsx --test src/tests/graphicCatalogPalette.test.ts→ 5/5.Differentiation vs open PRs
50000–99999(collides with optimized catalog max >52k); invents parallelservices/treeThis PR stays on the existing
worldBuilder/ construction-mode path from #33, adds only what #6 asks for, and validates against the real engine catalog.Test plan
cd api && npx tsx --test src/tests/graphicCatalogPalette.test.ts(5/5)api/schema.sql(newgame_map_palette_overrides)grhIndex >= 1_000_000and appears inGET /game-data/graphics+/graphics/indexPUT /admin/game-data/maps/1/palettewith{ "graphics": [<uploaded>, null], "blocked": true }→ entry appears inGET .../terrainDELETE .../palette/:idremoves override only (terrain.json untouched)