Vehicles: truck bodies and beds from the configuration's parts #95

Manually merged
github merged 1 commit from gh-pr/95/head into gh-pr/95/base 2026-11-26 20:09:30 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-24 00:41 UTC · original
holdmysocks:claude/truck-bodies → master · +174 −35 · 3 files · 1 commits · merged 2026-11-24 00:47 UTC

Trucks and pickups showed a cab on a bare frame: their bodies are separate models that a configuration's parts bring in.

What

Core

  • A configuration's part list also names parts of the vehicle library (not only of the vehicle's own pack) that have models: truck beds and boxes (truckbeds_box_01, truckbeds_flatbed_03, truckbeds_mixer_01_lrg ...), mud flaps, antennas, light bars. The chain is part 0caef606 -> elements -> element 77f2b89e: bone 079baba7, hidden stock bones 2b490ab7, and the model, which is the low half of the element's part set key 8605bf0e (the joaat of the model's name; 1,996 of the library's 2,027 elements name an existing model that way).
  • vehicles.json is format 11: a vehicle's mods now also holds the library parts its configurations name, marked shared, and every element has model.

Viewer

  • A vehicle opens with the parts of its first configuration (it opened with none), and picking another configuration switches to that configuration's parts. One part per group: a part list also holds the choices of its option lists.
  • Part models are taken from the elements' model names; the old match by part name stays as the fallback.
  • A pickup's bed is a model named <vehicle>_pickup (_flatbed, _cargobed). It is offered as a part of its own ("body (link not known)"), placed at the mod_bed_attach bone and on by default.
  • Rims, tyres, brake discs, calipers and drum brakes are left out of the parts list; the viewer fits those at the wheel mounts already.

Export (not in this PR: it was merged first; see the follow-up PR "Vehicles: no prop tint on vehicle shaders")

  • The placement tint of props (a palette embedded in the model, picked by vertex colours) is no longer applied on the vehicle shaders, whose vertex colours carry part ids: a vehicle part without a part set, such as the shared truck beds, came out in rainbow bands. part_colours_version 8, so vehicles and their parts are exported again on first open.

Checked

  • Whole-game export: 6,084 shared parts added over the vehicles.
  • Renders of 16 vehicles that showed a bare frame: benson (box), biff, mule, iota (flatbeds), mb210 (utility body), tiptruck (flatbed), towtruck (tow body), and the pickups bison3800, bison900, sandkingxt, rebel, rancher, reclaimerclassic, yosemite1500, bobcatxl, kamacho (beds, in the body colour). All sixteen have their body now. With the follow-up PR benson's box and tiptruck's flatbed are plain grey and metal instead of rainbow.
  • cargo test -p sixng-core -p sixng-gui: 156 passed (no new tests).

