Cutscenes: audio banks and master timelines (#516) #528

Manually merged
github merged 1 commit from github-bot/gh-528 into gh-pr/528/base 2026-11-28 03:55:31 +00:00 AGit
Owner

@⁠holdmysocks on GitHub · 2026-11-28 03:42 UTC · original
holdmysocks:claude/cutscene-audio-banks → master · +486 −12 · 6 files · 1 commits · merged 2026-11-28 03:49 UTC

Summary

Reproduces issue #516 on our copy and wires both parts into sixng cutscenes.

  • Audio banks. With the archive's audio index, each scene gets its bank. A bank counts when it holds two or more of the streams joaat("<name>.<channel>") & 0x1FFFFFFF (channels c, l, r, ad, ls, rs, music.l, music.r) and no other bank does. Names are tried in this order:

    • the scene name;
    • the scene name without _pN / _tNN / _xN;
    • the audio name in its scene files (struct db646fb2, member 52c09a55), dropping leading words until a name has a bank;
    • else the bank of the masters that place it, when they agree.

    Each scene reports the name, its source, the bank offset and each channel's stream id and length.

  • Master timelines. Scene files with a start-time map keep their timeline in the catalog, including masters without object records. The catalog version goes to 5, so the first run rescans. Start ids resolve through the id map to a fwAnimSceneReferenceSectionData, either directly or through fwAnimSceneCompositeSectionData (its id 9a3e57d2, else its sectionIds). The catalog also stores each scene file's audio names.

    • Each scene lists its placements: master, start, end (the next start), section and bank_time (the start minus the master's earliest start).
    • Each scene also lists the masters' own banks (master_audio).
    • The report gains master_timelines totals and per-source bank counts.
  • The struct and member names come from vihook's par_names.txt (MIT). The names are credited in THIRD_PARTY_NOTICES.md; no part of that file is included.

  • README: the Cutscenes section explains both parts and gives the counts.

Validation

  • New synthetic tests:
    • the issue's test vector (air_tail_int .c / .l / .r / .ad);
    • suffix stripping;
    • timeline resolution (direct, through a composite, through its section list, a loop, a missing id, a repeated start);
    • bank matching (a single channel is ignored, a name split over two banks is left out, a <mission>_<scene> audio name);
    • the fallback to the master's bank.
  • cargo test passed locally on Windows for sixng-core and sixng-cli, plus the sixng-gui scenes tests. cargo check --workspace --release is clean.
  • Local run on the current Xbox build, story pack:
    • 1,942 of 2,824 scenes get a bank: 1,753 by scene name, 15 by audio name, 174 from their master. That is 443 banks in all.
    • 139 masters place 1,246 slots, all on catalogued scenes; 129 masters have a bank.
    • The same rule on salted names matches no bank.
    • The issue's counts (245 masters, 2,308 placements, 240 audio names) come from 46 scene directories, more than this pack holds. Our largest master has 69 slots over 877 s. The 42-slot intro master is not in our copy.
**@⁠holdmysocks** on GitHub · 2026-11-28 03:42 UTC · [original](https://github.com/holdmysocks/SixNG/pull/528) `holdmysocks:claude/cutscene-audio-banks` → `master` · +486 −12 · 6 files · 1 commits · merged 2026-11-28 03:49 UTC ### Summary Reproduces issue #516 on our copy and wires both parts into `sixng cutscenes`. - **Audio banks.** With the archive's audio index, each scene gets its bank. A bank counts when it holds two or more of the streams `joaat("<name>.<channel>") & 0x1FFFFFFF` (channels `c`, `l`, `r`, `ad`, `ls`, `rs`, `music.l`, `music.r`) and no other bank does. Names are tried in this order: - the scene name; - the scene name without `_pN` / `_tNN` / `_xN`; - the audio name in its scene files (struct `db646fb2`, member `52c09a55`), dropping leading words until a name has a bank; - else the bank of the masters that place it, when they agree. Each scene reports the name, its source, the bank offset and each channel's stream id and length. - **Master timelines.** Scene files with a start-time map keep their timeline in the catalog, including masters without object records. The catalog version goes to 5, so the first run rescans. Start ids resolve through the id map to a `fwAnimSceneReferenceSectionData`, either directly or through `fwAnimSceneCompositeSectionData` (its id `9a3e57d2`, else its `sectionIds`). The catalog also stores each scene file's audio names. - Each scene lists its `placements`: master, start, end (the next start), section and `bank_time` (the start minus the master's earliest start). - Each scene also lists the masters' own banks (`master_audio`). - The report gains `master_timelines` totals and per-source bank counts. - The struct and member names come from vihook's `par_names.txt` (MIT). The names are credited in THIRD_PARTY_NOTICES.md; no part of that file is included. - README: the Cutscenes section explains both parts and gives the counts. ### Validation - New synthetic tests: - the issue's test vector (`air_tail_int` `.c` / `.l` / `.r` / `.ad`); - suffix stripping; - timeline resolution (direct, through a composite, through its section list, a loop, a missing id, a repeated start); - bank matching (a single channel is ignored, a name split over two banks is left out, a `<mission>_<scene>` audio name); - the fallback to the master's bank. - `cargo test` passed locally on Windows for sixng-core and sixng-cli, plus the sixng-gui scenes tests. `cargo check --workspace --release` is clean. - Local run on the current Xbox build, story pack: - 1,942 of 2,824 scenes get a bank: 1,753 by scene name, 15 by audio name, 174 from their master. That is 443 banks in all. - 139 masters place 1,246 slots, all on catalogued scenes; 129 masters have a bank. - The same rule on salted names matches no bank. - The issue's counts (245 masters, 2,308 placements, 240 audio names) come from 46 scene directories, more than this pack holds. Our largest master has 69 slots over 877 s. The 42-slot intro master is not in our copy.
Scenes get their audio bank from joaat("<name>.<channel>") & 0x1FFFFFFF
stream ids (scene name, name without suffixes, scene-file audio name or
the master that places them). Scene files with a master timeline keep it
in the catalog (version 5), and scenes list where masters place them,
with the start on the bank clock. Struct and member names from vihook's
par_names.txt, credited in THIRD_PARTY_NOTICES.md.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 03:43:59 +00:00
github-bot changed target branch from master to gh-pr/528/base 2026-11-28 03:55:30 +00:00
github manually merged commit 96dac0fdbb into gh-pr/528/base 2026-11-28 03:55:31 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.