WIP: feat(content): an actor's animations may be the game's own, and its table row names them too #3283

Draft
dyst wants to merge 1 commit from dyst/Longshot:feat/content-game-animations-main into main
Member

Summary

A mod's new actor (content.actor, a copy of a game actor) can only get animations from files the mod ships. Often the clips it needs are already in the game: another actor's walk, a standing pose. Also, animations wrote only the Animation component, but the game reads the actor's ActorInfo row, which names the same files. So a copy with new animations kept the old ones in the game.

What this changes:

  • animations: [{ from: "<actor>" }] gives the actor another game actor's animation files, and [{ game: "<file>" }] one of the game's by name. Both are read from the player's own game, so nothing of the game is in the mod (content.actor.gameAnimations).
  • animations now writes the ActorInfo row's list too. Of 148 actors compared, the two lists are the same in all of them, and the row is what a run showed the game reads.
  • A rows patch can add a value inside a row (a place in one of its lists, by path), so two mods that add to the same list both keep their entries.
  • As the content is made, the log names a walker with no walk clip and a character with no standing clip.

Read first: game/crates/content/src/plan/outputs.rs (the animation outputs and the ActorInfo row), then plan/declare.rs (animations' forms), patch/apply.rs and patch/parse.rs (the rows add), and api/src/loader/stage.rs (reading the game's files). The schema is in game/modapi/schema/content.toml.

Testing

