WIP: feat(content): an actor's animations may be the game's own, and its table row names them too #3283
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/mods
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3283
Loading…
Reference in a new issue
No description provided.
Delete branch "dyst/Longshot:feat/content-game-animations-main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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,animationswrote 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).animationsnow 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.adda 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.Read first:
game/crates/content/src/plan/outputs.rs(the animation outputs and the ActorInfo row), thenplan/declare.rs(animations' forms),patch/apply.rsandpatch/parse.rs(the rowsadd), andapi/src/loader/stage.rs(reading the game's files). The schema is ingame/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):
{ from }), it stood.{ 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 testofgame-core,api,content,schema,schema-genandmodtool(new vectors incontent/vectors/content.jsonfor the rowsadd),cargo clippy -D warnings,cargo fmt --checkandschema-gen --checkpass on the head.Still to test:
{ from }, a walk from{ game }), expecting the same result as above (by hand).{ 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
animationsbefore 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.Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named). The crates' cargo checks pass; the whole suite has not run on this head yet.main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.When it applies
Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
`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]>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.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.