Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Deviations

The code does something other than what the reference states. Basis values are defined in Spec deviations.

WRLD NAM0 and NAM9 bounds

Reference: UESP WRLD.

ReferenceCodeWhyBasis
NAM0/NAM9 are int32[2], “assumed from Oblivion”Read as float32[2]Tamriel gives (-233472, -176128) to (253952, 208896), whole cellsVanilla data

The spec itself flags the type as a guess carried over from Oblivion.

Tests: WorldspaceReaderTests.

CELL XCLW no water

Reference: UESP CELL.

ReferenceCodeWhyBasis
XCLW 0x7F7FFFFF and 0x4F7FFFC9 mean no water, 0xCF000000 mayThose three, NaN, and any height of 1e9 or more in magnitude mean no waterBlackreach also stores 0x4F7FFFFC (4.29e9, cell 0, 1) and 0xFF7FFFFF (-float.MaxValue); read as heights, the first floods a whole cellVanilla data

No vanilla terrain or water plane comes near 1e9 units, so the threshold only catches these markers.

Tests: CellReaderTests.

Grass water mode

Reference: UESP GRAS.

ReferenceCodeWhyBasis
DATA “How water distance is applied” numbered 1 to 8, from “Above - At Least” to “Either - At Most Below”The same list numbered 0 to 7 (GrassWaterMode)Every dry-land vanilla GRAS stores 0 with a distance of 0, which only reads as “Above - At Least” (above the water). The kelp, coral and underwater rocks store 2 with 105 to 390 units: “Below - At Least” under 0 to 7, “Above - At Most” under 1 to 8Vanilla data, and xEdit’s wbDefinitionsTES5.pas, whose enum starts at 0

The reference gives no unit for “Distance from water”. The code reads it in world units, see assumptions.

Tests: GrassReaderTests, GrassCoverTests.

Rule of One merge

Reference: How Skyrim Loads Forms. Design in Load order and merging.

ArticleCodeWhyBasis
An override clears the whole form, then reloads itFields merge one by one: a missing field keeps the earlier valueNo exemption list exists for the records read here; readers already tolerate partial recordsDesign
Papyrus data is cleared on every overrideHasScript is latest-winsFollows the articleArticle

The engine clears a form and reloads it from each override, so a field the override doesn’t carry becomes empty unless Bethesda’s code exempts it. The code can’t reproduce those exemptions without a list of them, so it keeps earlier values instead. The one field the article doesn’t cover is in XTEL across overrides.

Keying a REFR by its own FormId, independent of its cell, is not a deviation: the article lists CELL/REFR as independently overridden parent and child. LocationMerger.MergeRecords is the one merge every command uses, interiors included.

Tests: LocationMergerRuleOfOneTests, BookMergerFieldOverwriteTests, InteriorCellFinderRuleOfOneTests.

VMAD string encoding

Reference: UESP File Format Conventions, xEdit What’s New, 4.0.0.

ReferenceCodeWhyBasis
Every string is Windows-1252VMAD script names, property names and string values are UTF-8, invalid bytes become U+FFFDThe game expects UTF-8 thereTooling

xEdit states that VMAD strings are “always explicitly stored as UTF8” and that “any other codepage would result in errors” in every supported game. It gives no override, so the code has no fallback encoding either.

Tests: VmadReaderTests.