build engine: docs/guide sections (ART tiles, Build maps) with inputs from tools/fixtures/docs_build.py, bench lines, type fixes; bundles rebuilt

This commit is contained in:
4DBug committed 2026-11-01 18:46:54 -06:00
1 parent aacc78fac2
commit 082ea2019e
10 files changed
+3575 -1085

No files matched your search

+24
View File
@@ -507,6 +507,29 @@ local again = assert(F.save(barney, nil, { format = "smd" })) -- SMD writes ba
assert(F.model.load(again).skins[1])
```
## Build engine maps
Duke Nukem 3D / Shadow Warrior `.map` files (versions 7-9; the text Quake `.map` is a different format, told apart by
content) load as one mesh: floors and ceilings triangulated with their slopes, walls with upper and lower parts at red
walls (and masked walls), a primitive per surface kind and tile (`extras.build = { kind, tile }`); materials and
textures are named `tile<n>`. Sprites become nodes under the map with their tile in `extras.build.tile` (the raw
sprite in `extras.build.sprite`), and the player start is the node `start`. Coordinates turn z up (Build's y and z
point down), z is divided by 16 so all axes share Build's xy unit, and `scale` multiplies everything. `tiles` (tile
number to Image, e.g. from an ART file) gives the texture sizes for the UVs and attaches the images.
The raw sector, wall and sprite tables stay in `meta.build`, and saving writes them back:
```luau
local map = assert(F.model.load(buildmapBytes, { scale = 1 / 512 }))
local level = map.meta.build
assert(level.version == 7 and #level.sectors == 3)
assert(map.nodes[2].name == "start" and map.nodes[3].extras.build.tile == level.sprites[1].picnum)
local again = assert(F.save(map, nil, { format = "buildmap" }))
assert(buffer.tostring(again) == buffer.tostring(buildmapBytes))
local Build = F.format("buildmap") -- the floor height under a point, slopes included
assert(Build.slopeZ(level, 0, true, 100, 100) == level.sectors[1].floorz)
```
## Blitz3D (B3D)
`.b3d` files (Blitz3D, also written by many old game tools) load read-only. The node tree keeps its names and TRS;
@@ -745,6 +768,7 @@ assert(back.meshes[1].primitives[1].indices.count == 3)
| X3D (XML / classic) | yes | yes | the VRML reader plus the X3D triangle / quad / line sets; no binary `.x3db` |
| STEP | via the CAD plug-in | | see [cad.md](cad.md) |
| MD2, MD3, MDL, MD5, BSP | yes | - | game models and maps: see "Game models" above |
| Build engine MAP (v7-9) | yes | yes | sloped sectors, walls, sprites as nodes, raw tables in `meta.build`; see "Build engine maps" above |
| SMD | yes | yes | Valve studiomdl data |
| Roblox `.mesh` (robloxmesh) | yes | yes | see [roblox.md](roblox.md) |
| Roblox `.rbxm` / `.rbxl`, `.rbxmx` / `.rbxlx` | as an `RbxTree` | yes | instance trees with typed properties: see [roblox.md](roblox.md) |