model viewer: vehicle data panel #47

Manually merged
github merged 2 commits from gh-pr/47/head into gh-pr/47/base 2026-11-27 02:32:49 +00:00
Owner

@⁠asm512 on GitHub · 2026-11-22 20:45 UTC · original
asm512:vehicle-data-panel → main · +3431 −4 · 5 files · 2 commits · merged 2026-11-22 21:36 UTC

Builds on #45 (it uses its name table) and should be merged after it.

Selecting a vehicle in the model viewer now shows a collapsible "Vehicle data" section with that vehicle's handling and physics records, read from the PSIN file in data.rpf.

  • One entry per component record, with its values typed: floats, ints, bools, vectors, enums, flags, arrays and maps.
  • A vehicle only stores the records it defines itself; the rest come from its parent chain (cheetah2 > … > car > … > vehicle). Inherited records are marked with the template they come from and how many entries share them.
  • Field names come from the name table. Unknown ones show as hashes, guessed ones with a ?.
  • "Copy values as text" copies every component of the vehicle.
  • Read only. The file is found by scanning data.rpf for the PSIN file that holds the vehicle table, with the known offset tried first. Loading runs off the UI thread, and the section stays hidden when there is no data.rpf or the model has no entry.

That a child record replaces the parent's record of the same struct as a whole is my reading of the data, not confirmed in game.

Testing

  • cargo test --release with PERCYSTAR_LEVELS_RPF set: 118 pass. vehicle_texture_layers_toggle fails on this base without this change too and is fixed in #46.
  • New tests: cheetah2 and coach are found with 8 and 7 own records and masses 1630 and 16500, every value in the file decodes to a known type, the scan finds the file without the offset hint, and a headless render of the panel shows the values and copies them. One synthetic file covers the inheritance rule without game data.
**@⁠asm512** on GitHub · 2026-11-22 20:45 UTC · [original](https://github.com/rpatty-dev/PercyStar/pull/47) `asm512:vehicle-data-panel` → `main` · +3431 −4 · 5 files · 2 commits · merged 2026-11-22 21:36 UTC Builds on #45 (it uses its name table) and should be merged after it. Selecting a vehicle in the model viewer now shows a collapsible "Vehicle data" section with that vehicle's handling and physics records, read from the PSIN file in `data.rpf`. - One entry per component record, with its values typed: floats, ints, bools, vectors, enums, flags, arrays and maps. - A vehicle only stores the records it defines itself; the rest come from its parent chain (`cheetah2` > … > `car` > … > `vehicle`). Inherited records are marked with the template they come from and how many entries share them. - Field names come from the name table. Unknown ones show as hashes, guessed ones with a `?`. - "Copy values as text" copies every component of the vehicle. - Read only. The file is found by scanning `data.rpf` for the PSIN file that holds the vehicle table, with the known offset tried first. Loading runs off the UI thread, and the section stays hidden when there is no `data.rpf` or the model has no entry. That a child record replaces the parent's record of the same struct as a whole is my reading of the data, not confirmed in game. **Testing** - `cargo test --release` with `PERCYSTAR_LEVELS_RPF` set: 118 pass. `vehicle_texture_layers_toggle` fails on this base without this change too and is fixed in #46. - New tests: cheetah2 and coach are found with 8 and 7 own records and masses 1630 and 16500, every value in the file decodes to a known type, the scan finds the file without the offset hint, and a headless render of the panel shows the values and copies them. One synthetic file covers the inheritance rule without game data.
- PSIN files are shown and exported as XML with typed values; edited values are patched into a same-size copy
- name table for hashed struct, field and enum names: built-in list, word lists and name tables in the names folder, names recovered from the open archives
- schema names are joaat without lower-casing, which is why they did not resolve before
- recovery combines known words and measures chance matches with decoy hashes; built names are marked with ?

Recovered names and method: https://asm512.github.io/gta6-name-recovery/
Source: https://github.com/asm512/gta6-name-recovery
- shows the handling and physics records of the selected vehicle, read
  from the PSIN file in data.rpf
- marks records inherited from a parent template and how many entries
  share them, values can be copied as text
- field names come from the name table
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 02:32:48 +00:00
github manually merged commit 5705381eaa into gh-pr/47/base 2026-11-27 02:32:49 +00:00
Author
Owner

@⁠rpatty-dev on GitHub · 2026-11-22 21:36 UTC · original

Merged and verified (cargo test --release: 120 passed). Great addition — vehicle handling/physics inheritance in the model viewer is super useful!

**@⁠rpatty-dev** on GitHub · 2026-11-22 21:36 UTC · [original](https://github.com/rpatty-dev/PercyStar/pull/47#issuecomment-7086184582) Merged and verified (cargo test --release: 120 passed). Great addition — vehicle handling/physics inheritance in the model viewer is super useful!
This discussion has been locked. Commenting is limited to contributors.
No description provided.