Vehicles: light patterns (sirens, strobes), siren lights and siren sound in the viewer #81

Manually merged
github merged 2 commits from gh-pr/81/head into gh-pr/81/base 2026-11-26 20:08:21 +00:00
Owner

@⁠holdmysocks on GitHub · 2026-11-23 21:22 UTC · original
holdmysocks:claude/sirens → master · +679 −4 · 9 files · 2 commits · merged 2026-11-23 21:55 UTC

What

  • Core (vehlights.rs): reads the light pattern records (0f93517e) from the vehicle library (data.rpf), the shared pattern pack and the per-vehicle light packs (packs.rpf). Per pattern: slot, speed, clock, and per lamp the bone name hash (joaat of siren12, indicator_lf ...) with steps of phase offset (half float) and flash type number.
  • A configuration reaches its patterns through its parts: part record 0caef606 -> list 61e1e572 -> link record da592d57 -> pattern names 1ff6a884. A light pack holding a pattern a vehicle links is taken as that vehicle's.
  • vehicles.json is format 9: per vehicle lights (patterns, pack, archetypes), per configuration light_patterns.
  • meta7a: member type 0x20 is decoded as a half float (it was a hex dump).
  • Viewer, lights: a "siren lights" list in the vehicle panel when a pattern reaches siren, strobe or beacon bones of the model; lamps and their _glass lens bones flash with their phase offsets. --siren N picks the Nth pattern for screenshots.
  • Viewer, sound (second commit): a "siren sound" list beside it. The sound definitions of audio.rpf (schema 166) hold the siren sounds under their names (RESIDENT_VEHICLES_SIREN_WAIL_01..04, _QUICK_01..04, _FIRETRUCK_WAIL_01, _FIRETRUCK_QUICK_01); the chosen one is found by name hash, its Opus stream decoded and looped. audiometa::sound_waves is the lookup.

Checked

  • Export over the whole game: 339 of 373 vehicle records get light patterns (3.7 MB in vehicles.json); 34 have a light pack of their own.
  • ambulance: 4 patterns reach its 37 siren bones; screenshots with a flashing and a steady pattern show the lamps lit. ambulance2 and firetruk2 load and list their patterns; firetruk2's screenshot caught no lamp lit at that moment, so it is not confirmed by eye.
  • Sound: an ignored test (every_siren_sound_decodes, needs the game) finds and decodes all ten sounds: wails 3.8 to 6.3 s, yelps 0.25 to 0.5 s, mono, full-scale signal. Playback through the speakers was not listened to.
  • cargo test -p sixng-core -p sixng-gui: 152 passed.

