archive/vswap (Wolfenstein 3D pages: walls, sprites and sounds through a palette passed in) and vector/gamemaps (GAMEMAPS + MAPHEAD, Carmack + RLEW, into a TileMap); test data from the fixture's own writers

This commit is contained in:
4DBug committed 2026-11-01 18:50:33 -06:00
1 parent 719abb97c0
commit e51fd3585e
15 files changed
+3139 -1085

No files matched your search

+20 -1
View File
@@ -194,14 +194,33 @@ local back = assert(F.load(tmx))
assert(back.layers[1].data[6] == 0x80000009)
```
## Wolfenstein 3D maps
Wolfenstein 3D / Spear of Destiny maps are two files: `GAMEMAPS.WL6` (the Carmack + RLEW compressed planes) and
`MAPHEAD.WL6` (the RLEW tag and where each map starts). Load either one: the other comes through `files` /
`resolve` (loading a path finds it next to the file) or `mapHead` / `gameMaps`. A map loads as a TileMap with one
tile layer per plane (`walls`, `objects`, `plane3`) holding the raw tile values (1..63 walls, 90..101 doors, 106+
floor areas; things in `objects`), without a tileset; `map` picks the slot (default: the first present) and
`F.format("gamemaps").maps` lists them.
```luau
local files = { ["MAPHEAD.WL6"] = mapheadBytes }
local level = assert(F.load(gamemapsBytes, { name = "GAMEMAPS.WL6", files = files }))
assert(level.kind == "tilemap" and level.width == 16 and level.properties.name == "Tiny map")
assert(level.layers[1].name == "walls" and level.layers[1].data[1] == 1) -- the border wall
local maps = assert(F.format("gamemaps").maps(F.Bytes.reader(mapheadBytes), { gameMaps = gamemapsBytes }))
assert(#maps == 1 and maps[1].slot == 1)
```
## Formats
| Format | Read | Write | Notes |
|---|---|---|---|
| TMX / TSX | yes | yes | CSV, base64 (raw, zlib, gzip) and `<tile>` data; zstd data returns `UNSUPPORTED` |
| TMJ / TSJ | yes | yes | |
| Wolfenstein 3D GAMEMAPS + MAPHEAD | yes | | the `gamemaps` format: raw tile values, no tileset |
Both are the `tiled` format in [FORMATS.md](../FORMATS.md). Wang sets and terrains are dropped.
TMX and TMJ are the `tiled` format in [FORMATS.md](../FORMATS.md). Wang sets and terrains are dropped.
## Gotchas