Vehicles: coat records (clear coat, flakes, film, sheen) per part and per configuration #253

Manually merged
github merged 4 commits from gh-pr/253/head into gh-pr/253/base 2026-11-26 20:21:47 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-25 06:27 UTC · original
holdmysocks:claude/vehicle-coat-data → master · +411 −30 · 4 files · 4 commits · merged 2026-11-25 06:47 UTC

What

A vehicle paint is layers: a base coat, a clear coat, flakes, a thin film, a sheen. The game keeps them in coat records in the vehicle library (struct 2b84f07e, 56 bytes, 92 records). This reads them and says which coat each part id and each configuration's body paint uses. First part of SIX-202; the viewer does not use them yet.

  • vehcolour::Coat and coats(): the 20 fields of a record (clear coat on/intensity/roughness, base coat roughness and its override flag, flakes on/coverage/size/orientation, film IOR and thickness, sheen, anisotropy, two unnamed fields). Members are found by name hash and read by their declared type.
  • Which coat a part uses:
    • a part set's colour entry names one per part id (paintHash), next to the colour record already read;
    • a configuration's paint type part gives a channel a coat (paintType), an assignment a default one (defaultPaintType), and a binding with its paintType flag set passes the channel's coat to its part ids.
  • Output: vehicle_parts.json (a part's coat, the library's coats), model.json part_colours.coat (records, per look the coat of each part id and of the body paint), and sixng vehicle reports paint_coat.

Also fixed on the way: the part reference of a configuration was read by field name (data), which only resolves when the name dictionary is loaded. Without the dictionary no part reference was followed and 1,202 of 3,741 configurations (144 models) got other colours or surfaces. It is now read by member hash; the tables are byte-identical with and without the dictionary.

Version bumps: vehcolour::FORMAT 20 to 21 (vehicle_parts.json rebuilds) and EXPORT_VERSION 24 to 25 (the viewer re-exports vehicles once). vehicles.json is not touched.

