feat(world): chunked binary world-map format, store + legacy importer (PR 2 of #229) #231
No reviewers
Labels
No labels
alpha:wave-0
alpha:wave-1
alpha:wave-2
alpha:wave-3
area:assets
area:combat
area:ecology
area:infra
area:render
area:scripting
area:ui
area:world
enhancement
epic
migration
post-alpha
roadmap
tech-debt
type:bug
type:chore
type:design
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
marco/IsoMmo!231
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/world-map-chunked-format"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Second slice of the world-map migration (epic #229) — the chunked binary format, the foundation everything else stacks on. On the agreed format-first path, this replaces the dense-
string[,]/ whole-file model (whose wall PR #230 measured) with a chunk-addressable format sized for the 133,226,496-cell target.It is purely additive: new types in
IsoMmo.Shared.World.Chunked+ tests. Nothing at runtime reads it yet (editor/client/server wiring is Fase 3/7), so there is no behavior change.What it adds:
IReadOnlyWorldMapandWorldMapStore.Open— opens a world by reading only the manifest and discovering which region files exist; cell/chunk reads are random-access (one chunk's bytes, CRC-verified, bounded decode cache), never the whole map.'S'-overwrites-terrain bug: a draft ocean can have a spawn whose cell is water, and it survives a round-trip.LegacyMapImporter— one-wayTileMap(viaTextMapFormat) -> chunked store, preserving the spawn as metadata and skipping uniform default chunks (so an all-water world writes zero region files).docs/world-map-format.md(model + why; references the code for the exact layout).Headline:
WorldMapStoreopens the full 13,344x9,984 = 133,226,496-cell world as an empty ocean by reading only the manifest — zero region files, no per-cell allocation (a test asserts exactly this).Stacked on #230. The diff currently includes #230's benchmark commit; once #230 merges I will rebase this onto
mainso it shows only the format commit.Screenshots / recording
N/A — no visible surface (a storage format + tests; nothing rendered yet).
How it was tested
tests/IsoMmo.Shared.Tests/Chunked): CRC32 against the canonical123456789 -> 0xCBF43926vector + bit-flip detection; catalog-hash determinism/order-sensitivity; chunk payload round-trip (terrain + elevation + stacked statics) and constructor validation; manifest round-trip (with/without spawn) + CRC-corruption + bad-magic detection; store opening the 133M ocean with zero region files; spawn-as-metadata over a water cell; corrupt region/manifest detected on read/open; importer round-trip of every cell's terrain/elevation/statics + spawn preserved over its real terrain + import report.dotnet testfully green (Shared 146, incl. the 24 new);just lint(CSharpier + analyzers) clean;python scripts/check-doc-refs.pygreen.DoD delta (beyond the base DoD + epic #229)
'S'bug is fixed at the format level).TextMapFormatuntouched, kept as the legacy adapter).Checklist
just lintpasses (CSharpier + analyzers, zero warnings)just testis greenb310dcc9d23b1dced6f3