18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-03 12:25:27 +01:00
Commit Graph

1 Commits

Author SHA1 Message Date
maj00r 93399bd4a1 feat(world): the cache file of the new world format
Step 2a of docs/world-format-eu07.md (#516, section 7): the container of the cache, one file per package and
layer. A header (magic and type as EU07_FILEHEADER, the versions, the body, package, layer, tile level, count
of levels of detail, and the engine and source hashes), a table of sections, the name table, a directory of
40-byte entries sorted by tile id and level of detail, and the tile blocks at multiples of 4 KB, packed with
zstd in frames of 64 KB and checked by a CRC-32. A block unpacks to tagged chunks; a reader skips what it
doesn't know, a section of a newer minor version included. Everything is little-endian and read field by
field. The writer gives the same bytes for the same contents. Nothing in the game uses it yet.

Tests: the CRC against zlib's value, a file written and read back (header, names, directory, every block),
a large block in frames, the same bytes twice, what the writer refuses, and broken files: another type or
major version, cut short, a block not matching its CRC; a newer minor version still opens.
2026-12-02 21:45:41 +01:00