Tested: Windows 11, RTX 3080, NVIDIA 621.47, hidden window, in Kokiri Forest, on the earlier mod API branch this was ported from (the same change, before the mod API's squash into main):

  • A copy whose own files have no standing clip held its arms out. With another actor's files ({ from }), it stood.
  • A copy with no walk clip stayed where it was placed. With a file of the game's ({ game }), it walked its patrol.

Since the port onto main (rebased onto de6fb7b5d), the same commit also ran in the game as part of a larger local branch of content API work, but no test there used animations.

Checks: cargo test of game-core, api, content, schema, schema-gen and modtool (new vectors in content/vectors/content.json for the rows add), cargo clippy -D warnings, cargo fmt --check and schema-gen --check pass on the head.

Still to test:

  • Windows, this head: the same two copies (a stand from { from }, a walk from { game }), expecting the same result as above (by hand).
  • Linux: a mod with { game } animations, expecting the files read from the player's game the same way (by hand).

Measurements

Nothing to measure: this changes what the content stage writes when a mod declares an actor. It runs while mods are prepared, not during play.

Risks

  • A mod that set animations before now also changes the actor's ActorInfo row. That is what the mod asked for, but an actor that relied on the old row changes.
  • Nothing changes for players without such mods. A revert is enough.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says. Run in the game before the port; this head owes the same run.
  • mise run test passes (any failure that also fails on main is named). The crates' cargo checks pass; the whole suite has not run on this head yet.
  • Measured against main, or Measurements says why there is nothing to measure.
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

When it applies

  • Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. Windows only so far.
  • Docs updated.
  • AI assistance recorded with Assisted-by: / Co-Authored-By: trailers.

Ready to merge

  • Everything in Still to test has run, its results in Tested.
  • Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers").
  • Approved in review, every comment answered.
  • CI passes on the head; on current main, measured again or a comment says why the numbers still hold.

🤖 Generated with Claude Code

## Summary A mod's new actor (`content.actor`, a copy of a game actor) can only get animations from files the mod ships. Often the clips it needs are already in the game: another actor's walk, a standing pose. Also, `animations` wrote only the Animation component, but the game reads the actor's ActorInfo row, which names the same files. So a copy with new animations kept the old ones in the game. What this changes: - `animations: [{ from: "<actor>" }]` gives the actor another game actor's animation files, and `[{ game: "<file>" }]` one of the game's by name. Both are read from the player's own game, so nothing of the game is in the mod (`content.actor.gameAnimations`). - `animations` now writes the ActorInfo row's list too. Of 148 actors compared, the two lists are the same in all of them, and the row is what a run showed the game reads. - A rows patch can `add` a value inside a row (a place in one of its lists, by path), so two mods that add to the same list both keep their entries. - As the content is made, the log names a walker with no walk clip and a character with no standing clip. Read first: `game/crates/content/src/plan/outputs.rs` (the animation outputs and the ActorInfo row), then `plan/declare.rs` (`animations`' forms), `patch/apply.rs` and `patch/parse.rs` (the rows `add`), and `api/src/loader/stage.rs` (reading the game's files). The schema is in `game/modapi/schema/content.toml`. ## Testing **Tested:** Windows 11, RTX 3080, NVIDIA 621.47, hidden window, in Kokiri Forest, on the earlier mod API branch this was ported from (the same change, before the mod API's squash into main): - A copy whose own files have no standing clip held its arms out. With another actor's files (`{ from }`), it stood. - A copy with no walk clip stayed where it was placed. With a file of the game's (`{ game }`), it walked its patrol. Since the port onto main (rebased onto de6fb7b5d), the same commit also ran in the game as part of a larger local branch of content API work, but no test there used animations. Checks: `cargo test` of `game-core`, `api`, `content`, `schema`, `schema-gen` and `modtool` (new vectors in `content/vectors/content.json` for the rows `add`), `cargo clippy -D warnings`, `cargo fmt --check` and `schema-gen --check` pass on the head. **Still to test:** - Windows, this head: the same two copies (a stand from `{ from }`, a walk from `{ game }`), expecting the same result as above (by hand). - Linux: a mod with `{ game }` animations, expecting the files read from the player's game the same way (by hand). ## Measurements Nothing to measure: this changes what the content stage writes when a mod declares an actor. It runs while mods are prepared, not during play. ## Risks - A mod that set `animations` before now also changes the actor's ActorInfo row. That is what the mod asked for, but an actor that relied on the old row changes. - Nothing changes for players without such mods. A revert is enough. ## Checklist ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [ ] Tested on my own PC, in the game for a change the game runs, as Testing says. Run in the game before the port; this head owes the same run. - [ ] `mise run test` passes (any failure that also fails on `main` is named). The crates' cargo checks pass; the whole suite has not run on this head yet. - [x] Measured against `main`, or Measurements says why there is nothing to measure. - [x] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. ### When it applies - [ ] Host code builds on Windows (llvm-mingw) and Linux, with UTF-8 paths. Windows only so far. - [x] Docs updated. - [x] AI assistance recorded with `Assisted-by:` / `Co-Authored-By:` trailers. ### Ready to merge - [ ] Everything in Still to test has run, its results in Tested. - [ ] Tier 1 hardware it can affect is tested (docs/dev/standards.md, "Hardware tiers"). - [ ] Approved in review, every comment answered. - [ ] CI passes on the head; on current `main`, measured again or a comment says why the numbers still hold. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
feat(content): an actor's animations may be the game's own, and its table row names them too
Some checks are pending
PR description / Title and description (pull_request_target) Waiting to run
CI / What the change needs (pull_request) Waiting to run
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Waiting to run
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
d2096d4eff
`animations: [{ from: "<actor>" }]` gives an actor another game actor's animation files, `[{ game: "<file>" }]` one of
the game's by name: read from the player's game, nothing of it in the mod (`content.actor.gameAnimations`).

`animations` wrote the Animation component only. The ActorInfo row names the same files (the two lists are the same in
each of the 148 actors compared) and is what a run has shown the game read, so both are written. The rows patch gets an
`add` with a path, a value put inside a row (a place of one of its lists), so two mods' additions are both there.

A walker with no clip of a walk, and a character with none of standing, is named in the log as its content is made.

Run in the game (Windows, RTX 3080, hidden, Kokiri Forest): a copy with no clip of standing holds its arms out and stands
with another actor's files; one with no walk stays where it is placed and walks its patrol with a file of the game's.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Tested in game: Windows 11, RTX 3080, NVIDIA 621.47, hidden window, Kokiri Forest, on the mod API branch this was ported from (the same change): a copy with no standing clip stood with another actor's files ({ from }); one with no walk walked its patrol with a file of the game's ({ game }). This head (on main de6fb7b5d) owes the same run.

Tested in game: Windows 11, RTX 3080, NVIDIA 621.47, hidden window, Kokiri Forest, on the mod API branch this was ported from (the same change): a copy with no standing clip stood with another actor's files ({ from }); one with no walk walked its patrol with a file of the game's ({ game }). This head (on main de6fb7b5d) owes the same run.
Some checks are pending
PR description / Title and description (pull_request_target) Waiting to run
CI / What the change needs (pull_request) Waiting to run
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Blocked by required conditions
CI / Third-party parts and guide screenshots (pull_request) Waiting to run
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Blocked by required conditions
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Blocked by required conditions
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Blocked by required conditions
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Blocked by required conditions
CI / Website build and checks (pull_request) Blocked by required conditions
This pull request has changes conflicting with the target branch.
  • docs/modding/permissions.md
  • docs/modding/reference.md
  • docs/modding/scripting.md
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'feat/content-game-animations-main:dyst-feat/content-game-animations-main'
git switch 'dyst-feat/content-game-animations-main'
Sign in to join this conversation.
No reviewers
No milestone
No project
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
MagicBeanDev/Longshot!3283
No description provided.