Cutscenes: master state machines (#516) #535

Manually merged
github merged 1 commit from github-bot/gh-535 into gh-pr/535/base 2026-11-28 05:02:48 +00:00 AGit
Owner

@⁠holdmysocks on GitHub · 2026-11-28 04:47 UTC · original
holdmysocks:claude/cutscene-transitions → master · +389 −14 · 4 files · 1 commits · merged 2026-11-28 05:00 UTC

Summary

Follow-up to #528 for issue #516: sixng cutscenes decodes each master's state machine.

  • States: a master's states are keys of its id map. Each state's item (struct a90b7f7e) lists the start-map keys the state plays (member 32c69aae).
  • Transitions: each one gives the state it leads to (toState). Its condition set is counted two ways:
    • on_end: a condition (struct 57439252) names the transition's own source state, which reads "when this state ends";
    • entity-value tests (struct d5f7c394), which read as branches.
  • Catalog: the catalog stores states and transitions per master. Its version goes to 6, so the first run rescans.
    • Each slot keeps its start-map key.
    • A file can hold its start map twice under other keys. The repeats merge into one slot whose also lists the other keys, so a state that lists either key still finds its start.
  • Report:
    • --masters lists each master's slots (start, end, scene name, section), its states (start times, plus each transition's target start, on_end and condition counts) and its bank.
    • master_timelines.state_machines gives the totals: states, end states, transitions, on_end, branches, and transitions forward, to the next start, back or unplaced.
  • README: the Cutscenes section explains the state machines and gives the counts.

Validation

  • New synthetic tests:
    • condition counting, with a nested condition list and a state condition naming another state;
    • the masters report and totals: forward, next-start, backward and unplaced transitions, an end state, a listed key with no slot, and a state found through a repeat key;
    • the timeline merging a repeated start under another key.
  • cargo test passed locally on Windows for sixng-core (cutscene tests) and sixng-cli, plus the sixng-gui scenes tests.
    • One full run failed atomic::tests::overlapping_writers_leave_one_whole_file, which this change doesn't touch; it passed three reruns on its own.
  • Local run on the current Xbox build, story pack:
    • 139 masters, 929 states (256 end states) and 797 transitions;
    • 760 transitions are on_end, 211 have a branch;
    • by earliest start: 755 lead forward (534 to the next start), 37 back, 5 are unplaced;
    • slots stay at 1,246, and 1,942 scenes still get a bank.
**@⁠holdmysocks** on GitHub · 2026-11-28 04:47 UTC · [original](https://github.com/holdmysocks/SixNG/pull/535) `holdmysocks:claude/cutscene-transitions` → `master` · +389 −14 · 4 files · 1 commits · merged 2026-11-28 05:00 UTC ### Summary Follow-up to #528 for issue #516: `sixng cutscenes` decodes each master's state machine. - **States:** a master's states are keys of its id map. Each state's item (struct `a90b7f7e`) lists the start-map keys the state plays (member `32c69aae`). - **Transitions:** each one gives the state it leads to (`toState`). Its condition set is counted two ways: - `on_end`: a condition (struct `57439252`) names the transition's own source state, which reads "when this state ends"; - entity-value tests (struct `d5f7c394`), which read as branches. - **Catalog:** the catalog stores states and transitions per master. Its version goes to 6, so the first run rescans. - Each slot keeps its start-map key. - A file can hold its start map twice under other keys. The repeats merge into one slot whose `also` lists the other keys, so a state that lists either key still finds its start. - **Report:** - `--masters` lists each master's slots (start, end, scene name, section), its states (start times, plus each transition's target start, `on_end` and condition counts) and its bank. - `master_timelines.state_machines` gives the totals: states, end states, transitions, `on_end`, branches, and transitions forward, to the next start, back or unplaced. - **README:** the Cutscenes section explains the state machines and gives the counts. ### Validation - New synthetic tests: - condition counting, with a nested condition list and a state condition naming another state; - the masters report and totals: forward, next-start, backward and unplaced transitions, an end state, a listed key with no slot, and a state found through a repeat key; - the timeline merging a repeated start under another key. - `cargo test` passed locally on Windows for sixng-core (cutscene tests) and sixng-cli, plus the sixng-gui scenes tests. - One full run failed `atomic::tests::overlapping_writers_leave_one_whole_file`, which this change doesn't touch; it passed three reruns on its own. - Local run on the current Xbox build, story pack: - 139 masters, 929 states (256 end states) and 797 transitions; - 760 transitions are `on_end`, 211 have a branch; - by earliest start: 755 lead forward (534 to the next start), 37 back, 5 are unplaced; - slots stay at 1,246, and 1,942 scenes still get a bank.
Masters keep their states (id-map keys listing the start keys they play)
and transitions (toState, with conditions counted as 'when this state
ends' or entity-value branches) in the catalog (version 6). Slots keep
their start-map key, and repeated start maps merge into one slot with the
other keys. sixng cutscenes --masters lists each master's slots, states,
transitions and bank; master_timelines.state_machines counts them.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 04:51:37 +00:00
github-bot changed target branch from master to gh-pr/535/base 2026-11-28 05:02:45 +00:00
github manually merged commit e499dc0510 into gh-pr/535/base 2026-11-28 05:02:48 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.