Vehicles: body-paint groups from the configuration, rim size from the wheel fitment #60

Manually merged
github merged 2 commits from gh-pr/60/head into gh-pr/60/base 2026-11-26 20:06:38 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-23 17:28 UTC · original
holdmysocks:claude/rim-size → master · +280 −28 · 4 files · 2 commits · merged 2026-11-23 17:45 UTC

Two commits on the same library reader: a follow-up to the part colours (#59) and the rim size.

Body-paint groups (follow-up to #59)

With the default part set alone, some body panels stayed on the "black" colour record: buffalo6's rear doors and mirrors, the whole ambulance box. The game paints them through the configuration's modifier records.

  • A configuration's part list names 0caef606 records, in the library and in the vehicle's own pack. Each lists modifier records.
  • Three kinds are applied, for a model's first configuration: group definitions (6225734f, group name + part ids), bindings of a group to a channel (501ff112, with a priority and colour / surface flags) and assignments of a colour and surface record to a channel (b94308f5).
  • Body panel groups (bodywork, doors, Mirrors, bonnet, boot, bumpers) are bound to one channel that nothing assigns a colour. It is taken as the body paint.
  • 240 of 319 linked models get changes. buffalo6 goes from 10 to 25 body-paint part ids, bison4 from 7 to 18, the ambulance from 0 to 17.

Rim size

  • The configuration part in slot 39d5e253 lists a 9a172293 record whose 3d37e0df is rim radius / tyre radius: 0.82 on comet7, 0.74 on buffalo6, 0.65 on bison4 and the ambulance. vehicles.json writes it per configuration as rim_ratio (format 5); 2,328 of 4,063 configurations have one.
  • Viewer: the rim and the tyre's bead are scaled to that ratio and the tread keeps the collision disc's radius. The Rig panel has "rim size from the configuration" and a rim / tyre radius slider.

Checked

  • In the viewer: colours on buffalo6, ambulance, bison4 and comet7; rim size on comet7, buffalo6 and bison4.
  • 137 core tests pass.

Not decoded

  • The other modifier kinds: dirt level, liveries and decal layers, option lists.
  • Fitment records that hold offsets other parts add to the rim ratio.
  • Which configuration a spawned vehicle uses; the first is taken.
  • That channel 7ed76b9f is the body paint is an inference.
  • wheelScale is still not understood. It is not the rim radius.
  • Tyre width per bone is not shaped; the exported GLB does not carry fitted wheels.
**@⁠holdmysocks** on GitHub · 2026-11-23 17:28 UTC · [original](https://github.com/holdmysocks/SixNG/pull/60) `holdmysocks:claude/rim-size` → `master` · +280 −28 · 4 files · 2 commits · merged 2026-11-23 17:45 UTC Two commits on the same library reader: a follow-up to the part colours (#59) and the rim size. ## Body-paint groups (follow-up to #59) With the default part set alone, some body panels stayed on the "black" colour record: buffalo6's rear doors and mirrors, the whole ambulance box. The game paints them through the configuration's modifier records. - A configuration's part list names `0caef606` records, in the library and in the vehicle's own pack. Each lists modifier records. - Three kinds are applied, for a model's first configuration: group definitions (`6225734f`, group name + part ids), bindings of a group to a channel (`501ff112`, with a priority and colour / surface flags) and assignments of a colour and surface record to a channel (`b94308f5`). - Body panel groups (bodywork, doors, Mirrors, bonnet, boot, bumpers) are bound to one channel that nothing assigns a colour. It is taken as the body paint. - 240 of 319 linked models get changes. buffalo6 goes from 10 to 25 body-paint part ids, bison4 from 7 to 18, the ambulance from 0 to 17. ## Rim size - The configuration part in slot `39d5e253` lists a `9a172293` record whose `3d37e0df` is rim radius / tyre radius: 0.82 on comet7, 0.74 on buffalo6, 0.65 on bison4 and the ambulance. `vehicles.json` writes it per configuration as `rim_ratio` (`format` 5); 2,328 of 4,063 configurations have one. - Viewer: the rim and the tyre's bead are scaled to that ratio and the tread keeps the collision disc's radius. The Rig panel has "rim size from the configuration" and a rim / tyre radius slider. ## Checked - In the viewer: colours on buffalo6, ambulance, bison4 and comet7; rim size on comet7, buffalo6 and bison4. - 137 core tests pass. ## Not decoded - The other modifier kinds: dirt level, liveries and decal layers, option lists. - Fitment records that hold offsets other parts add to the rim ratio. - Which configuration a spawned vehicle uses; the first is taken. - That channel `7ed76b9f` is the body paint is an inference. - `wheelScale` is still not understood. It is not the rim radius. - Tyre width per bone is not shaped; the exported GLB does not carry fitted wheels.
Follow-up to the part colours. A vehicle's default part set leaves some
body panels on the "black" colour record (buffalo6's rear doors and
mirrors, the whole ambulance box); the game paints them through the
modifier records of the configuration.

- A configuration's part list (51019114.e89b8540) names 0caef606
  records: in the library (data.rpf) and in the vehicle's own pack. Each
  lists modifier records (61e1e572). Three kinds are applied, for a
  model's first configuration:
  - 6225734f, a group definition: 662d9b79 group name, e9bf9f2d part
    ids. The vehicle's own part records list the definitions that hold
    for it; the library also has named groups 000639e9 whose 3acbce85
    is a byte array of part ids (pool reference, u16 count).
  - 501ff112, a binding: group 662d9b79 -> channel 178cc382, priority
    1470edc0, flags c8d27281 (colour) and 7a84e7bf (surface).
  - b94308f5, an assignment: channel ca2065a9 -> colour record
    2c89a8d2 and surface record 7a84e7bf.
  Bindings are applied in priority order. Body panel groups (names
  resolve: bodywork, doors, Mirrors, and the bone names bonnet, boot,
  bumper_f, bumper_r) are bound to channel 7ed76b9f at priority 1 over
  a default; nothing assigns that channel a colour, so it is taken as
  the body paint.
- The model's part set becomes its own copy with these applied
  (vehicle_parts.json format 4; exports are version 3, so the viewer
  exports vehicles again). 240 of 319 linked models get changes:
  buffalo6 goes from 10 to 25 body-paint part ids, bison4 from 7 to 18,
  the ambulance from 0 to 17.
- The colour record 2a13d29a resolves to the name "black".
- Wheel fitment: the configuration part in slot 39d5e253 lists a
  9a172293 record whose 3d37e0df is rim radius / tyre radius (0.82 and
  0.86 on comet7, 0.74 to 0.79 on buffalo6, 0.58 to 0.68 on bison4,
  0.65 on the ambulance). vehicles.json writes it per configuration as
  rim_ratio ("format" 5); 2,328 of 4,063 configurations have one.

Checked in the viewer on buffalo6, ambulance, bison4 and comet7.
137 core tests pass.

Not decoded: the other modifier kinds (08b2439a with a mask and a level
on a slot that covers all 256 ids, liveries and decal layers 51aab7c1 /
44cc9d8c / d62c0436 / ed9cf5df, option lists f5e9d7df, c328e66e,
84f5099b, 1f6c6730); fitment records with 0341ff8f set, which hold
offsets other slots add to the rim ratio and are not applied; which
configuration a spawned vehicle uses (the first is taken); that channel
7ed76b9f is the body paint is an inference.
Rim and tyre were scaled together, so the rim followed the tyre model's
proportions. All bones of a shared wheel model sit on the hub, so the
wheel can only be shaped by scaling them: rims skin to the rim bones,
tyres to tyre_profile (bead) and tread_profile (tread) bones.

- The rim and the tyre's bead are scaled to rim_ratio x the tyre's
  outer radius (the configuration's wheel fitment record); the tread
  keeps the radius of the wheel's collision disc. The shape is baked
  into the wheel models' vertices before upload.
- Rig panel: "rim size from the configuration" and a rim / tyre radius
  slider (0 = the proportions of the tyre model).

Checked in the viewer on comet7 (0.82), buffalo6 (0.74) and bison4
(0.65).

Not done: fitment offsets other parts add; wheelScale is still not
understood (it is not the rim radius: 0.219 on comet7, whose rim is
0.82 x 0.35 m); tyre width per bone (wheel_width_mover, the inside and
outside profile bones) is not shaped, the whole wheel is scaled to the
disc's width as before; the exported GLB does not carry fitted wheels.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:06:36 +00:00
github manually merged commit 06cfdef04d into gh-pr/60/base 2026-11-26 20:06:38 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.