Skip to content

Decompile and parse warnings say where; light controller 144 is a note; drop lightmapped_tile - #104

Merged
plenarius merged 1 commit into
mainfrom
fix/tileset-scan-findings
Oct 20, 2026
Merged

plenarius merged 1 commit into
mainfrom
fix/tileset-scan-findings

Conversation

@plenarius

Copy link
Copy Markdown
Owner

Found while scanning the Layonara haks' 27,000 tile models (see layonara/nwn-haks#23).

  • NaN warnings: NaN/Inf floats in a binary are reported once per list of a node. The warning names the node and the list (verts, tangents, a controller, ...) and gives the count; before, there was one line per float with neither. One damaged tin01 tile went from 218 lines to 3.
  • ASCII list warnings name the node and the list as well as the line: line 130: node "Mesh248", verts: "2>4000001" is read as 2, ....
  • Light controller 144 (written by older EE compilers, nwn-mdl-spec E51) is dropped with an info note in the new Model.Notes / "notes" JSON field, not an unknown-controller warning. It made 2,019 lights in the haks look damaged. Notes are not counted as warnings, and the text output shows them only with --verbose.
  • Unknown-controller warnings give the byte offset of the controller key; before, the offset field held the controller type.
  • lightmapped_tile is removed. The byte it reads is uninitialised in the game's output, and the game reads no ASCII keyword for it (nwn-mdl-spec MDL-BIN-051).

Ported to python/ (decompiler and parser). DESIGN.md documents the warnings, parse_warnings and notes fields.

Testing:

  • go test ./... passes, plus three new tests in pkg/mdl/decompile_where_test.go.
  • parity_test.py, parity_parse.py and parity_compile.py pass.
  • Go and Python give identical warnings and notes on 1,247 binary tile models and fixtures.
  • Compiled output is unchanged: no compiler code was touched.

Follow-ups, not in this PR:

  • cleanmodels-qt does not show notes yet.
  • The writer still emits lightmapped N from the uninitialised byte.

…e; drop lightmapped_tile

Found scanning the Layonara haks' 27,000 tile models:

- NaN/Inf floats in a binary are reported once per list of a node, with the
  node, the list (verts, tangents, a controller...) and the count, instead of
  once per float with neither: one damaged tin01 tile gave 218 lines, now 3.
- ASCII list warnings name the node and the list as well as the line.
- Light controller 144 (older EE compilers, nwn-mdl-spec E51) is dropped with
  an info note in the new Model.Notes / "notes" JSON field, not an
  unknown-controller warning. It made 2,019 haks lights look damaged.
- Unknown-controller warnings give the key's byte offset, not its type.
- lightmapped_tile is removed: the binary byte is uninitialised in the game's
  output and no ASCII keyword is read (nwn-mdl-spec MDL-BIN-051).

Ported to python/ (decompiler and parser); parity tests pass, and Go and
Python give the same warnings and notes on 1,247 binary models.
@plenarius
plenarius merged commit 3235135 into main Oct 20, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant