Cutscenes: what the state machine's string tests check, and its start transitions #551

Manually merged
github merged 1 commit from github-bot/gh-551 into gh-pr/551/base 2026-11-28 08:03:26 +00:00 AGit
Owner

@⁠holdmysocks on GitHub · 2026-11-28 07:39 UTC · original
holdmysocks:claude/cutscene-string-tests → master · +220 −35 · 4 files · 1 commits · merged 2026-11-28 07:55 UTC

Decodes the transitions' entity conditions (struct d5f7c394), one of the open cutscene items in the v0.14.0 known issues, and adds the state machine's start transitions.

What the conditions test

  • d5f7c394 is fwAnimSceneConditionString (case-sensitive joaat).
  • entityName is the key of a string entity of the scene (fwAnimSceneStringData, 21e2cf99). Its value is 0 in the files: the script sets it.
  • value is the joaat (lower case) of the string the variable must equal. With invert, it must differ.
  • The fourth member, 9a04f49a, is 0 in every file.

Start transitions

  • The machine (a2f97c23, member e6cae80a of the scene record) has a second transition array, c500427b. Its transitions have no source state.
  • Every state that no transition leads to (256) is the target of one, so they pick the state the master starts in.

Changes

  • FsmTransition gets tests (variable, value, invert).
  • SceneFile gets fsm_start. Catalog version 9.
  • --masters lists each transition's tests and the master's start transitions. Names come from a short list (s_choice, s_relationship, jason, lucia, yes, no …) and the name dictionary; anything else stays a hash.
  • state_machines gains start_transitions, start_with_tests, string_tests, string_variables and string_tests_named.
  • README and --masters help updated.

Measured on the story pack (139 masters)

  • 293 start transitions: 78 without conditions (the default) and 214 with string tests. Every master has some.
  • 695 string tests over 21 variables: 277 on transitions and 418 on start transitions.
  • The commonest tests:
    • which player character plays (jason / lucia): 153;
    • s_relationship (low / medium / high): 121;
    • a yes/no choice: 36.
  • One variable has 89 values (vehicle models, and places such as Office).
  • 122 tests have both the variable and the value named.
  • The existing totals are unchanged: 929 states, 797 transitions, 211 with branches.

Not done: the other cutscene item (Bink movie id to .bk2 file)
The 64-bit movie id (495e253b, 71 distinct) cannot be tied to a file on this copy:

  • It matches no asset-id hash of about 150,000 scene, clip and dictionary names, with or without .bk2 / movies/ affixes.
  • Its only other place is a weighted pick list in one data PSO: 11 ids, 7 of them movie ids.
  • The render target sizes do not give the video size: one id plays on both 128×128 and 512×1024 targets.
  • Only one id has non-looping events, so event lengths give no durations.
  • movies.rpf's 515 files are unnamed.

The README now says this under "Not decoded".

Tests: cargo test -p sixng-core -p sixng-cli.

**@⁠holdmysocks** on GitHub · 2026-11-28 07:39 UTC · [original](https://github.com/holdmysocks/SixNG/pull/551) `holdmysocks:claude/cutscene-string-tests` → `master` · +220 −35 · 4 files · 1 commits · merged 2026-11-28 07:55 UTC Decodes the transitions' entity conditions (struct `d5f7c394`), one of the open cutscene items in the v0.14.0 known issues, and adds the state machine's start transitions. **What the conditions test** - `d5f7c394` is `fwAnimSceneConditionString` (case-sensitive joaat). - `entityName` is the key of a string entity of the scene (`fwAnimSceneStringData`, `21e2cf99`). Its value is 0 in the files: the script sets it. - `value` is the joaat (lower case) of the string the variable must equal. With `invert`, it must differ. - The fourth member, `9a04f49a`, is 0 in every file. **Start transitions** - The machine (`a2f97c23`, member `e6cae80a` of the scene record) has a second transition array, `c500427b`. Its transitions have no source state. - Every state that no transition leads to (256) is the target of one, so they pick the state the master starts in. **Changes** - `FsmTransition` gets `tests` (variable, value, invert). - `SceneFile` gets `fsm_start`. Catalog version 9. - `--masters` lists each transition's tests and the master's `start` transitions. Names come from a short list (`s_choice`, `s_relationship`, `jason`, `lucia`, `yes`, `no` …) and the name dictionary; anything else stays a hash. - `state_machines` gains `start_transitions`, `start_with_tests`, `string_tests`, `string_variables` and `string_tests_named`. - README and `--masters` help updated. **Measured on the story pack (139 masters)** - 293 start transitions: 78 without conditions (the default) and 214 with string tests. Every master has some. - 695 string tests over 21 variables: 277 on transitions and 418 on start transitions. - The commonest tests: - which player character plays (`jason` / `lucia`): 153; - `s_relationship` (`low` / `medium` / `high`): 121; - a yes/no choice: 36. - One variable has 89 values (vehicle models, and places such as `Office`). - 122 tests have both the variable and the value named. - The existing totals are unchanged: 929 states, 797 transitions, 211 with branches. **Not done: the other cutscene item (Bink movie id to `.bk2` file)** The 64-bit movie id (`495e253b`, 71 distinct) cannot be tied to a file on this copy: - It matches no asset-id hash of about 150,000 scene, clip and dictionary names, with or without `.bk2` / `movies/` affixes. - Its only other place is a weighted pick list in one data PSO: 11 ids, 7 of them movie ids. - The render target sizes do not give the video size: one id plays on both 128×128 and 512×1024 targets. - Only one id has non-looping events, so event lengths give no durations. - `movies.rpf`'s 515 files are unnamed. The README now says this under "Not decoded". Tests: `cargo test -p sixng-core -p sixng-cli`.
The entity conditions (d5f7c394) are fwAnimSceneConditionString: a
scene string variable (entityName) must equal, or with invert differ
from, the string whose joaat is value. Transitions now carry their
tests, and each master gets its start transitions (c500427b of the
machine), which pick the state it starts in. --masters lists both with
names where known; state_machines counts them. Catalog version 9.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 07:50:32 +00:00
github-bot changed target branch from master to gh-pr/551/base 2026-11-28 08:03:25 +00:00
github manually merged commit 4c1c937737 into gh-pr/551/base 2026-11-28 08:03:26 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.