Not decoded / not done

  • What a flash type number looks like over time. 29 numbers are in use; no table of them was found in the meta resources. The viewer shows 0 as off, 1 as steady, 6 (the indicators' number) as an even blink and every other number as the same double flash.
  • The cycle length (shown as one second at speed 1) and the two clock values (1b953013).
  • Lamp colours. A lamp names a light archetype; the archetypes themselves were not found. Nine names are known by guessing (red, amber, halogen, halogen_warm, led, led_warm_white, warm_white, indicator_amber, amber_roof_spotlight), 117 are hashes only, including all three on the ambulance's sirens. The viewer shows red and amber by name and everything else white.
  • Which of a light pack's unlinked patterns the game plays, and when (they are listed as "pack").
  • Light bars that are mod parts on civilian models: only bones of the loaded model flash.
  • Which vehicle plays which siren: a vehicle's audio record (schema-581 file, class 9, named by the model hash) points by index into an object graph that is not decoded, so the sound is the user's choice. The first sound takes about 18 s to start (the sound definitions are read once).
  • Horn: not identified. Twelve more unnamed sounds sit on the sirens' wave container.
  • The siren sound needs audio.rpf's banks scanned with the current index version (the Audio page does it).
  • The Metal renderer shows no lamp light (as for the other lamps).
**@⁠holdmysocks** on GitHub · 2026-11-23 21:22 UTC · [original](https://github.com/holdmysocks/SixNG/pull/81) `holdmysocks:claude/sirens` → `master` · +679 −4 · 9 files · 2 commits · merged 2026-11-23 21:55 UTC ## What - **Core** (`vehlights.rs`): reads the light pattern records (`0f93517e`) from the vehicle library (data.rpf), the shared pattern pack and the per-vehicle light packs (packs.rpf). Per pattern: slot, speed, clock, and per lamp the bone name hash (joaat of `siren12`, `indicator_lf` ...) with steps of phase offset (half float) and flash type number. - A configuration reaches its patterns through its parts: part record `0caef606` -> list `61e1e572` -> link record `da592d57` -> pattern names `1ff6a884`. A light pack holding a pattern a vehicle links is taken as that vehicle's. - `vehicles.json` is format 9: per vehicle `lights` (`patterns`, `pack`, `archetypes`), per configuration `light_patterns`. - `meta7a`: member type 0x20 is decoded as a half float (it was a hex dump). - **Viewer, lights**: a "siren lights" list in the vehicle panel when a pattern reaches siren, strobe or beacon bones of the model; lamps and their `_glass` lens bones flash with their phase offsets. `--siren N` picks the Nth pattern for screenshots. - **Viewer, sound** (second commit): a "siren sound" list beside it. The sound definitions of audio.rpf (schema 166) hold the siren sounds under their names (`RESIDENT_VEHICLES_SIREN_WAIL_01..04`, `_QUICK_01..04`, `_FIRETRUCK_WAIL_01`, `_FIRETRUCK_QUICK_01`); the chosen one is found by name hash, its Opus stream decoded and looped. `audiometa::sound_waves` is the lookup. ## Checked - Export over the whole game: 339 of 373 vehicle records get light patterns (3.7 MB in vehicles.json); 34 have a light pack of their own. - ambulance: 4 patterns reach its 37 siren bones; screenshots with a flashing and a steady pattern show the lamps lit. ambulance2 and firetruk2 load and list their patterns; firetruk2's screenshot caught no lamp lit at that moment, so it is not confirmed by eye. - Sound: an ignored test (`every_siren_sound_decodes`, needs the game) finds and decodes all ten sounds: wails 3.8 to 6.3 s, yelps 0.25 to 0.5 s, mono, full-scale signal. Playback through the speakers was not listened to. - `cargo test -p sixng-core -p sixng-gui`: 152 passed. ## Not decoded / not done - What a flash type number looks like over time. 29 numbers are in use; no table of them was found in the meta resources. The viewer shows 0 as off, 1 as steady, 6 (the indicators' number) as an even blink and every other number as the same double flash. - The cycle length (shown as one second at speed 1) and the two clock values (`1b953013`). - Lamp colours. A lamp names a light archetype; the archetypes themselves were not found. Nine names are known by guessing (red, amber, halogen, halogen_warm, led, led_warm_white, warm_white, indicator_amber, amber_roof_spotlight), 117 are hashes only, including all three on the ambulance's sirens. The viewer shows red and amber by name and everything else white. - Which of a light pack's unlinked patterns the game plays, and when (they are listed as "pack"). - Light bars that are mod parts on civilian models: only bones of the loaded model flash. - Which vehicle plays which siren: a vehicle's audio record (schema-581 file, class 9, named by the model hash) points by index into an object graph that is not decoded, so the sound is the user's choice. The first sound takes about 18 s to start (the sound definitions are read once). - Horn: not identified. Twelve more unnamed sounds sit on the sirens' wave container. - The siren sound needs audio.rpf's banks scanned with the current index version (the Audio page does it). - The Metal renderer shows no lamp light (as for the other lamps).
Core: vehlights reads the light pattern records (0f93517e) of the vehicle
library, the shared pattern pack and the per-vehicle light packs: per lamp
the bone name hash and steps of phase offset and flash type number, the
pattern's slot, speed and clock. vehicles.json (format 9) gains per vehicle
`lights` (patterns, the names in its own light pack, lamp archetype names)
and per configuration `light_patterns` (the patterns its parts link).
meta7a decodes member type 0x20 as a half float.

Viewer: a "siren lights" list on vehicles whose patterns reach siren,
strobe or beacon bones; lamps flash with their offsets. `--siren N` picks
a pattern for screenshots.

Not decoded: the waveform of each flash type number (0 shown as off, 1
steady, 6 an even blink, all others a double flash), the cycle length
(one second at speed 1) and the colours of the light archetypes (red and
amber by name, others white).
The sound definitions of audio.rpf (schema 166) hold the siren sounds
under their names (RESIDENT_VEHICLES_SIREN_WAIL_01..04, _QUICK_01..04,
_FIRETRUCK_WAIL_01, _FIRETRUCK_QUICK_01). The viewer finds the chosen
one by name hash, decodes its stream and loops it.

audiometa::sound_waves gives the wave (container, stream id) of named
simple sounds, reading a sound file split over two entries whole.

Which vehicle plays which siren is not read from the files; the horn
sounds are not identified.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 20:08:20 +00:00
github manually merged commit 18aadb1321 into gh-pr/81/base 2026-11-26 20:08:21 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.