Cutscene audio: stream ids of the scene banks, and the scene files' timeline (formulas and counts) #516

Open
opened 2026-11-27 22:47:47 +00:00 by github-bot · 2 comments
Owner

@⁠Elijah-J on GitHub · 2026-11-27 22:46 UTC · original

Two things measured on the Xbox 1.0.2.1 build that the README and cutscene.rs list as open. Format facts and counts only; no game data is attached.

1. Cutscene bank streams are named after the scene

stream_id = joaat(lowercase("<scene>.<channel>")) & 0x1FFFFFFF
Channel What it holds
c centre: the scene's dialogue
l, r the stereo mix
ad audio description narration
ls, rs, music.l, music.r present on a few banks

<scene> is the cutscene name (cin@<scene>, numbered sections removed).

Test vector: air_tail_int gives .c 0x106b5e4b, .l 0x045b8607, .r 0x1f3efbbf, .ad 0x16735206.

Counts:

  • Four control banks: 16 of 16 predicted ids are in the bank headers.
  • 2,578 distinct scene names from the story pack's clip dictionaries: 265 banks that had no name matched on three or more channels. The same run with salted names matched none.
  • The scene files store the audio name themselves (section 2). 236 of 240 of those names resolve to exactly one bank each, accepting a bank only on two or more channels. Of the 236 banks, 214 have c/l/r/ad, 19 add music.l/music.r, 2 have all eight channels and 1 has c/l/r/ad/ls/rs.

Ids are 29 bits, so one matching channel is not enough. Two or more channels of one name in one bank is the test used here.

Scope: this names the streams and ties each bank to its scene. It does not give the bank's container hash (<pack>/<bank>), which the README lists as unknown. I have not found that.

2. Scene files: the timeline

Names (public, not my work)

These struct and member hashes are named in vihook's scripts/data/par_names.txt (MIT). Member hashes are case-sensitive joaat.

Hash Name
7f09852f fwAnimSceneReferenceSectionData
c8d51b9e fwAnimSceneCompositeSectionData
64e8ac67 fwAnimSceneSectionData
eed7e46f fwAnimSceneEventListData
2e338a28 fwAnimSceneSubtitleEventData
865451b7 fwAnimScenePlayConversationAudioEventData
dd71c9b4 rage__fwDataFsmState
891b2a0f rage__fwDataFsmStateTransition
fafe97a5 sceneId
1a43c2eb sectionId
379a4935 sectionIds
929db78d startTime
2b30c60b endTime
6b2e466b offsetTime
14ff380c TextLabelName
18c7fcea MissionId
b0fc1c4f transitions
2f6e2b9a toState
e6e17f14 name

Structure (my reading)

  • Each cutscene directory has one master scene beside its child states. A scene file is a master when it holds fwAnimSceneReferenceSectionData records and a start-time map.
  • The start-time map is the container struct 0x103: 8-byte entries, u32 id then f32 seconds. The id map is the container struct 0x101: 16-byte entries, id then a typed pointer.
  • A start-time id resolves through the id map to a reference section, either directly or through a composite section whose member 9a3e57d2 (not named) holds the reference id.
  • In a reference section, sceneId is the child state's key and sectionId names one composite section inside that child.
  • A composite section's sectionIds lists the sections it plays. So a slot on the master clock is a pair, child state and section. Each slot runs from zero and ends at the next start in the master's timeline.
  • The audio name is a string in struct db646fb2, member 52c09a55 (neither is named), of the form <mission>_<scene>, for example air_tail_air_tail_int. Lower-case it and drop leading tokens until the rule in section 1 matches a bank.
  • Bank time = master time minus the earliest start in the master's timeline.
  • Bink movies played in a scene: the declaration is struct e9e8e1af, with the movie path in member 2c1b548c and a float in 8bdef590. binkOffsetTime reproduces that hash but is not in the vihook list. The event is struct 1e27ae1b: member d40d4130 points to the declaration, beside startTime, endTime and offsetTime.

