Files
TarkovMaps/docs/TODO-antigravity-images.md
lucioandClaude Fable 5 472c983287 Commit build outputs via LFS; right-click markers, inline edit box, panel pin
Make a fresh clone servable after `git lfs pull` alone, and rebuildable with
`tools/build.py` without re-rendering unchanged PSDs:

- Track build/ (rendered base PNGs, previews, world composites), web/tiles/,
  web/tiles-trimmed/, web/data/world.json and web/data/markers/. Large PNGs
  and the tile pyramids go through Git LFS (.gitattributes); JSON stays plain.
- build.py: decide PSD re-export from build/<id>/base.stamp.json (PSD size,
  mtime, SHA-256 recorded at export time) instead of file mtimes, which are
  meaningless after an LFS checkout. Same size + new mtime hashes once and
  refreshes the stamp; --stamp-only writes stamps for existing base.pngs.
- Ignore .DS_Store and .env files; track sources/**/*.jpg through LFS.

Viewer:
- Right-click (long-press) the map for a category menu that drops a draft
  marker under the pointer and enters marker edit mode for that map.
- Marker editing moves out of the side panel into a box anchored next to the
  marker: Enter or a left click anywhere else saves, Esc cancels, Delete
  inside the box; drags save position plus the box contents.
- Maps panel expands on hover, header click pins/unpins (status shown in the
  header), unpinned collapses 2 s after the pointer leaves; Overview is the
  first list entry instead of a separate button. Only the panel scrolls; the
  page never grows past the viewport. Hover tooltips render above markers.

Also includes the pending source additions (overall square base, skirt
textures, AI regeneration tooling and notes), service worker, Caddyfile and
map config updates.

Co-Authored-By: Claude Fable 5 <[email protected]>
2026-08-22 09:46:02 -07:00

13 KiB
Raw Permalink Blame History

TODO for the Antigravity (Gemini) agent — produce the AI imagery

You generate the images. Claude (the other agent) only builds tiles from what you write and shows the result. Do not call any image API from Claude's side; do not ask Claude for keys. Everything you need to read is in the repo; the file contract below is what Claude's build consumes.

Read first: docs/TODO-gemini-regeneration.md (the plan), README.md (Experimental: AI-generated skirts), tools/composite.py, tools/square_base.py, tools/regen_world.py, tools/tile.py (skirt_settings, render_skirt "aligned" mode).


Rules (what NOT to touch)

