Materials: weapon models, tiles, parameter names #110

Manually merged
github merged 5 commits from gh-pr/110/head into gh-pr/110/base 2026-11-26 20:10:35 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-24 03:29 UTC · original
holdmysocks:claude/weapon-presets → master · +197 −43 · 4 files · 5 commits · merged 2026-11-24 03:44 UTC

Follow-up to #107.

What this adds

  • Weapon models to presets. A weapon component record's 873ef899 is the joaat of the component's model name, so the index now maps weapon models to presets (weapon_models); Index::weapon_presets(name) looks one up (LOD suffix ignored). sixng materials --weapon <regex> lists matching models with their presets and the 8 sub-material colours. Variant records now keep the part they recolour (c763edb4) beside the preset.
  • Tiles. The third map of the library (951cf6e3 -> 83021d7a) is decoded: a tile holds the tiling surface textures tilematerialmap and tilenormalmap. A base material names its tile (TileName), a preset can override it per sub-material (TileNameOverrides). Library::tile and the index (tiles) give per preset and sub-material: tile, both textures, tilescale, tilerotation. The fourth map (transmission profiles) is read but not interpreted.
  • Names. 68 of the 99 parameter names (lower-case joaat) and 13 field names of the library and wardrobe (PascalCase) go into names.rs; --preset output shows parameter names where known.
  • Index version 3 (an older index is ignored until sixng materials is run again).
  • README: the row is updated, and the usage line added in #107 is fixed (it had been written with a tab and a carriage return in place of \t and \r).

What was checked

  • Game data: 894 weapon models with a preset, 863 of them match a drawable name in data.rpf; 57 models have two presets (two component records). w_ar_adb_01 is 1f1f1f on all sub-materials; its barrel mixes six colours.
  • Tiles: all 125,640 sub-materials (15,705 presets x 8) resolve a tile, 125,632 with a material map. All 7,994 clothing base materials name an existing tile.
  • Names: the 31 two-word parameter names form consistent families (tile*, tintmask*, engraving*, dirt*, sheen*) and fit the values (tilescale 100 to 340, tilerotation in radians). The three-word names kept are those in a family (tintmask..., tintablepattern..., ...blendamount); single three-word hits outside a family were dropped as likely chance matches, except tilepresetflags.
  • cargo test -p sixng-core: 148 passed (the matlib tests now also cover tiles and the weapon model lookup; the names test covers seven of the new hashes).
  • ped-variations still fills preset_colours (1,277 entries on the lead character's wardrobe resource).

What is not decoded or not done

  • 31 parameter names, and the field name of the preset map (fd540657), of the sub-material field (aadeb53e) and of the two weapon preset fields.
  • Defaults of parameters a record leaves out: the game loads them from a separate file (not found in the indexed archives so far).
  • How the tint-mask, pattern, stitch, dirt and sheen layers are composed over the base colour.
  • The per-part byte that blends colour entry 0 towards entry 1. It is not Tint0..2: over 4,607 tagged items the colour tag fits entry 0 (mean RGB distance 71) better than entry 1 (109) in every tint group.
  • The export does not apply any of this; the 34 component records whose model hash matches no drawable name stay unnamed.
  • The GUI crate was not built locally.
**@⁠holdmysocks** on GitHub · 2026-11-24 03:29 UTC · [original](https://github.com/holdmysocks/SixNG/pull/110) `holdmysocks:claude/weapon-presets` → `master` · +197 −43 · 4 files · 5 commits · merged 2026-11-24 03:44 UTC Follow-up to #107. ## What this adds - **Weapon models to presets.** A weapon component record's `873ef899` is the joaat of the component's model name, so the index now maps weapon models to presets (`weapon_models`); `Index::weapon_presets(name)` looks one up (LOD suffix ignored). `sixng materials --weapon <regex>` lists matching models with their presets and the 8 sub-material colours. Variant records now keep the part they recolour (`c763edb4`) beside the preset. - **Tiles.** The third map of the library (`951cf6e3` -> `83021d7a`) is decoded: a tile holds the tiling surface textures `tilematerialmap` and `tilenormalmap`. A base material names its tile (`TileName`), a preset can override it per sub-material (`TileNameOverrides`). `Library::tile` and the index (`tiles`) give per preset and sub-material: tile, both textures, `tilescale`, `tilerotation`. The fourth map (transmission profiles) is read but not interpreted. - **Names.** 68 of the 99 parameter names (lower-case joaat) and 13 field names of the library and wardrobe (PascalCase) go into `names.rs`; `--preset` output shows parameter names where known. - Index version 3 (an older index is ignored until `sixng materials` is run again). - README: the row is updated, and the usage line added in #107 is fixed (it had been written with a tab and a carriage return in place of `\t` and `\r`). ## What was checked - Game data: 894 weapon models with a preset, 863 of them match a drawable name in data.rpf; 57 models have two presets (two component records). `w_ar_adb_01` is 1f1f1f on all sub-materials; its barrel mixes six colours. - Tiles: all 125,640 sub-materials (15,705 presets x 8) resolve a tile, 125,632 with a material map. All 7,994 clothing base materials name an existing tile. - Names: the 31 two-word parameter names form consistent families (`tile*`, `tintmask*`, `engraving*`, `dirt*`, `sheen*`) and fit the values (`tilescale` 100 to 340, `tilerotation` in radians). The three-word names kept are those in a family (`tintmask...`, `tintablepattern...`, `...blendamount`); single three-word hits outside a family were dropped as likely chance matches, except `tilepresetflags`. - `cargo test -p sixng-core`: 148 passed (the matlib tests now also cover tiles and the weapon model lookup; the names test covers seven of the new hashes). - `ped-variations` still fills `preset_colours` (1,277 entries on the lead character's wardrobe resource). ## What is not decoded or not done - 31 parameter names, and the field name of the preset map (`fd540657`), of the sub-material field (`aadeb53e`) and of the two weapon preset fields. - Defaults of parameters a record leaves out: the game loads them from a separate file (not found in the indexed archives so far). - How the tint-mask, pattern, stitch, dirt and sheen layers are composed over the base colour. - The per-part byte that blends colour entry 0 towards entry 1. It is not `Tint0..2`: over 4,607 tagged items the colour tag fits entry 0 (mean RGB distance 71) better than entry 1 (109) in every tint group. - The export does not apply any of this; the 34 component records whose model hash matches no drawable name stay unnamed. - The GUI crate was not built locally.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:10:33 +00:00
github manually merged commit c35332036c into gh-pr/110/base 2026-11-26 20:10:35 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.