Commit Graph
12 Commits
Author SHA1 Message Date
lucio 234dc32c86 Add editable export workflow and new map sources 2026-08-09 17:04:36 -07:00
lucio b079009d74 Fix Interchange export and extract styling 2026-08-09 01:24:21 -07:00
lucio 7c9e0ba5e1 Refine map controls and fix Dorms export 2026-08-08 23:09:55 -07:00
lucio bbb4cadddd Add per-map editable markers and backups 2026-08-08 22:03:49 -07:00
lucio e71447da5d Add permanent trims and semantic map layers 2026-08-08 18:47:56 -07:00
lucio 3abdc95500 Add interactive map placement and sizing editor 2026-08-08 16:40:09 -07:00
Claude f49a00bc98 Version tile URLs so rebuilt maps cannot serve a previous build
Tile paths are stable across rebuilds but their contents are not: moving a
map's `place` makes tiles/<id>/6/17/33.webp different imagery at the same
URL. Combined with the immutable week-long cache added earlier, a browser
that had seen an older build blended the two and drew duplicated, offset
terrain -- visible as a second copy of Lighthouse.

Each map now carries a `version` in world.json, hashed from its geometry,
zoom range and source file stamp, and appended to every tile URL as ?v=.
Re-tiled maps get fresh URLs; identical rebuilds keep the same version so
nothing is re-fetched needlessly.

Also corrects the runbook's base-layer table, which still listed the
pre-correction layers for Woods, Reserve, Interchange and Streets.

Verified: 733 tiles across seven map views, all carrying ?v=, zero broken,
and the focused map topmost in every case.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-08-08 14:59:41 -07:00
Claude e656c7c96a Lift the focused map above overlapping neighbours; tilt to 35 degrees
Placements are approximate, so map rectangles overlap where the real
locations do not -- Reserve clips Customs, Lighthouse clipped Shoreline.
Sampling the rendered tiles showed the stacking was technically fine
(finer map always on top) but that did not help: an overlapping neighbour
still covered the map you had navigated to.

Stacking is now explicit. Baseline order is by maxNativeZoom then footprint
so the finer map wins, and whichever map the view is centred on is lifted
above everything else. Verified for Shoreline, Lighthouse, Customs, Reserve
and Woods: each becomes topmost when centred.

Tilt raised 31 -> 35 degrees. The original 31 came from fitting the Customs
zone outline's aspect ratio, but that polygon encloses more than the
playable strip so the estimate ran low; attempts to register the two
polygons directly failed because the dashed outline will not flood-fill.
35 aligns better by eye.

`place` lives in the rotated frame, so retilt.py converts every placement
through the old and new angles -- changing the tilt no longer scatters the
maps. Lighthouse's box also tightened; its PSD is nearly square while the
zone is a coastal strip, so it overhung into the sea.

Verified zoom 0-9: 620 tiles, zero broken.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-08-08 11:37:15 -07:00
Claude e8d8738892 Place all nine maps onto a north-up geographic world canvas
The canvas is no longer an abstract grid of unrelated cells. overall.jpeg is
now the base, rotated 31 degrees so north is up, and every detail map is
scaled and positioned onto its real location. Zoom out for all of Tarkov;
zoom in and the full-resolution re3mr map takes over.

The 31 degrees was measured, not guessed: Customs' detail map is north-up
(its PSD compass confirms it) and runs 2.6:1 east-west, so solving its
259x207 zone outline for the band angle gives 31. rotate_point is verified
sub-pixel against PIL.

Adds Woods, Interchange, Reserve, Shoreline, Shoreline Resort, Lighthouse
and Streets, and moves every source under sources/<id>/.

baseGroup becomes baseLayers, a list of slash-paths. These PSDs share no
naming convention at all -- the base is variously LOCATION, Baselayer, Day,
3DRENDER, BASEMAP+2DLAYERS or Map&Art; several need more than one top-level
layer, and Woods buries its terrain three groups deep. Exports also keep
alpha now, so maps composite onto the terrain instead of sitting in opaque
rectangles.

Placement needs sub-cell precision, but tile grids stay integral only when
a map's origin is a multiple of tileSize * 2^maxZoom (131072 px). So rather
than snapping a map to the grid, the tiler pads it up-and-left to the
nearest cell boundary and visits only tiles holding content: exact
placement, integral grid, no cost. Each map is tiled to its native level
and carries a minZoom, so the overview stays cheap.

Two psd-tools failures worked around: stroke effects on empty-bbox layers
crash scikit-image (patched to skip), and psd_tools.composite exports a
function that shadows its own submodule.

Verified zoom 0-9: 10 layers, zero broken tiles.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-08-08 04:02:38 -07:00
Claude f997c2c5e2 Render from a denser pyramid level to fix soft tiles
Leaflet chooses its tile level with Math.round(mapZoom), so the default
fit view at zoom 2.25 took level 2 and stretched it 1.19x. With a
devicePixelRatio of 1.5 that compounded to a 1.78x upscale of every
source pixel.

DENSITY_BOOST halves a tile's CSS size and adds a matching zoomOffset, so
Leaflet downscales a denser level instead of upscaling a coarser one. The
per-cell tile offset is now derived from baseTileSize rather than
assuming 2**z, so the world-grid translation stays exact under the boost.

Source pixels per device pixel at DPR 1.5, higher being sharper:

  view zoom 0-4   0.56 -> 1.33
  view zoom 5     0.67 (unchanged; this is the 1:1 source level)

Costs ~4x the tiles in view, ~17 KB each, cached for a week.

z5 is a genuine ceiling: the embedded terrain smart object is a PSB of
exactly 7832x3720 placed 1:1, so no further source detail exists.

Verified zoom 0-7: zero broken tiles.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-08-08 02:36:17 -07:00
Claude 825a58c639 Draw a coarse underlay beneath detail tiles to kill loading gaps
Each map now renders twice. The lower layer pins minNativeZoom and
maxNativeZoom to underlayZoom (2), so Leaflet serves that single level at
every view zoom, scaled to fit. The entire world at z2 is 17 tiles /
134 KB, so it paints in ~120ms and stays resident behind a generous
keepBuffer.

Detail tiles draw over it at zIndex 2, so any gap while they load shows
blurry map instead of the page background.

Verified zoom 0-7: zero broken tiles, no console errors.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-08-08 01:07:38 -07:00
Claude 5afde00ab7 Base-map tile pipeline and shared-canvas Leaflet viewer
Extracts only the base map art from re3mr PSDs (the top-level LOCATION
group), tiles it to WebP, and renders every map on one shared world canvas.

Pipeline: psd_tree -> export_base -> tile -> build -> preview, driven
entirely by maps.json. Adding a map is a config change.

Maps are placed on an 8192px grid (tileSize * 2^maxZoom) so a cell's tile
index shift is exactly cell * 2^z at every zoom. Each map keeps its own
locally numbered pyramid and the browser translates on the fly, so adding
a map never re-tiles the others.

excludeLayers works around psd-tools rendering stroke-only vector shapes
as solid fills, which otherwise buries Customs under a white fill.

Co-Authored-By: Claude Opus 5 <[email protected]>
2026-08-07 23:22:21 -07:00