Not decoded / not done

  • The pickup bed's link. The part in the bed slot (1c9dd6fe) names its models by hashes that match no model name in the archives, so the <vehicle>_pickup model is attached by its name and a bone, not through that part. Bed liners, tailgates and other pieces of that part are not shown.
  • Colours of the shared truck beds. No part set was found for them (their elements' part set keys name no f14244fd record in packs.rpf or data.rpf), so they show the stand-in trim and paint colours, not per-part ones.
  • Which of an option list's choices a spawned vehicle gets: the first of each group is shown.
  • The records be692119 in a vehicle pack looked like body attachments but are prop sets (litter, boxes and tools placed in the cab or on the bed: each names a small entity list in levels.rpf). Not used here.
  • Switching configuration reloads the model when the parts differ.
**@⁠holdmysocks** on GitHub · 2026-11-24 00:41 UTC · [original](https://github.com/holdmysocks/SixNG/pull/95) `holdmysocks:claude/truck-bodies` → `master` · +174 −35 · 3 files · 1 commits · merged 2026-11-24 00:47 UTC Trucks and pickups showed a cab on a bare frame: their bodies are separate models that a configuration's parts bring in. ## What **Core** - A configuration's part list also names parts of the vehicle library (not only of the vehicle's own pack) that have models: truck beds and boxes (`truckbeds_box_01`, `truckbeds_flatbed_03`, `truckbeds_mixer_01_lrg` ...), mud flaps, antennas, light bars. The chain is part `0caef606` -> `elements` -> element `77f2b89e`: bone `079baba7`, hidden stock bones `2b490ab7`, and the model, which is the low half of the element's part set key `8605bf0e` (the joaat of the model's name; 1,996 of the library's 2,027 elements name an existing model that way). - `vehicles.json` is format 11: a vehicle's `mods` now also holds the library parts its configurations name, marked `shared`, and every element has `model`. **Viewer** - A vehicle opens with the parts of its first configuration (it opened with none), and picking another configuration switches to that configuration's parts. One part per group: a part list also holds the choices of its option lists. - Part models are taken from the elements' model names; the old match by part name stays as the fallback. - A pickup's bed is a model named `<vehicle>_pickup` (`_flatbed`, `_cargobed`). It is offered as a part of its own ("body (link not known)"), placed at the `mod_bed_attach` bone and on by default. - Rims, tyres, brake discs, calipers and drum brakes are left out of the parts list; the viewer fits those at the wheel mounts already. **Export** (not in this PR: it was merged first; see the follow-up PR "Vehicles: no prop tint on vehicle shaders") - The placement tint of props (a palette embedded in the model, picked by vertex colours) is no longer applied on the vehicle shaders, whose vertex colours carry part ids: a vehicle part without a part set, such as the shared truck beds, came out in rainbow bands. `part_colours_version` 8, so vehicles and their parts are exported again on first open. ## Checked - Whole-game export: 6,084 shared parts added over the vehicles. - Renders of 16 vehicles that showed a bare frame: benson (box), biff, mule, iota (flatbeds), mb210 (utility body), tiptruck (flatbed), towtruck (tow body), and the pickups bison3800, bison900, sandkingxt, rebel, rancher, reclaimerclassic, yosemite1500, bobcatxl, kamacho (beds, in the body colour). All sixteen have their body now. With the follow-up PR benson's box and tiptruck's flatbed are plain grey and metal instead of rainbow. - `cargo test -p sixng-core -p sixng-gui`: 156 passed (no new tests). ## Not decoded / not done - The pickup bed's link. The part in the bed slot (`1c9dd6fe`) names its models by hashes that match no model name in the archives, so the `<vehicle>_pickup` model is attached by its name and a bone, not through that part. Bed liners, tailgates and other pieces of that part are not shown. - Colours of the shared truck beds. No part set was found for them (their elements' part set keys name no `f14244fd` record in packs.rpf or data.rpf), so they show the stand-in trim and paint colours, not per-part ones. - Which of an option list's choices a spawned vehicle gets: the first of each group is shown. - The records `be692119` in a vehicle pack looked like body attachments but are prop sets (litter, boxes and tools placed in the cab or on the bed: each names a small entity list in levels.rpf). Not used here. - Switching configuration reloads the model when the parts differ.
Core: a configuration's part list also names parts of the vehicle
library that have models: truck beds and boxes, mud flaps, antennas,
light bars. Their elements give the model (the low half of the element's
part set key is the joaat of the model's name), the bone it is modelled
around and the stock bones it hides. vehicles.json (format 11) lists, per
vehicle, the library parts its configurations name (`shared`) beside its
own, and every element gets `model`.

Viewer: a vehicle opens with the parts of its first configuration instead
of none, and picking a configuration switches to that configuration's
parts (one per group). Models are taken from the elements' names. A
pickup's bed (`<vehicle>_pickup`) is offered as a part of its own at the
mod_bed_attach bone: the part that fits it names its models by hashes
that match no model name. Wheels and brakes are left out of the list
(the viewer fits those at the wheel mounts).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:09:29 +00:00
github manually merged commit 1d960f32d3 into gh-pr/95/base 2026-11-26 20:09:30 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.