mesh import fit ignores far-off stray pieces (with hint), project load warnings with readable names, edit projects of imported levelbuild wads load again (header runs applied to original values), -0.0 kept in saved arrays; start cameras checked in game on the test world and a village 2 base

This commit is contained in:
MineTec committed 2026-11-07 15:01:46 +01:00
1 parent ec3c619120
commit d56f3c604f
14 files changed
+215 -20

No files matched your search

+6 -2
View File
@@ -55,10 +55,14 @@ deterministic; brushes use the stored `seed`).
Node kinds, ids and properties: `notes/editor-api.md` (every persistent, settable `Prop`).
Values by `PropType`: numbers (INT/FIXED/ANGLE/FLAGS/COLOR as integers, DOUBLE), booleans,
strings, REF = node id (or `null`). Arrays: up to 64 elements as JSON lists, longer ones as
`{"i32": base64}` (int32 LE), `{"f64": base64}` (float64 LE) or `{"bytes": base64}`. A *changed*
`{"i32": base64}` (int32 LE), `{"f64": base64}` (float64 LE) or `{"bytes": base64}`; a short double
array containing -0.0 is written as `f64` too (JSON numbers drop the sign; since 2026-11-07). A *changed*
array of unchanged length is stored as runs of the changed elements only:
`{"runs": [[start, values], …]}` (values encoded as above) – e.g. editing a few vertices or
pixels of an original page stores just those values.
pixels of an original page stores just those values. Runs apply to the reference value read before any
property of the node is set (setting a model's vertices clears its header; until 2026-11-07 header runs
after a vertex change failed with "project file is damaged: NullPointerException", e.g. on
`llamamod --editor-import` of a levelbuild WAD).
Loading: reference scene → removals → create all added nodes (all kinds, so references across
kinds resolve) → set values of added/changed nodes and settings → apply `order`. Problems
+4 -1
View File
@@ -91,7 +91,10 @@ Invisible collision volumes (Invisible wall/block, colliders) are drawn transluc
### Mesh import (File → Import mesh)
File chooser, then a dialog: rotatable preview (mouse wheel zooms; framed on the main mass –
`Preview.focusBounds`: per axis the vertices within 2.5 IQR of the middle half (Tukey fences), the full
bounds unless they are over 1.5× larger; `geo_import_focus.jpg`: house with a triangle 400 cells away, `geo_import_zoomed_out.jpg`) (shown as in game; flat shading with a small z-buffer at
bounds unless they are over 1.5× larger; since 2026-11-07 also minus the smaller vertex group beyond a gap
wider than half the extent and twice the kept side, holding under half the other side's vertices – a stray triangle on a
low-poly box is 3 of 11 vertices and passes the fences; **Fit** uses the same bounds, and a hint under
"Largest side" names the main part's size when pieces are ignored, `geo_import_fit_stray.jpg`; `geo_import_focus.jpg`: house with a triangle 400 cells away, `geo_import_zoomed_out.jpg`) (shown as in game; flat shading with a small z-buffer at
twice the panel size, `PreviewRaster` – before 2026-11-07 the triangles were sorted by centroid and hidden
faces showed as slivers) with a 1-cell grid and a llama-sized marker, source
info, up axis, unit scale and "fit largest side to n cells", turn, mirror, stand on the ground,
Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

+3 -1
View File
@@ -138,7 +138,9 @@ stairs, platforms register as shadow casters (`solids`). 1.0 = texture colour
rest on the llama): on village 2 bases (node 2 has unk2 ≠ 0) that put the camera into the llama's
head. Waypoint lists take an optional 5th value unk2: `[(x,z,y,deg,unk2)]`.
In game (test world, apptest 2026-11-07): the start camera is behind the llama at the default
distance (`notes/img/editor/testworld_start_camera.jpg`).
distance (`notes/img/editor/testworld_start_camera.jpg`). Village 2 base (levelbuild floor + player on
t1l1m002, `--editor-import` as an edit project, boot-to-level 1/2): camera behind the llama, not in its
head (`notes/img/editor/village2_levelbuild_start_camera.jpg`).
* **LevelDoor** (exit) – solved, see section "Exit (LevelDoor)" below.
* Sizes that work: TRAK 0.6–1.0 MB, up to 1100 models, 5200 tiles, WAD up to 6.9 MB
(originals: TRAK ≤ 1 MB, ≤ 5800 tiles, WAD ≤ 6.85 MB). Test world: 628 models,
+3 -1
View File
@@ -24,7 +24,9 @@ The editor's play-test (`PlaytestRunner.install`) should write the bound form
**Start camera along** (`StartOverride.apply`): the llama's chain moves and turns with the start when it
is a levelbuild/editor start camera – one node within 2.5 cells (`PlayerStart`, levelbuild since
2026-11-07) or the older "node 8 behind + nodes on the llama" chain; original chains stay. Test:
`BootToLevelModTest.singleCameraNodeMovesWithTheStart`.
`BootToLevelModTest.singleCameraNodeMovesWithTheStart`. In game (apptest 2026-11-07, test world,
`start=21, 0.1, 15, 90`, i.e. moved and turned from the plaza start 18/14.6 yaw 0): camera behind the llama,
facing the stairs (`img/editor/bootstart_testworld_camera.jpg`).
Patches: `jmp` at 0x549C50 (main-menu frame handler) → once: read slots (FUN_0041c0e0), load
slot (FUN_0041cc70), set tribe/world/chapter/map 0x584EB4…, music shutdown, state 0x5846E4 = 3,