dungeon.dat: editable self-contained JSON for the web (#307) #390
Labels
No labels
area/ci-release
area/cli
area/docs
area/dungeon
area/ftl
area/graphics
area/gui
area/music
area/saves
area/tooling
port/amiga
port/dos
port/fm-towns
port/mac
port/pc98
port/sega-cd
priority/high
priority/low
priority/medium
type/bug
type/chore
type/docs
type/feature
type/research
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
Depends on
#307 Web-facing serialization scheme: graphics.dat write path
jqueuniet/dm2-tools
#392 dungeon.dat: decode the remaining residual bits
jqueuniet/dm2-tools
Reference
jqueuniet/dm2-tools#390
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Dungeon slice of #307.
Findings
Scheme: self-contained JSON fits.
dungeon.dathas no binary payloads; the lossless dump of a 39 KB retail file is 547 KB pretty-printed and ~270 KB compact. No sidecars needed.tile_block_seedis redundant. Over all 16 fixtures:map_data_size.CSerializedWriterWithChkSumwrites the same sum.The seed duplicates the bodies and freezes the trailer. Consequences:
BodyOutOfRange.Packed fields are opaque to clients.
Mapcarriesmap_size_word,flags_wordandnum_graphs_word; tiles and records are raw words. The web editor's dungeon browser therefore uses the lossydungeonSkprojectJsonand re-decodes tile bytes itself (byte >> 5). Editing has no path.Plan
tile_block_seed. Reconstruct writes the bodies atmap_offset, requires exact tiling, and recomputes the trailer. Parse exposes the stored checksum and whether it is valid.Open
Acceptance
parse -> JSON -> reconstructis byte-identical over every fixture. An edited dump reloads in-game.In-game (DOS EN, new game): a dungeon with a wrong checksum loads and plays; the edited one (rebuilt checksum) shows the edit. The engine ignores the trailer.
Schema v3 (decoded fields instead of packed words) is agreed. It waits on #392, which decodes the residual bits first.
In-game (DOS EN, new game): a dungeon edited only through the schema 3 JSON (
dm2 dump --format dungeon-lossless, a JSON edit,dm2 build) loads and shows both edits:data1 ↔ 3).Together with the byte-identical round-trip over every fixture, both acceptance criteria are met. Delivered in #398 (maps and tiles), #399 (records), #400 (actuators and creatures) and #401 (
dm2 build, binding tests).