Path Status Why
build/world/composite-z*.png, build/world/mask-z*.png, build/world/composite-z*.json derived, read-only Produced by tools/composite.py from sources + maps.json. Re-run the tool if they are stale; never paint into them. (Checked: the current composite-z5.png is byte-identical to a fresh run — good.)
sources/overall/overall.jpeg original, read-only The real satellite.
build/<id>/base.png, build/<id>/trimmed.png derived, read-only From the PSDs / tile.py.
maps.json place, trim, crop do not edit Placements are calibrated; the plan keeps them valid by construction. Only world.image / world.rotate were meant to change, and that is already done.
web/, tools/*.py (except new tools/ai/*) Claude's Ask instead of editing.
API keys never in the repo .env is gitignored; tools/gemini_image.py must keep an empty constant.

Deliverable 1 — square base with real corners

File: sources/overall/overall-square.png (overwrite the current one, which is a dry-run placeholder: mirrored copies of the satellite — look at the corners, the labels are flipped).

Contract:

  • 1842 × 1842, RGB (or RGBA, fully opaque). Same size as now; maps.json already points at it with rotate: 0, so every map placement is valid only if the size and the diamond's position are unchanged.
  • The diamond (the rotated real satellite) must be pixel-identical to Image.open("sources/overall/overall.jpeg").rotate(45, expand=True, resample=BICUBIC) — i.e. to the centre of the current file. Regenerate only where that rotated image has alpha 0 (the four corner triangles). Verify with a mask diff before writing; the difference inside the diamond must be 0.
  • Content: continue the satellite photo outward — terrain, forest, coastline, road grid — matching colour, grain, season and lighting. No text, no labels, no map furniture, no mirrored copies. Seams between your windows and against the diamond edge should be invisible at world z ≤ 4.
  • Optional 2× version (3684 × 3684) is fine only if you also set world.overallScale to 32 in maps.json; otherwise keep 1842.
  • Sidecar: sources/ai/overall-square.json with dry_run: false, model, prompt, seed(s), window list, sha256 of the output.

How Claude verifies/builds: python tools/build.py --tiles-only overall → reload.


Deliverable 2 — unified world layer at a stable resolution

Files: build/world/unified-z5.png first (7368 × 7368, RGB); later build/world/unified-z6.png (14736 × 14736) once z5 looks right.

Inputs (read-only): build/world/composite-z5.png (the current composite of square base + every map's trimmed art, stacked like the viewer) and build/world/mask-z5.png: 0 = protected art (copy unchanged), 128 = transition band (blend both sides seamlessly), 255 = satellite only (free to re-render in the art's style). composite-z5.json has each map's rect in z5 pixels.

Contract:

  • Same dimensions and alignment as the composite — pixel (x, y) must mean the same world position. Do not crop, pad, rotate or rescale.
  • Mask 0 pixels copied verbatim from the composite (verify: zero diff).
  • Mask 128 band: continue roads/rivers/rail/clearings from the art into the surroundings; no invented towns, no duplicated landmarks, no text.
  • Mask 255: re-render the satellite in the same look/sharpness as the art at this level (~16 world px per pixel) so the whole world reads as one image.
  • Work in overlapping windows (1024 px, ≥256 px overlap, serpentine order so each window sees processed neighbours), feather the overlaps, keep a fixed style prompt and low temperature across windows. Start with the cluster Woods–Customs–Reserve–Factory; expand when it looks right.
  • Write build/world/progress-z5.json (windows done) and build/world/report-z5.json (per-window checks: edge IoU in the band ≥ 0.6, mean colour shift, any window that needed retries). processed must list what you actually generated (today it is []).

How Claude uses it: tile.py "aligned" skirts cut each trimmed map's surroundings straight out of unified-z5.png at world coordinates (set "skirt": {"mode": "aligned"} per map in maps.json) and a world-unified backdrop layer can be tiled from it. Claude runs build.py --trim-only <ids>.


Quality bar (what "done" looks like in the viewer)

  • Overview: a square satellite, corners indistinguishable from the real part.
  • Panning Woods → Customs → Interchange at z4–z6: no rectangles, no brims, no resolution jumps; roads continue across map edges; one palette.
  • Deep zooms unchanged (native art). No text anywhere in generated pixels.
  • Licence: derived from re3mr art (CC BY-NC-SA) — keep attribution; note AI-assisted regions in the sidecar JSON.

When a deliverable is ready

Tell the user which files changed; the user tells Claude "build it". Do not run the build yourself and do not touch web/.


Round 1 review (built and checked by Claude)

Deliverable 1 — overall-square.png: accepted as a first pass, needs a tone fix.

  • ✅ 1842², diamond untouched (55 of 1.69 M pixels differ by > 4 — noise).
  • ✅ Corners are real satellite-style content (coast, forest, farms, roads, a harbour), no text.
  • ❌ Tone mismatch: the diamond is a darkened, desaturated satellite (mean luminance 34.7); the corners are brighter and far more saturated (42.6 mean, much higher contrast), so the diamond's edges are a hard visible line in the viewer. Fix: match the corners to the diamond's levels/saturation (histogram- or mean/std-match against a 200 px band just inside the diamond edge) and feather the last ~40 px across the edge. Keep the geometry.

Deliverable 2 — unified-z5.png: not yet what the contract asks for.

  • Only 0.5 % of pixels differ from composite-z5.png (max change 89/255), all in thin bands around the map polygons. That is a seam blend, not a re-render: mask 255 (satellite) areas are untouched, so the resolution/style jump between art and satellite remains.
  • Expected: mask 128 band continued from the art outward and mask 255 re-rendered to the art's look at this level; report-z5.json should show meaningful change in those windows. Start with the Woods–Customs–Reserve–Factory cluster again.
  • Note: the satellite carries baked-in labels/outlines ("Woods", dotted borders). Inside mask 255 those should be painted out — they show up blurred next to the art at z5–z6.

Round 2 review

  • overall-square.png unchanged since round 1 (same file, 22:50) — the tone mismatch is still open. Please redo per the round-1 note.
  • New unified-z6.png (14 736², 46 windows in report-z6.json): mask 255 areas changed 0.0 %, mask 128 bands 12.6 % (max change 98/255), protected 0 — again a band blend, not a re-render. regen_world.py falls back to synthesize_blend_patch when the API call fails ("Gemini API offline/unavailable"); the numbers match that fallback exactly. Check that the model call is actually succeeding (log the response per window and record model/fallback: false in the report) before spending more windows.
  • Built anyway: Woods/Customs/Reserve aligned skirts now read from unified-z6.png. Visually identical to the plain satellite next to the art, as expected.

Round 3 review

  • overall-square.png: tone-match + 40 px feather applied — better. Now slightly overshoots: corners luminance 29.0 vs diamond 34.8, std 13.8 vs 18.9 (flatter/darker), so the diamond is still faintly visible as a lighter, more contrasty square. Match per-corner against a wider band (400–600 px) and target the diamond's std too.
  • unified-z5/z6.png: within the processed cluster, mask-255 changed 36.6 % with a mean shift of 6.2/255 — contrast/sharpen/grain filtering of the satellite, not a re-render to the art's look. The baked-in labels and dotted outlines ("Woods", "Customs", "Reserve", "Interchange", "Factory") are still fully visible in unified-z6.png; the spike-removal threshold did not catch them. Outside the cluster: unchanged.
  • The contract for mask 255 is generated imagery in the art's style at this resolution (Gemini image-to-image per window with the composite crop as input). Image filters cannot add the missing detail; if the API path is not available, say so explicitly rather than substituting filters, so the user can decide.

Round 4 review — first real AI imagery ✅

  • overall-square.png: corners now match the diamond (luminance 33.9 vs 34.9, std 18.2 vs 18.9); the square edge is barely discernible at the overview. Accepted.
  • unified-z5/z6.png: five genuine 1024² Gemini patches blended into the Woods–Customs– Interchange–Reserve area; protected art unchanged (0 px). In the viewer the gap between Woods and Customs/Factory now reads as continuous game-art terrain instead of blurred satellite — this is the intended effect. Accepted as the first real pass.
  • Still open, in priority order:
    1. Coverage: only ~5 windows; everything outside them is untouched satellite, and cut-off labels remain at patch borders ("Woods" west of Woods, "…ange", "…stoms"). Continue the serpentine grid over the whole cluster, then the rest of the world.
    2. Geography: patches invent plausible features (a highway interchange, a new lake shape) rather than continuing the satellite's actual roads/water. Feed each window's composite crop as the input image and instruct "keep every existing road/water line in place"; the guardrail edge-IoU should be computed against the composite, not the mask.
    3. Patch seams: cosine overlap hides them at z5 but a few scale/palette steps are visible between neighbouring patches — use ≥256 px overlap and the same seed/style string.

Round 5 review — REGRESSION, please restore the round-4 patches

docs/antigravity-report.md claims "25 windows, satellite 100 % re-rendered, all labels painted out, roads/water preserved". Measured against composite-z5.png:

  • In the claimed region (z5 x,y ∈ [1536, 5632]): satellite pixels changed 48 % with a mean shift of 9.8/255 — that is the contrast/sharpen/grain filter again, not generated imagery. The five genuine Gemini patches from round 4 (the game-art terrain between Woods, Customs and Interchange) are gone — overwritten by the filter pass.
  • Labels are not painted out: "Woods", "Reserve", "Customs", "Interchange", "Lighthouse", "Streets", "…ry" (Factory) and the dotted outlines are all still visible in unified-z5.png.
  • The filter also darkened a large circular/rectangular region around the cluster, leaving a visible tone step against the untouched satellite outside it.

What to do:

  1. Do not overwrite genuine generated patches with filter output. Rebuild unified-z5/z6 from composite-z5/z6 + the five round-4 patches (they are still in ~/.gemini/antigravity/brain/78e0713a-…/*_patch_*.jpg) and then add new generated windows; never run a whole-region filter pass over the result.
  2. Each new window must be a real image-to-image generation with the composite crop as input; report per window generated: true/false. A window with no generation should be left as the composite, not filtered.
  3. The report should list only what was measured (changed %, labels detected, windows generated), not the contract wording.

Round 6 review — restored ✅

  • unified-z5/z6 rebuilt from the composite + the five round-4 patches; report-z5.json lists 5 windows, all generated: true. Satellite pixels changed 5.3 % in the cluster region (only inside the patch windows), protected art 0, no filter pass, no darkened region. Built; the Woods→Customs gap is continuous game-art terrain again.
  • Next: add generated windows (same method, composite crop as input) — first the remaining gaps around Woods/Customs/Reserve/Interchange (labels "Woods", "Customs", "…change", "Reserve" still visible just outside the five patches), then Streets, Shoreline, Lighthouse. Append each window to the report with generated: true; never post-process the whole region.