Checked

  • Field names: the member hashes are case-sensitive joaat of clearCoatIntensity, useClearCoat, filmIOR, overrideBaseCoatRoughness, flakeSize, baseCoatRoughness, paintHash, defaultPaintType, paintType and the rest; 14 of the 92 record names resolve (default, gloss, metallic, satin solid, matte solid, matte metallic, carbon glossy, sheen_velvet, ...).
  • The values read as their names say: gloss clear coat 1 at roughness 0 over a base of 0.4; metallic the same with flakes; matte solid clear coat roughness 0.7; 43 records have a film (IOR 2.3, one 2.6).
  • Every one of the 338 base part sets resolves its coat names in the library.
  • Body paint coat over the 3,741 configurations: gloss 1,403, metallic 1,057, default 230, satin solid 170, matte solid 75, the rest unnamed records; 35 have no primary-paint part.
  • No colour or surface changes: against master built with the name dictionary, with the coat stripped, 0 of 320 default looks, 0 of 3,741 configurations and 0 of 980 shared parts differ. Part patches gain ids on which only the coat changes.
  • Unit tests for the record reader (with the library's own bytes for metallic), half floats, the paint type of a channel, and the coat tables. Workspace tests pass.

Not decoded / not done

  • That a paint type modifier wins over an assignment's default, and that a binding passes the coat only with its flag set, is read from the field names, not from game code.
  • What the game's shader does with each value is not decoded. The unit of filmThickness and flakeSize is not known.
  • 78 record names and two fields (b97f4910, 9851c9f1) are unnamed. No record is named chrome.
  • sixng vehicle with paint_coat compiles but was not run: the local index was mid-upgrade.
  • Three more places name a coat and are not used: a surface record's paintHash, livery entries' paintPalette, the preset set's wearPresets.
**@⁠holdmysocks** on GitHub · 2026-11-25 06:27 UTC · [original](https://github.com/holdmysocks/SixNG/pull/253) `holdmysocks:claude/vehicle-coat-data` → `master` · +411 −30 · 4 files · 4 commits · merged 2026-11-25 06:47 UTC ## What A vehicle paint is layers: a base coat, a clear coat, flakes, a thin film, a sheen. The game keeps them in **coat records** in the vehicle library (struct `2b84f07e`, 56 bytes, 92 records). This reads them and says which coat each part id and each configuration's body paint uses. First part of SIX-202; the viewer does not use them yet. - `vehcolour::Coat` and `coats()`: the 20 fields of a record (clear coat on/intensity/roughness, base coat roughness and its override flag, flakes on/coverage/size/orientation, film IOR and thickness, sheen, anisotropy, two unnamed fields). Members are found by name hash and read by their declared type. - Which coat a part uses: - a part set's colour entry names one per part id (`paintHash`), next to the colour record already read; - a configuration's paint type part gives a channel a coat (`paintType`), an assignment a default one (`defaultPaintType`), and a binding with its `paintType` flag set passes the channel's coat to its part ids. - Output: `vehicle_parts.json` (a part's `coat`, the library's `coats`), model.json `part_colours.coat` (records, per look the coat of each part id and of the body paint), and `sixng vehicle` reports `paint_coat`. Also fixed on the way: the part reference of a configuration was read by field name (`data`), which only resolves when the name dictionary is loaded. Without the dictionary no part reference was followed and 1,202 of 3,741 configurations (144 models) got other colours or surfaces. It is now read by member hash; the tables are byte-identical with and without the dictionary. Version bumps: `vehcolour::FORMAT` 20 to 21 (`vehicle_parts.json` rebuilds) and `EXPORT_VERSION` 24 to 25 (the viewer re-exports vehicles once). vehicles.json is not touched. ## Checked - Field names: the member hashes are case-sensitive joaat of `clearCoatIntensity`, `useClearCoat`, `filmIOR`, `overrideBaseCoatRoughness`, `flakeSize`, `baseCoatRoughness`, `paintHash`, `defaultPaintType`, `paintType` and the rest; 14 of the 92 record names resolve (`default`, `gloss`, `metallic`, `satin solid`, `matte solid`, `matte metallic`, `carbon glossy`, `sheen_velvet`, ...). - The values read as their names say: `gloss` clear coat 1 at roughness 0 over a base of 0.4; `metallic` the same with flakes; `matte solid` clear coat roughness 0.7; 43 records have a film (IOR 2.3, one 2.6). - Every one of the 338 base part sets resolves its coat names in the library. - Body paint coat over the 3,741 configurations: gloss 1,403, metallic 1,057, default 230, satin solid 170, matte solid 75, the rest unnamed records; 35 have no primary-paint part. - No colour or surface changes: against master built with the name dictionary, with the coat stripped, 0 of 320 default looks, 0 of 3,741 configurations and 0 of 980 shared parts differ. Part patches gain ids on which only the coat changes. - Unit tests for the record reader (with the library's own bytes for `metallic`), half floats, the paint type of a channel, and the coat tables. Workspace tests pass. ## Not decoded / not done - That a paint type modifier wins over an assignment's default, and that a binding passes the coat only with its flag set, is read from the field names, not from game code. - What the game's shader does with each value is not decoded. The unit of `filmThickness` and `flakeSize` is not known. - 78 record names and two fields (`b97f4910`, `9851c9f1`) are unnamed. No record is named chrome. - `sixng vehicle` with `paint_coat` compiles but was not run: the local index was mid-upgrade. - Three more places name a coat and are not used: a surface record's `paintHash`, livery entries' `paintPalette`, the preset set's `wearPresets`.
The library's coat records (struct 2b84f07e: clear coat, flakes, film,
sheen, anisotropy) are read; a part set's paintHash and a configuration's
paint type parts give each part id its coat. model.json gets
part_colours.coat (records, per look, body paint). vehicle_parts.json
format 21, part colours export version 25.
The part reference modifier (51aab7c1) was read by the field names type
and data; data is not a built-in name, so without the name dictionary no
reference was followed and 1,202 configurations got other part colours.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:21:44 +00:00
github manually merged commit 3e5813923e into gh-pr/253/base 2026-11-26 20:21:47 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.