maps v0.5.0 — schema-v3 + autotile + override + render-opt
Five sub-slices closed in-session 2026-05-28 against the design at
sporel-meta/docs/design/2026-05-28-autotile-blob-styles-design.md.
0.5.0a — schema-v3 + auto-upgrade
validate_map_table_v3 + build_map_v3 + serialize_map_v3 +
upgrade_v2_to_v3 (no-op shape transformation). load() chains
v1 -> v2 -> v3 transparent. All runtime `m.schema_version`-
comparisons switched from `== 2`/`~= 2` to `>= 2`/`< 2` so v3
inherits v2 behaviour for existing code paths. Per-layer optional
fields (material, vertices, overrides) accepted by validator,
preserved on round-trip serialize, ignored by renderer until
0.5.0c/d wire them in.
0.5.0b — multi-layer terrain rendering validated
Existing LAYER_ORDER_PRE/POST_ENTITIES loop already covered multi-
layer; sub-slice validated end-to-end against a v3 map with three
non-empty layers in vagrant-skeleton.
0.5.0c — vertex-painted autotile path
~150 LOC autotile section. rotate_bitmask_90cw + mirror_bitmask_h
+ apply_blob_gating helpers. SLOT_LOOKUP[bitmask] -> {slot, rot,
flip} precomputed at module-init via D4-orbit walk over 14
canonical patterns. cell_has_material (any-corner rule),
compute_cell_bitmask_v3 (8-neighbour bitmask + blob-gating),
atlas_slot_index (slot_NN_* tile-name parser, cached per atlas).
build_map_v3 exposes atlas_by_alias for O(1) layer.material ->
atlas lookup. draw_layer branches on layer.vertices+material:
autotile path computes bitmask, looks up slot, draws with rot+flip
via draw_sprite_transform. Legacy tiles[] path unchanged. cell_gid
returns sentinel 1 for vertex-painted material cells so
is_walkable / blocks_walk / blocks_sight stay transparent.
0.5.0d — sparse override sublayer
Override map keyed "x:y" -> slot_id (0..13). Override implies
cell-has-material (restores the 1-cell-isolated case the any-corner
rule cannot express). Renders canonical slot in default orientation
(no rot/flip), bypassing bitmask compute. Public APIs:
set_override / clear_override / get_override with validation
(v3-only, valid layer, in-bounds, integer 0..13). Internal helpers
require_v3_layer + check_coords.
0.5.0e — render optimisation
LAYER_Z + LAYER_ORDER_TOP_DOWN constants. m._layer_has_content
precomputed in build_map_v3 (per-layer scan: tiles[] non-zero OR
vertices painted OR overrides set); draw_map_pre/post_entities
skip empty layers cheaply. m._opaque_ceiling per-cell topmost-
opaque z-index, lazily built via ensure_opaque_ceiling. Opaque
heuristic (light): vertex-painted cell opaque iff bitmask resolves
to slot 13 OR override == slot 13. Legacy tiles[] reads
atlas.tile.opaque (currently always nil pending atlas-baker E2
alpha-analysis; safe-conservative default = not opaque). draw_layer
skips cells where ceiling > current layer z. Writes nil out
_opaque_ceiling for lazy rebuild.
manifest.lib bumped 0.4.0 -> 0.5.0. Consumer modules bumped in
their own commits (sporel-lib-core.render, sporel-module-vagrant-
skeleton, sporel-module-map-editor[-test]).
Closure-gate per sub-slice: milestone-check.sh build + ctest +
test-all-modules GREEN; SPOREL_CI=1 vagrant-skeleton smoke rc=0
with 60 render_frame_ok and no magenta-placeholders.
Detailed sub-slice closure logs live in
sporel-meta/docs/superpowers/plans/2026-05-28-map-schema-v3.md.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1 +1 @@
|
||||
{"id":"lib-core.maps","version":"0.4.0","api_min":"0.1"}
|
||||
{"id":"lib-core.maps","version":"0.5.0","api_min":"0.1"}
|
||||
|
||||
Reference in New Issue
Block a user