Counts

  • 46 scene directories read: 245 master scenes with 2,308 child placements.
  • Intro master: 42 start times from 0 to 314.93 s tile its 42 child states with no gap over 14 microseconds.
  • Bank clock: with each master's subtitle events placed on the bank clock and slid against the .c stream, the best lag is within 0.2 s of zero on 35 of 50 banks, with a peak at least 6 dB over the median.

Not established

  • The subtitle check supports the bank clock. It says nothing about where a movie starts.
  • I read movie time at an event's start as binkOffsetTime + offsetTime. Neither the sign nor the meaning is checked against the picture.
  • Which slot applies when one child state fills two slots of the timeline.
  • The state transitions: named above, not decoded.
  • Four of the 240 audio names do not resolve to a bank.

I can run a check on my copy if a count or vector here does not reproduce.

**@⁠Elijah-J** on GitHub · 2026-11-27 22:46 UTC · [original](https://github.com/holdmysocks/SixNG/issues/516) Two things measured on the Xbox 1.0.2.1 build that the README and `cutscene.rs` list as open. Format facts and counts only; no game data is attached. ## 1. Cutscene bank streams are named after the scene ``` stream_id = joaat(lowercase("<scene>.<channel>")) & 0x1FFFFFFF ``` | Channel | What it holds | |---|---| | `c` | centre: the scene's dialogue | | `l`, `r` | the stereo mix | | `ad` | audio description narration | | `ls`, `rs`, `music.l`, `music.r` | present on a few banks | `<scene>` is the cutscene name (`cin@<scene>`, numbered sections removed). Test vector: `air_tail_int` gives `.c` 0x106b5e4b, `.l` 0x045b8607, `.r` 0x1f3efbbf, `.ad` 0x16735206. Counts: - Four control banks: 16 of 16 predicted ids are in the bank headers. - 2,578 distinct scene names from the story pack's clip dictionaries: 265 banks that had no name matched on three or more channels. The same run with salted names matched none. - The scene files store the audio name themselves (section 2). 236 of 240 of those names resolve to exactly one bank each, accepting a bank only on two or more channels. Of the 236 banks, 214 have `c`/`l`/`r`/`ad`, 19 add `music.l`/`music.r`, 2 have all eight channels and 1 has `c`/`l`/`r`/`ad`/`ls`/`rs`. Ids are 29 bits, so one matching channel is not enough. Two or more channels of one name in one bank is the test used here. Scope: this names the streams and ties each bank to its scene. It does not give the bank's container hash (`<pack>/<bank>`), which the README lists as unknown. I have not found that. ## 2. Scene files: the timeline ### Names (public, not my work) These struct and member hashes are named in vihook's `scripts/data/par_names.txt` (MIT). Member hashes are case-sensitive joaat. | Hash | Name | |---|---| | `7f09852f` | `fwAnimSceneReferenceSectionData` | | `c8d51b9e` | `fwAnimSceneCompositeSectionData` | | `64e8ac67` | `fwAnimSceneSectionData` | | `eed7e46f` | `fwAnimSceneEventListData` | | `2e338a28` | `fwAnimSceneSubtitleEventData` | | `865451b7` | `fwAnimScenePlayConversationAudioEventData` | | `dd71c9b4` | `rage__fwDataFsmState` | | `891b2a0f` | `rage__fwDataFsmStateTransition` | | `fafe97a5` | `sceneId` | | `1a43c2eb` | `sectionId` | | `379a4935` | `sectionIds` | | `929db78d` | `startTime` | | `2b30c60b` | `endTime` | | `6b2e466b` | `offsetTime` | | `14ff380c` | `TextLabelName` | | `18c7fcea` | `MissionId` | | `b0fc1c4f` | `transitions` | | `2f6e2b9a` | `toState` | | `e6e17f14` | `name` | ### Structure (my reading) - Each cutscene directory has one master scene beside its child states. A scene file is a master when it holds `fwAnimSceneReferenceSectionData` records and a start-time map. - The start-time map is the container struct `0x103`: 8-byte entries, u32 id then f32 seconds. The id map is the container struct `0x101`: 16-byte entries, id then a typed pointer. - A start-time id resolves through the id map to a reference section, either directly or through a composite section whose member `9a3e57d2` (not named) holds the reference id. - In a reference section, `sceneId` is the child state's key and `sectionId` names one composite section inside that child. - A composite section's `sectionIds` lists the sections it plays. So a slot on the master clock is a pair, child state and section. Each slot runs from zero and ends at the next start in the master's timeline. - The audio name is a string in struct `db646fb2`, member `52c09a55` (neither is named), of the form `<mission>_<scene>`, for example `air_tail_air_tail_int`. Lower-case it and drop leading tokens until the rule in section 1 matches a bank. - Bank time = master time minus the earliest start in the master's timeline. - Bink movies played in a scene: the declaration is struct `e9e8e1af`, with the movie path in member `2c1b548c` and a float in `8bdef590`. `binkOffsetTime` reproduces that hash but is not in the vihook list. The event is struct `1e27ae1b`: member `d40d4130` points to the declaration, beside `startTime`, `endTime` and `offsetTime`. ### Counts - 46 scene directories read: 245 master scenes with 2,308 child placements. - Intro master: 42 start times from 0 to 314.93 s tile its 42 child states with no gap over 14 microseconds. - Bank clock: with each master's subtitle events placed on the bank clock and slid against the `.c` stream, the best lag is within 0.2 s of zero on 35 of 50 banks, with a peak at least 6 dB over the median. ### Not established - The subtitle check supports the bank clock. It says nothing about where a movie starts. - I read movie time at an event's start as `binkOffsetTime + offsetTime`. Neither the sign nor the meaning is checked against the picture. - Which slot applies when one child state fills two slots of the timeline. - The state transitions: named above, not decoded. - Four of the 240 audio names do not resolve to a bank. I can run a check on my copy if a count or vector here does not reproduce.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 22:47:47 +00:00
Author
Owner

@⁠holdmysocks on GitHub · 2026-11-28 02:42 UTC · original

Thanks, this is a really useful write-up, and the test vector and counts make it easy to check.

We'll reproduce both parts on our copy (the <scene>.<channel> stream ids against the bank headers, and the master-scene timeline with the start-time and id maps) and, if they hold, wire them into the cutscene audio so scene banks and subtitles line up on the bank clock. If we use the struct and member names from vihook's par_names.txt, we'll credit it in THIRD_PARTY_NOTICES.md under its MIT licence.

I'll post here once it's checked, with anything that doesn't reproduce.

**@⁠holdmysocks** on GitHub · 2026-11-28 02:42 UTC · [original](https://github.com/holdmysocks/SixNG/issues/516#issuecomment-7232547385) Thanks, this is a really useful write-up, and the test vector and counts make it easy to check. We'll reproduce both parts on our copy (the `<scene>.<channel>` stream ids against the bank headers, and the master-scene timeline with the start-time and id maps) and, if they hold, wire them into the cutscene audio so scene banks and subtitles line up on the bank clock. If we use the struct and member names from vihook's `par_names.txt`, we'll credit it in `THIRD_PARTY_NOTICES.md` under its MIT licence. I'll post here once it's checked, with anything that doesn't reproduce.
Author
Owner

@⁠holdmysocks on GitHub · 2026-11-28 12:13 UTC · original

Both parts reproduce on our copy, and they're now wired into sixng cutscenes (#528).

Stream ids: your test vector matches exactly. With scene names stripped of their _pN / _tNN / _xN suffixes and the same two-channels-in-one-bank rule, 435 banks match on our copy; salted names match none. Channel sets: c/l/r/ad on 422 banks, plus music.l/music.r on 9, plus ls/rs on 3, and all eight on 1.

Timelines: the start-time map (0x103) and id map (0x101) resolve through the reference and composite sections as you describe. Our copy holds fewer scenes than yours: 139 masters with 1,246 slots in story000, plus 12 more masters in story000_restofworld; the 42-start intro master isn't in it (our largest has 69 slots over 877 s). Audio names: 135 of 139 resolve to exactly one bank after dropping leading words, and the same pattern of 4 fails as in your 236 of 240.

In #528, 1,942 of 2,824 scenes get a bank (443 banks), and 129 of the 139 masters do.

Bank clock: it holds here too. We placed the subtitle events from the child scene files on the bank clock, using only slots whose child state fills a single slot (427 slots, 1,423 events), and scored the .c stream's mean amplitude inside the subtitle intervals at lags from −3 to +3 s. The best lag is within 0.2 s of zero on 70 of 98 masters with a bank, against 8 of 98 for a mismatched control. With every slot placed, it holds better still: subtitle times count from the start of the composite section the slot's sectionId names (its layers all start at 0), so a line's bank time is the slot's start plus the line's start; then 81 of 95 masters peak within 0.2 s (2,890 lines), against 7 of 95 for the control. sixng cutscenes now puts 3,176 subtitle lines on a bank clock (#543, #546). One detail you may find useful: on our copy a cutscene bank is a single multichannel stream (id 0), and the c/l/r/ad… ids are its sub-stream entries rather than streams with their own data.

Bink movies: the structure reproduces: 912 movie events (1e27ae1b) in 356 child scene files, each pointing (d40d4130) to its own declaration (e9e8e1af), and case-sensitive joaat confirms binkOffsetTime = 8bdef590, as well as binkName = 2c1b548c and shouldLoop = 0d598e3f. On our copy, though, binkName is empty in all 912 declarations; the movie seems to be named by a u64 member, 495e253b (71 distinct non-zero values), which we haven't matched to anything yet, so we can't tie events to a .bk2. d565a11c holds the render target (textureName as a joaat, plus width and height). If your copy has non-empty binkName strings, or you know what 495e253b hashes, that would close the gap. We haven't checked movie time against the picture either.

Transitions, and which slot applies: the master's states (rage__fwDataFsmState) are keys of its id map, and each state's item (struct a90b7f7e) lists the start keys it plays in member 32c69aae (1,275 of 1,292 starts belong to a state, on 151 masters). Of 822 transitions, 785 have a condition struct 57439252 whose f82a367d is the transition's own source state, which reads as "when this state ends"; 236 are entity-name/value tests (struct d5f7c394), which read as branch choices. For a child state that fills several slots, it's usually all of them in turn: 237 of 241 such children use a different section per slot, and only 19 are true alternatives on separate branches. The entity tests are fwAnimSceneConditionString: entityName keys a string entity of the scene (fwAnimSceneStringData, value 0 in the files, so script-set), value is the lower-case joaat it must equal (or differ from, with invert). The commonest are which lead plays (jason / lucia, 153), s_relationship (low / medium / high, 121) and yes/no choices (36). The machine also has a start-transition array (c500427b, no source state; 293 transitions, 214 with string tests) that picks the state each master starts in (#551).

One question: we credit vihook's par_names.txt in THIRD_PARTY_NOTICES.md as "the vihook contributors" under MIT. Could you point us to the repository (and its copyright line, if it has one) so we can credit it properly?

Thanks again, this was a very clean write-up to check.

**@⁠holdmysocks** on GitHub · 2026-11-28 12:13 UTC · [original](https://github.com/holdmysocks/SixNG/issues/516#issuecomment-7239082646) Both parts reproduce on our copy, and they're now wired into `sixng cutscenes` (#528). **Stream ids:** your test vector matches exactly. With scene names stripped of their `_pN` / `_tNN` / `_xN` suffixes and the same two-channels-in-one-bank rule, 435 banks match on our copy; salted names match none. Channel sets: `c`/`l`/`r`/`ad` on 422 banks, plus `music.l`/`music.r` on 9, plus `ls`/`rs` on 3, and all eight on 1. **Timelines:** the start-time map (`0x103`) and id map (`0x101`) resolve through the reference and composite sections as you describe. Our copy holds fewer scenes than yours: 139 masters with 1,246 slots in `story000`, plus 12 more masters in `story000_restofworld`; the 42-start intro master isn't in it (our largest has 69 slots over 877 s). Audio names: 135 of 139 resolve to exactly one bank after dropping leading words, and the same pattern of 4 fails as in your 236 of 240. In #528, 1,942 of 2,824 scenes get a bank (443 banks), and 129 of the 139 masters do. **Bank clock:** it holds here too. We placed the subtitle events from the child scene files on the bank clock, using only slots whose child state fills a single slot (427 slots, 1,423 events), and scored the `.c` stream's mean amplitude inside the subtitle intervals at lags from −3 to +3 s. The best lag is within 0.2 s of zero on 70 of 98 masters with a bank, against 8 of 98 for a mismatched control. With every slot placed, it holds better still: subtitle times count from the start of the composite section the slot's `sectionId` names (its layers all start at 0), so a line's bank time is the slot's start plus the line's start; then 81 of 95 masters peak within 0.2 s (2,890 lines), against 7 of 95 for the control. `sixng cutscenes` now puts 3,176 subtitle lines on a bank clock (#543, #546). One detail you may find useful: on our copy a cutscene bank is a single multichannel stream (id 0), and the `c`/`l`/`r`/`ad`… ids are its sub-stream entries rather than streams with their own data. **Bink movies:** the structure reproduces: 912 movie events (`1e27ae1b`) in 356 child scene files, each pointing (`d40d4130`) to its own declaration (`e9e8e1af`), and case-sensitive joaat confirms `binkOffsetTime` = `8bdef590`, as well as `binkName` = `2c1b548c` and `shouldLoop` = `0d598e3f`. On our copy, though, `binkName` is empty in all 912 declarations; the movie seems to be named by a u64 member, `495e253b` (71 distinct non-zero values), which we haven't matched to anything yet, so we can't tie events to a `.bk2`. `d565a11c` holds the render target (`textureName` as a joaat, plus width and height). If your copy has non-empty `binkName` strings, or you know what `495e253b` hashes, that would close the gap. We haven't checked movie time against the picture either. **Transitions, and which slot applies:** the master's states (`rage__fwDataFsmState`) are keys of its id map, and each state's item (struct `a90b7f7e`) lists the start keys it plays in member `32c69aae` (1,275 of 1,292 starts belong to a state, on 151 masters). Of 822 transitions, 785 have a condition struct `57439252` whose `f82a367d` is the transition's own source state, which reads as "when this state ends"; 236 are entity-name/value tests (struct `d5f7c394`), which read as branch choices. For a child state that fills several slots, it's usually all of them in turn: 237 of 241 such children use a different section per slot, and only 19 are true alternatives on separate branches. The entity tests are `fwAnimSceneConditionString`: `entityName` keys a string entity of the scene (`fwAnimSceneStringData`, value 0 in the files, so script-set), `value` is the lower-case joaat it must equal (or differ from, with `invert`). The commonest are which lead plays (`jason` / `lucia`, 153), `s_relationship` (`low` / `medium` / `high`, 121) and yes/no choices (36). The machine also has a start-transition array (`c500427b`, no source state; 293 transitions, 214 with string tests) that picks the state each master starts in (#551). One question: we credit vihook's `par_names.txt` in `THIRD_PARTY_NOTICES.md` as "the vihook contributors" under MIT. Could you point us to the repository (and its copyright line, if it has one) so we can credit it properly? Thanks again, this was a very clean write-up to check.
This discussion has been locked. Commenting is limited to contributors.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/holdmysocks--SixNG#516
No description provided.