feat(api): content.path, content.patrol and content.schedule, a character's walk by the game's own schedule #2620

Merged
HumanBean merged 8 commits from snaildev99/Longshot:feat/mod-api-paths into mod-api 2026-11-26 18:24:08 +00:00
Contributor

Summary

A mod could not give a character a route. To have an NPC walk somewhere, a script had to move it every frame, which jitters and has none of the game's walking: no turning into a bend, no stepping around things, no finding the way back. This adds three content declarations that write the game's own data for a walker, so the game's schedule walks the character and no script moves it:

  • content.path: a line through a map from points of the mod's own, closed or open, a curve through the points or a corner at one. A point may hold the walker (wait, animation, face).
  • content.patrol: a placed character walks a path at every hour, at its own walk or at a run (gait: "run").
  • content.schedule: a character's day. Each action walks a path or goes to a place, from its hour.

The character is one of the game's placed ones, or a mod's own copy of a game actor at a placement the mod adds or changes to that actor.

From them the content stage makes what the game's walkers have: a Guide rail in the map's static file, the placement's reference to it, and the actor's schedule. The routine's actions go into the default schedule and into each schedule the story's flags turn on, whose events (what the character says in that state) are left as they are. The stage reads the player's game first and stops the mod's content with the reason for a placement the map lacks, one that belongs to another actor after the mod's ordered placement changes, an actor with no schedule, or a run for an actor with no run animation.

Under it, typed patches gain a rails kind and a placements set with rail or link, and the pack builder takes a component file the actor's pack lacks from the RomFS (an NPC's schedule is such a file), so a copied actor gets a schedule of its own.

One fix rides along: a placement content.place adds with an SRTHash of 2^31 or more was written as an int64 where the game's is a uint.

The forge target is mod-api; the branch is on 8efb4b3eb. Read first: game/crates/content/src/plan/outputs.rs (routine_schedules, schedule_ops), game/crates/content/src/plan/curve.rs, game/crates/content/src/patch/apply.rs (the rails and the rail and link sets), game/crates/api/src/loader/stage.rs (schedule_of, runs). The guide is "Paths and patrols" in docs/modding/content.md; docs/dev/reference/content.md says how the game's files were read and what a run has shown.

Testing

Tested: Windows 11, GeForce RTX 3090, NVIDIA 610.88, by hand in the adult Kakariko Village. The rebased head ed7e858b3 ran with the commits of fix/rust-script-cpu-budget on top (not in this pull request: without them false script CPU faults on Windows stopped the test mod that labels the walkers), and the five walkers below were reported good. The runs before it were at 5401194bf, this branch before its rebase onto 8efb4b3eb, built the same way.

A test mod (not in this pull request) had five walkers: two game villagers on closed loops (one over a hillside, one along a street at a run with a 3 s stop), one on an open path up a slope with stops, one on a day of four actions (a walk and three places by the hour), and the mod's own copy of a villager on a loop of its own. Over the runs before the rebase:

  • The first patrol, one villager on a closed loop over a slope and round bends, walked as the game's own villagers do.
  • With five walkers the walking, the stops, the day's places and the copy had no report against them.
  • A villager with no run animation stood still when given a run. The stage now refuses that run, and the street's runner is one that has the animation.
  • Talking: two of four game villagers did not answer the talk button while the stage still emptied the story's schedules. With those kept, one of them stops and talks. Two do not answer while on their paths: for one the talk's camera starts and lets go before the first line, and its other placement in the village, which follows no path, answers. The cause is not known; the guide lists it under "Not yet for paths".

After the review, 53bde610e changed what the stage refuses (a map the game lacks, and a mod's own actor at a game placement the mod did not change); it is covered by the tests below and has not run in the game.

Without the game, before the ordered placement validation: the content crate's 257 tests pass, schema-gen --check passes, api and modtool type-check with their tests. Of the schema and modtool tests 204 pass and one fails, emulators::tests::eden_and_ryujinx_mods_are_found_with_their_switches: it makes two folders whose names differ only in case, which are one folder on Windows, in a file this branch does not change. tests/run_all.py --changed runs four checks: two pass, and test_parity_gates.py and test_dev_build.py fail on Windows for their Linux paths and gates, in files this branch does not change. The whole mise run test has not run on this PC.

Before the rebase the stage's patches were applied to this PC's game files without the game: every op applied to the schedule files of four villagers (2 to 8 story schedules each, all with the routine's actions and their own events), and the run was refused for the villager without the animation and allowed for one with it.

Still to test:

  • Windows, the same save without the mod: talk to the two villagers that did not answer, at the same spots, expecting to learn whether the path is what ends the talk (by hand).
  • Linux: one patrol of a game villager in a village, expecting the character to walk the path (by hand).

Measurements

Nothing to measure: the stage runs once when a mod's content is made at the start, and the game walks the character with its own schedule and rail code, so no script or hook of this change runs in a frame.

Risks

Nothing changes for a player without a mod that declares a path, a patrol or a schedule; a revert is enough. With such a mod the actor's routine is replaced in every state of the story, and every placement of that actor follows it (the guide says so): a character the story moves or holds somewhere by its schedule would walk the mod's path instead, until the mod is turned off. A walker may not answer the talk button, as Testing says. A mod's content.place placement with an SRTHash of 2^31 or more is now written with the game's type; its place and its id are the same. Saves, longshot_options.ini and the caches are not touched.

Checklist

The integration target is mod-api, so "current main" below is read as current mod-api.

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.
  • mise run test passes (any failure that also fails on main is named). (Not run whole on this PC; the parts that ran are in Testing.)
  • 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

  • A check under tests/ that reads changed source is updated, not weakened.
  • 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 could not give a character a route. To have an NPC walk somewhere, a script had to move it every frame, which jitters and has none of the game's walking: no turning into a bend, no stepping around things, no finding the way back. This adds three content declarations that write the game's own data for a walker, so the game's schedule walks the character and no script moves it: - `content.path`: a line through a map from points of the mod's own, closed or open, a curve through the points or a corner at one. A point may hold the walker (`wait`, `animation`, `face`). - `content.patrol`: a placed character walks a path at every hour, at its own walk or at a run (`gait: "run"`). - `content.schedule`: a character's day. Each action walks a path or goes to a place, from its hour. The character is one of the game's placed ones, or a mod's own copy of a game actor at a placement the mod adds or changes to that actor. From them the content stage makes what the game's walkers have: a Guide rail in the map's static file, the placement's reference to it, and the actor's schedule. The routine's actions go into the default schedule and into each schedule the story's flags turn on, whose events (what the character says in that state) are left as they are. The stage reads the player's game first and stops the mod's content with the reason for a placement the map lacks, one that belongs to another actor after the mod's ordered placement changes, an actor with no schedule, or a run for an actor with no run animation. Under it, typed patches gain a `rails` kind and a placements `set` with `rail` or `link`, and the pack builder takes a component file the actor's pack lacks from the RomFS (an NPC's schedule is such a file), so a copied actor gets a schedule of its own. One fix rides along: a placement `content.place` adds with an SRTHash of 2^31 or more was written as an int64 where the game's is a uint. The forge target is `mod-api`; the branch is on `8efb4b3eb`. Read first: `game/crates/content/src/plan/outputs.rs` (`routine_schedules`, `schedule_ops`), `game/crates/content/src/plan/curve.rs`, `game/crates/content/src/patch/apply.rs` (the rails and the `rail` and `link` sets), `game/crates/api/src/loader/stage.rs` (`schedule_of`, `runs`). The guide is "Paths and patrols" in `docs/modding/content.md`; `docs/dev/reference/content.md` says how the game's files were read and what a run has shown. ## Testing **Tested:** Windows 11, GeForce RTX 3090, NVIDIA 610.88, by hand in the adult Kakariko Village. The rebased head `ed7e858b3` ran with the commits of `fix/rust-script-cpu-budget` on top (not in this pull request: without them false script CPU faults on Windows stopped the test mod that labels the walkers), and the five walkers below were reported good. The runs before it were at `5401194bf`, this branch before its rebase onto `8efb4b3eb`, built the same way. A test mod (not in this pull request) had five walkers: two game villagers on closed loops (one over a hillside, one along a street at a run with a 3 s stop), one on an open path up a slope with stops, one on a day of four actions (a walk and three places by the hour), and the mod's own copy of a villager on a loop of its own. Over the runs before the rebase: - The first patrol, one villager on a closed loop over a slope and round bends, walked as the game's own villagers do. - With five walkers the walking, the stops, the day's places and the copy had no report against them. - A villager with no run animation stood still when given a run. The stage now refuses that run, and the street's runner is one that has the animation. - Talking: two of four game villagers did not answer the talk button while the stage still emptied the story's schedules. With those kept, one of them stops and talks. Two do not answer while on their paths: for one the talk's camera starts and lets go before the first line, and its other placement in the village, which follows no path, answers. The cause is not known; the guide lists it under "Not yet for paths". After the review, `53bde610e` changed what the stage refuses (a map the game lacks, and a mod's own actor at a game placement the mod did not change); it is covered by the tests below and has not run in the game. Without the game, before the ordered placement validation: the content crate's 257 tests pass, `schema-gen --check` passes, `api` and `modtool` type-check with their tests. Of the `schema` and `modtool` tests 204 pass and one fails, `emulators::tests::eden_and_ryujinx_mods_are_found_with_their_switches`: it makes two folders whose names differ only in case, which are one folder on Windows, in a file this branch does not change. `tests/run_all.py --changed` runs four checks: two pass, and `test_parity_gates.py` and `test_dev_build.py` fail on Windows for their Linux paths and gates, in files this branch does not change. The whole `mise run test` has not run on this PC. Before the rebase the stage's patches were applied to this PC's game files without the game: every op applied to the schedule files of four villagers (2 to 8 story schedules each, all with the routine's actions and their own events), and the run was refused for the villager without the animation and allowed for one with it. **Still to test:** - Windows, the same save without the mod: talk to the two villagers that did not answer, at the same spots, expecting to learn whether the path is what ends the talk (by hand). - Linux: one patrol of a game villager in a village, expecting the character to walk the path (by hand). ## Measurements Nothing to measure: the stage runs once when a mod's content is made at the start, and the game walks the character with its own schedule and rail code, so no script or hook of this change runs in a frame. ## Risks Nothing changes for a player without a mod that declares a path, a patrol or a schedule; a revert is enough. With such a mod the actor's routine is replaced in every state of the story, and every placement of that actor follows it (the guide says so): a character the story moves or holds somewhere by its schedule would walk the mod's path instead, until the mod is turned off. A walker may not answer the talk button, as Testing says. A mod's `content.place` placement with an SRTHash of 2^31 or more is now written with the game's type; its place and its id are the same. Saves, `longshot_options.ini` and the caches are not touched. ## Checklist The integration target is `mod-api`, so "current `main`" below is read as current `mod-api`. ### Ready for review - [x] One topic, on current `main`; the title is a Conventional Commit. - [x] Tested on my own PC, in the game for a change the game runs, as Testing says. - [ ] `mise run test` passes (any failure that also fails on `main` is named). (Not run whole on this PC; the parts that ran are in Testing.) - [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 - [x] A check under `tests/` that reads changed source is updated, not weakened. - [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)
A content module declares a path from points of its own and gives it to one of the game's placed characters:

    const loop = path({ id: "WellLoop", map: "SomeVillage", age: "adult", closed: true, points: [...] });
    patrol({ path: loop, actor: "Npc_SomeVillager", placement: "00a1b2c3d4e5f607" });

The stage makes what the game's own walkers have, so the game's schedule walks the character and no script moves it:

- the rail: a Guide rail in the map's static file, a curve through the points with the handles and lengths the
  game's own rails have (plan/curve.rs), a point with `corner: true` left a corner;
- the placement's reference: its Rails names the rail, and its MoveRadius reaches the rail's farthest place;
- the schedule: the actor's schedule file gets one action at every hour, the game's own walk along the rail its
  placement names, in place of its other actions and the schedules the story's flags turn on.

Two additions to typed patches carry it, and are a mod's to use as files too:

- a `rails` kind: a map's rails by hash (`add`, `set`, `remove`), an added rail's numbers written as the game's
  types whatever the JSON says (hashes uint64, vectors and lengths floats);
- a placements `set` with `rail`: the placement follows that rail of the file. The applier writes the reference in
  place of one to a rail of the same kind, and the radius from the rail as the file has it. It is an op of its own
  because a placements `set` only changes a key the placement has, and a hash inside a list a patch adds would take
  its type from how the JSON wrote it.

The stage reads the player's game first (GameFiles::schedule_of, the map's file): a placement the map lacks, one that
is another actor's, or an actor with no schedule stops the mod's content with the reason. An NPC's schedule is a file
of the RomFS its actor names, not a member of its pack, so the schedule is a keys patch of that file.

Not yet: a mod's own actors and placements (a copy has the schedule file of the actor it copies), a wait or an
animation at a point, a schedule by the hour.

Preview: read from the game's rails and schedules and tested without the game; docs/dev/reference/content.md says
what a game run has to confirm.

Assisted-by: Claude Fable 5.2
Co-Authored-By: Claude Fable 5.2 <[email protected]>
An NPC's schedule (its AISchedule component) is a file of the RomFS its ActorParam names, not a member of its pack, so
a copy of the actor could not change it: the pack builder refused a component whose file the pack does not hold. It now
reads such a file from the RomFS as the layers serve it (`read("romfs:<path>")`), changes it and puts the copy in the
new actor's pack under its name, as it does a member's.

The pack and merge part of e7acadb76 (feat/rust-custom-model-npc), which has run in the game there: the village's
characters are copies with schedules of their own.

Assisted-by: Claude Fable 5.2
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Three additions to paths and patrols, each the game's own data for it:

- A path's point may hold the walker: `{ at, wait, animation, face }`. The rail's point gets the game's stop (its
  wait in frames, 30 a second; its animation; the way it stands as the point's rotation).
- `content.schedule({ actor, placement, map, age, actions })`: a character's day. Each action walks a path (`walk`)
  or goes to a place (`go`, with `face` and `animation`) from its hour (`at`). One action holds at every hour;
  several are the game's free-form day, each with its start. A place is added to the map as the game's anchor of
  its number and the character's placement linked to it. One path and at most 9 places a schedule.
- A patrol's or a schedule's actor may be one the mod made of a game actor, and its placement one the mod placed in
  the map's static file. The actor's schedule is then a component of its own pack (a changed copy of the copied
  actor's file), and the game's actor keeps its own.

Typed patches get a placements `set` with `link`: the placement linked to another placement of the file, in place
of its link to one of the same actor, its MoveRadius reaching it.

Fix: a new placement's SRTHash of 2^31 or more was written as an int64 (a JSON whole number past an int), where the
game's is a uint. About half of the placements content.place adds had it. Found by applying the stage's patches to a
real map file and comparing every field's type with the game's own.

A patrol is a routine of one action now; its outputs are the same but for walk-<n>.json's description.

Assisted-by: Claude Fable 5.2
Co-Authored-By: Claude Fable 5.2 <[email protected]>
The page ends with a section of the same name, so a link to one could land on the other.

Assisted-by: Claude Fable 5.2
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Two things a hand test of five walkers in the adult village showed.

A patrol or a schedule emptied the actor's ConditionalSchedule and changed only the default schedule's actions. Each
of those schedules has its own EventEntry: what the character says when talked to in that state of the story. With
only the default left, two of four characters did not answer the talk button. The routine's actions now go into the
default schedule and into each schedule the story's flags turn on, and nothing else of them is touched.
GameSchedule's `conditional` is the list of them (each by whether it has an ActionSchedule), read by the loader.

`gait: "run"` wrote `MovingAS: "Run"` for any actor, and one with no run animation stood still. The 15 game actors
whose schedules ask for a run each have a `Def_Move_Run` or `Move_Run` clip in an animation file their Animation
component names; of the Hylian bodies looked at (ML, MN, MO, WN, WX) only MN has one. The stage now asks
`GameFiles::runs` and refuses a run for an actor without the clip (`plan.patrol`: "has no run"). A mod's own actor
that brings animations is not checked.

Checked against this PC's game files without the game: every op applies to the schedule files of four villagers (2
to 8 story schedules each, all with the routine's actions and their own events), the run is refused for
Npc_Hylia_005_Adult and allowed for Npc_Hylia_003_Adult. Not yet seen in a run.

Assisted-by: Claude Fable 5.2
Co-Authored-By: Claude Fable 5.2 <[email protected]>
docs(modding): what the walkers' talk did in the next hand test, and one heading where there were two
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Successful in 5s
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
ed7e858b33
With each story schedule's talk kept, one of the adult village's walkers that had not answered the talk button now
stops and talks. Two others still do not answer while on their paths; one of them answers at its other placement,
which follows no path. The cause is not known, so the guide no longer says a walker stops to talk and lists it under
"Not yet for paths", and the reference says what was seen and what is still to find out.

"Reading the merged data" had its heading twice.

Assisted-by: Claude Fable 5.2
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Author
Contributor

Tested in game: Windows 11, GeForce RTX 3090, NVIDIA 610.88, by hand in the adult Kakariko Village, at 5401194bf (this branch before its rebase onto mod-api 8efb4b3eb, built with the two commits of fix/rust-script-cpu-budget on top). Five walkers of a test mod: two game villagers on closed loops (one at a run with a stop), one on an open path with stops, one on a day of four actions, and the mod's own copy of a villager. They walk their paths by the game's schedule. One of three game villagers tried answers the talk button while walking; two do not, cause unknown (see Testing). The rebased head has not run in the game.

Tested in game: Windows 11, GeForce RTX 3090, NVIDIA 610.88, by hand in the adult Kakariko Village, at 5401194bf (this branch before its rebase onto mod-api 8efb4b3eb, built with the two commits of fix/rust-script-cpu-budget on top). Five walkers of a test mod: two game villagers on closed loops (one at a run with a stop), one on an open path with stops, one on a day of four actions, and the mod's own copy of a villager. They walk their paths by the game's schedule. One of three game villagers tried answers the talk button while walking; two do not, cause unknown (see Testing). The rebased head has not run in the game.
Owner
@review
BeanBot requested changes 2026-11-26 17:55:18 +00:00
Dismissed
BeanBot left a comment

Recommendation: Request changes. A routine can be accepted for the wrong placement, so its rail and schedule are applied to different actors. Missing or unreadable maps also bypass the promised placement check and can leave the mod only partly applied.

Adds paths, patrols and daily schedules using game rails and schedules, plus a typed-patch extension and a placement hash fix. It gives mod authors native walking without per-frame scripts, at the cost of replacing an actor's routine and potentially affecting its other placements.

Blocking (2): must change before merging.

  1. L1 game/crates/content/src/plan/outputs.rs:678: A mod-owned actor bypasses the placement's actor check without verifying that a change actually replaces that placement. (more on the line) Do: Require a matching change of that placement in the same map to the mod-owned actor, or validate the effective placement after applying the mod's changes.
  2. L2 game/crates/content/src/plan/outputs.rs:665: An absent, unreadable, or structurally invalid map skips placement validation instead of failing the content stage. (more on the line) Do: Return a stage error when the real game's map cannot be read or has no valid Actors array; provide an explicit fake-game validation path for tests.

Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)

  • L3: The submitted head has not been exercised in the game, and the reported talk failures remain unexplained. When: The pre-rebase run had walkers that did not answer the talk button; it does not establish whether the submitted head's routines and story interactions work. Do: Run the five-walker scenario on the submitted head and compare the affected talk interactions with the same save and mod disabled; also exercise a patrol on Linux.

@fix can do L1 and L2.

Questions (1) (not confirmed from the code; they don't hold the recommendation)

  • Can an actor's AISchedule be stored only inside its pack? schedule_of accepts that case, but a game actor's generated schedule patch targets the member path as a RomFS file.

Checks: Still running: Guide screenshots / Guide images and local UI source review (pull_request), Third-party parts / As their notes say (pull_request), Third-party parts / The same as upstream (pull_request).

More: does it help, other systems, switches, what was read

Does it help: Unproven on the submitted head. The author reports five walkers working on Windows before the rebase, with two talk interactions still failing; the rebased head has not run in the game.

Other systems: The stage and typed-patch code affect modded game startup on Windows and Linux. Schedules affect every placement sharing the actor, and the reported talk failures may affect story interactions. The submitted head has no game run; Linux has not been tested.

Switches: None.

Reviewed: ed7e858b33 against 8efb4b3eb4: Read the repository rules, PR template, commit log, and the principal changes in stage.rs, pack.rs, merge.rs, plan/outputs.rs, plan/declare.rs, plan/curve.rs and patch/apply.rs. Skimmed the schema, patch parser, modding guide, reference notes and test vectors. The remaining changed files and surrounding code were not read in full, so this is not a complete first-pass review.; nothing run (a code review).

Checked and fine:

  • The listed commits include AI-assistance trailers.
  • The author reports the placement SRTHash fix was checked against the game's field type, and its unit test covers a value above 2^31.
  • No switches were added or changed.

Testing: Read-only review; no builds, scripts or tests were run. The PR reports pre-rebase Windows game runs and game-free checks on the submitted head.

Overlaps and merge order: Not checked; the network is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** A routine can be accepted for the wrong placement, so its rail and schedule are applied to different actors. Missing or unreadable maps also bypass the promised placement check and can leave the mod only partly applied. Adds paths, patrols and daily schedules using game rails and schedules, plus a typed-patch extension and a placement hash fix. It gives mod authors native walking without per-frame scripts, at the cost of replacing an actor's routine and potentially affecting its other placements. **Blocking (2)**: must change before merging. 1. **L1** `game/crates/content/src/plan/outputs.rs:678`: A mod-owned actor bypasses the placement's actor check without verifying that a change actually replaces that placement. (more on the line) **Do:** Require a matching change of that placement in the same map to the mod-owned actor, or validate the effective placement after applying the mod's changes. 2. **L2** `game/crates/content/src/plan/outputs.rs:665`: An absent, unreadable, or structurally invalid map skips placement validation instead of failing the content stage. (more on the line) **Do:** Return a stage error when the real game's map cannot be read or has no valid Actors array; provide an explicit fake-game validation path for tests. **Testing before merging (1)** (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation) - **L3**: The submitted head has not been exercised in the game, and the reported talk failures remain unexplained. *When:* The pre-rebase run had walkers that did not answer the talk button; it does not establish whether the submitted head's routines and story interactions work. **Do:** Run the five-walker scenario on the submitted head and compare the affected talk interactions with the same save and mod disabled; also exercise a patrol on Linux. `@fix` can do L1 and L2. **Questions (1)** (not confirmed from the code; they don't hold the recommendation) - Can an actor's AISchedule be stored only inside its pack? schedule_of accepts that case, but a game actor's generated schedule patch targets the member path as a RomFS file. **Checks:** Still running: `Guide screenshots / Guide images and local UI source review (pull_request)`, `Third-party parts / As their notes say (pull_request)`, `Third-party parts / The same as upstream (pull_request)`. <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven on the submitted head. The author reports five walkers working on Windows before the rebase, with two talk interactions still failing; the rebased head has not run in the game. **Other systems:** The stage and typed-patch code affect modded game startup on Windows and Linux. Schedules affect every placement sharing the actor, and the reported talk failures may affect story interactions. The submitted head has no game run; Linux has not been tested. **Switches:** None. **Reviewed:** ed7e858b33a2 against 8efb4b3eb496: Read the repository rules, PR template, commit log, and the principal changes in stage.rs, pack.rs, merge.rs, plan/outputs.rs, plan/declare.rs, plan/curve.rs and patch/apply.rs. Skimmed the schema, patch parser, modding guide, reference notes and test vectors. The remaining changed files and surrounding code were not read in full, so this is not a complete first-pass review.; nothing run (a code review). **Checked and fine:** - The listed commits include AI-assistance trailers. - The author reports the placement SRTHash fix was checked against the game's field type, and its unit test covers a value above 2^31. - No switches were added or changed. **Testing:** Read-only review; no builds, scripts or tests were run. The PR reports pre-rebase Windows game runs and game-free checks on the submitted head. **Overlaps and merge order:** Not checked; the network is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
@ -568,0 +662,4 @@
if own_place(self, &r.decl.name).is_none() {
if !maps.iter().any(|(f, _)| *f == r.file) {
maps.push((&r.file, files.file(&r.file).and_then(|b| Document::read(&b).ok())));
}
Member

L2 (blocking): An absent, unreadable, or structurally invalid map skips placement validation instead of failing the content stage.

When: A patrol names a nonexistent map and a valid scheduled actor. The map read returns None, the Actors check is skipped, and the stage emits a schedule patch even though its rail and placement cannot be applied to that map.

Do: Return a stage error when the real game's map cannot be read or has no valid Actors array; provide an explicit fake-game validation path for tests.

**L2** (blocking): An absent, unreadable, or structurally invalid map skips placement validation instead of failing the content stage. *When:* A patrol names a nonexistent map and a valid scheduled actor. The map read returns None, the Actors check is skipped, and the stage emits a schedule patch even though its rail and placement cannot be applied to that map. **Do:** Return a stage error when the real game's map cannot be read or has no valid Actors array; provide an explicit fake-game validation path for tests.
@ -568,0 +675,4 @@
return Err(fail(format!("{} has no placement of that id", r.file)));
};
// (a mod's own actor there is the mod's change of the placement, made after this file was read)
let is = placed.get("Gyaml").and_then(Node::text).unwrap_or_default();
Member

L1 (blocking): A mod-owned actor bypasses the placement's actor check without verifying that a change actually replaces that placement.

When: A mod declares a copied actor and gives its patrol the ID of an existing game placement without a matching content.change. The stage accepts it, attaches the rail to the existing actor, and puts the routine in the copied actor's pack, so the declared walker does not follow the path.

Do: Require a matching change of that placement in the same map to the mod-owned actor, or validate the effective placement after applying the mod's changes.

**L1** (blocking): A mod-owned actor bypasses the placement's actor check without verifying that a change actually replaces that placement. *When:* A mod declares a copied actor and gives its patrol the ID of an existing game placement without a matching content.change. The stage accepts it, attaches the rail to the existing actor, and puts the routine in the copied actor's pack, so the declared walker does not follow the path. **Do:** Require a matching change of that placement in the same map to the mod-owned actor, or validate the effective placement after applying the mod's changes.
Author
Contributor

Tested in game on the rebased head: Windows 11, GeForce RTX 3090, NVIDIA 610.88, by hand in the adult Kakariko Village, at ed7e858b3 with the commits of fix/rust-script-cpu-budget on top. The five walkers of the test mod (moved to this base's UI module) were reported good. The description's Testing and checklist are updated; the whole mise run test is the box still open.

Tested in game on the rebased head: Windows 11, GeForce RTX 3090, NVIDIA 610.88, by hand in the adult Kakariko Village, at ed7e858b3 with the commits of fix/rust-script-cpu-budget on top. The five walkers of the test mod (moved to this base's UI module) were reported good. The description's Testing and checklist are updated; the whole mise run test is the box still open.
fix(api): a routine is refused for a map the game lacks, and for a mod's actor at a game placement it did not change
Some checks failed
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Website / Website on Cloudflare (pull_request_target) Has been skipped
PR description / Description follows the template (pull_request_target) Failing after 8s
Guide screenshots / Guide images and local UI source review (pull_request) Has been cancelled
Third-party parts / As their notes say (pull_request) Has been cancelled
Third-party parts / The same as upstream (pull_request) Has been cancelled
53bde610e8
Two cases the stage accepted and then applied only in part, from the review of #2620.

A map the game does not have, one that cannot be read, or one with no Actors list skipped the placement's check, so
the schedule's patch was still made for a rail and a placement that could not be. The stage now stops the content with
the reason. The stand-ins without a game (the test vectors', mod test's fake game) say they read no files
(`GameFiles::reads_files`) and take the placement as given, as before.

A mod's own actor at one of the game's placements passed the check on the word that the mod changes the placement to
it. The stage now looks for that change (the same file, placement and actor) and refuses without it: the rail would go
to the game's actor and the routine to the mod's actor's pack.

Assisted-by: Claude Fable 5.2
Co-Authored-By: Claude Fable 5.2 <[email protected]>
Author
Contributor

Thanks for the review. Both blocking points were right and are fixed in 53bde610e.

L1, a mod's own actor at a game placement. The stage now looks for the mod's change() of that placement to that actor (the same file, placement and actor) and refuses the routine without it: "the placement is Npc_X, not <the mod's actor>: place it with place(), or change this placement's actor to it". With the change it goes through as before. Test: a_mods_own_actor_at_a_game_placement_needs_its_change_of_it.

L2, a map that is not there. A map the game does not have, one that cannot be read, and one with no Actors list each stop the content with the reason, so no schedule patch is made alone. The stand-ins without a game (the test vectors' and mod test's fake game) say so with GameFiles::reads_files and take the placement as given, which is the explicit path for tests the review asked for. Tests: the three cases and the stand-in in a_patrol_the_game_lacks_makes_nothing.

The content crate's 257 tests pass, api and modtool type-check with their tests, and modtool's fake-game tests pass. This commit changes only what the stage refuses; it has not run in the game yet, and a run of the five walkers on it is next.

L3. The five walkers ran in the game on ed7e858b3, the head the review read, after the review was written (the comment above). Still open, as the description's Still to test says: the two talk failures compared with the mod off, and a patrol on Linux. The talk failures are in the guide under "Not yet for paths".

The question, a schedule kept only inside an actor's pack. Not handled for a game actor: schedule_of reads it from the pack, but the patch then names it as a RomFS file and would not find it. Every NPC schedule read from the game so far is a RomFS file its ActorParam names, so nothing in this change's tests or runs meets the case. A mod's own copy is not affected (the pack builder takes the component from either place). I would take it as a follow-up: refuse such an actor with the reason, or patch the member in place.

Thanks for the review. Both blocking points were right and are fixed in `53bde610e`. **L1, a mod's own actor at a game placement.** The stage now looks for the mod's `change()` of that placement to that actor (the same file, placement and actor) and refuses the routine without it: "the placement is Npc_X, not <the mod's actor>: place it with place(), or change this placement's actor to it". With the change it goes through as before. Test: `a_mods_own_actor_at_a_game_placement_needs_its_change_of_it`. **L2, a map that is not there.** A map the game does not have, one that cannot be read, and one with no Actors list each stop the content with the reason, so no schedule patch is made alone. The stand-ins without a game (the test vectors' and `mod test`'s fake game) say so with `GameFiles::reads_files` and take the placement as given, which is the explicit path for tests the review asked for. Tests: the three cases and the stand-in in `a_patrol_the_game_lacks_makes_nothing`. The content crate's 257 tests pass, `api` and `modtool` type-check with their tests, and `modtool`'s fake-game tests pass. This commit changes only what the stage refuses; it has not run in the game yet, and a run of the five walkers on it is next. **L3.** The five walkers ran in the game on `ed7e858b3`, the head the review read, after the review was written (the comment above). Still open, as the description's Still to test says: the two talk failures compared with the mod off, and a patrol on Linux. The talk failures are in the guide under "Not yet for paths". **The question, a schedule kept only inside an actor's pack.** Not handled for a game actor: `schedule_of` reads it from the pack, but the patch then names it as a RomFS file and would not find it. Every NPC schedule read from the game so far is a RomFS file its ActorParam names, so nothing in this change's tests or runs meets the case. A mod's own copy is not affected (the pack builder takes the component from either place). I would take it as a follow-up: refuse such an actor with the reason, or patch the member in place.
Owner
@review
BeanBot left a comment

Recommendation: Request changes. The placement check can still accept a mod-owned walker when a later change replaces it with a different actor. The current head and the reported talk failures also need game testing.

The change lets mods give characters paths and schedules using the game's walking logic. It adds validation and tests, but conflicting placement changes can still leave the rail and schedule assigned to different actors.

Blocking (1): must change before merging.

  1. L1 game/crates/content/src/plan/outputs.rs:678: The placement check accepts an earlier matching change even when a later change replaces the actor again. When: A mod changes a game placement to its own actor, then changes the same placement to another actor and declares a patrol for its own actor. Validation succeeds, but the ordered placement patches leave the other actor at the rail while the schedule belongs to the mod's actor. Do: Check the final actor-setting change for that file and placement, accounting for declaration order, and reject the routine unless the resulting actor matches.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L3: The submitted head has not been exercised in the game, and the reported talk failures remain unexplained. When: The pre-rebase run had walkers that did not answer the talk button; it does not establish whether the submitted head's routines and story interactions work. Do: Run the five-walker scenario on the submitted head and compare the affected talk interactions with the same save and mod disabled; also exercise a patrol on Linux.

@fix can do L1.

Since the last review (on ed7e858b33)
Resolved: L2 (An absent, unreadable, or structurally invalid map skips placement validation instead of f…)
Still open: L1 (The placement check accepts an earlier matching change even when a later change replaces t…); L3 (The submitted head has not been exercised in the game, and the reported talk failures rema…)

Checks: Still running: Guide screenshots / Guide images and local UI source review (pull_request), Third-party parts / The same as upstream (pull_request), Third-party parts / As their notes say (pull_request).

Also noticed (1; not asked for, not blocking)
  • A game actor whose schedule exists only inside its pack is read successfully but cannot be patched as a RomFS schedule.
More: does it help, other systems, switches, what was read

Does it help: Unproven on the current head. Five walkers were reported working on the preceding head on Windows, though two villagers did not answer the talk button; the latest validation changes have not run in game.

Other systems: The stage reads game map and actor files on Windows and Linux; Linux patrol behavior remains untested. A game actor whose schedule exists only inside its pack is read but the resulting patch targets a RomFS file.

Switches: None.

Reviewed: 53bde610e8 against 8efb4b3eb4: Read the repository rules and pull request template, the changes since the previous review, the placement validation and declaration code, the placement patch generation, and the game-file reader. The full pull request diff and all changed files were not read in full.; nothing run (a code review).

Checked and fine:

  • The map validation caches both successful reads and errors per file.
  • The test stand-ins explicitly identify that they do not read game files.

Testing: No commands that execute project code or tests were run. The author reports game-free tests and a Windows game run on the preceding head; the current head, Linux patrol, and comparison of talk behavior with the mod disabled remain to be tested.

Overlaps and merge order: Not checked; network access is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.

**Recommendation: Request changes.** The placement check can still accept a mod-owned walker when a later change replaces it with a different actor. The current head and the reported talk failures also need game testing. The change lets mods give characters paths and schedules using the game's walking logic. It adds validation and tests, but conflicting placement changes can still leave the rail and schedule assigned to different actors. **Blocking (1)**: must change before merging. 1. **L1** `game/crates/content/src/plan/outputs.rs:678`: The placement check accepts an earlier matching change even when a later change replaces the actor again. *When:* A mod changes a game placement to its own actor, then changes the same placement to another actor and declares a patrol for its own actor. Validation succeeds, but the ordered placement patches leave the other actor at the rail while the schedule belongs to the mod's actor. **Do:** Check the final actor-setting change for that file and placement, accounting for declaration order, and reject the routine unless the resulting actor matches. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3**: The submitted head has not been exercised in the game, and the reported talk failures remain unexplained. *When:* The pre-rebase run had walkers that did not answer the talk button; it does not establish whether the submitted head's routines and story interactions work. **Do:** Run the five-walker scenario on the submitted head and compare the affected talk interactions with the same save and mod disabled; also exercise a patrol on Linux. `@fix` can do L1. **Since the last review** (on ed7e858b33a2) Resolved: L2 (An absent, unreadable, or structurally invalid map skips placement validation instead of f…) Still open: L1 (The placement check accepts an earlier matching change even when a later change replaces t…); L3 (The submitted head has not been exercised in the game, and the reported talk failures rema…) **Checks:** Still running: `Guide screenshots / Guide images and local UI source review (pull_request)`, `Third-party parts / The same as upstream (pull_request)`, `Third-party parts / As their notes say (pull_request)`. <details> <summary>Also noticed (1; not asked for, not blocking)</summary> - A game actor whose schedule exists only inside its pack is read successfully but cannot be patched as a RomFS schedule. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven on the current head. Five walkers were reported working on the preceding head on Windows, though two villagers did not answer the talk button; the latest validation changes have not run in game. **Other systems:** The stage reads game map and actor files on Windows and Linux; Linux patrol behavior remains untested. A game actor whose schedule exists only inside its pack is read but the resulting patch targets a RomFS file. **Switches:** None. **Reviewed:** 53bde610e887 against 8efb4b3eb496: Read the repository rules and pull request template, the changes since the previous review, the placement validation and declaration code, the placement patch generation, and the game-file reader. The full pull request diff and all changed files were not read in full.; nothing run (a code review). **Checked and fine:** - The map validation caches both successful reads and errors per file. - The test stand-ins explicitly identify that they do not read game files. **Testing:** No commands that execute project code or tests were run. The author reports game-free tests and a Windows game run on the preceding head; the current head, Linux patrol, and comparison of talk behavior with the mod disabled remain to be tested. **Overlaps and merge order:** Not checked; network access is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.</sub>
Owner
@fix
HumanBean changed title from WIP: feat(api): content.path, content.patrol and content.schedule, a character's walk by the game's own schedule to feat(api): content.path, content.patrol and content.schedule, a character's walk by the game's own schedule 2026-11-26 18:21:18 +00:00
fix(content): validate the final actor at routine placements
Some checks failed
Website / Website on Cloudflare (pull_request_target) Has been skipped
Website / Website preview, build (pull_request_target) Has been skipped
Website / Website preview, upload (pull_request_target) Has been skipped
Third-party parts / The same as upstream (pull_request) Has been skipped
PR description / Description follows the template (pull_request_target) Failing after 11s
Guide screenshots / Guide images and local UI source review (pull_request) Failing after 11s
Third-party parts / As their notes say (pull_request) Successful in 15s
8e963393a3
As the review on #2620 asked.
BeanBot left a comment

Recommendation: Approve. The code is ready: only testing is left. The five walkers worked on the preceding tested head, but the current head has not run in the game and the reported talk failures remain unexplained. Recommend approval; not approved on the forge.

What @fix changed
I changed this pull request: the new head is 8e963393a3. It was already up to date with mod-api. I edited its description to match the change.

Changed

  • Validate ordered placement changes in game/crates/content/src/plan/outputs.rs:695: Validation now checks the last actor-setting change for the file and placement, including mod-created placements. Added regression cases for later changes, restoration, and parameter-only changes. Tests were not run as requested.

Nothing was built or run: the checks run again on the new head.

The change lets mods give characters paths and daily routines using the game’s own walking and schedule data. The latest fix validates the final declared actor at a routine’s placement, adding validation and tests without removing the feature.

Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)

  • L3: The submitted head has not been exercised in the game, and the reported talk failures remain unexplained. When: The pre-rebase run had walkers that did not answer the talk button; it does not establish whether the submitted head's routines and story interactions work. Do: Run the five-walker scenario on the submitted head and compare the affected talk interactions with the same save and mod disabled; also exercise a patrol on Linux.

Checks: they run again on this head; a failure shows on the pull request.

Also noticed (3; not asked for, not blocking)
  • A game actor whose schedule exists only inside its pack is read successfully but cannot be patched as a RomFS schedule.
  • A game actor whose schedule exists only inside its pack is not handled by the generated RomFS schedule patch, as the author noted.
  • A game actor whose schedule exists only inside its pack is read by schedule_of but is subsequently targeted as a RomFS file, as the author notes.
More: does it help, other systems, switches, what was read

Does it help: Unproven on the current head. Five walkers were reported working on ed7e858b3 on Windows; the current placement-validation changes have not run in the game.

Other systems: The content stage reads game maps and schedules and generates patches and actor packs for Windows and Linux. The reported game run covers Windows; the description still calls for a Linux patrol and a comparison of the talk failures with the mod disabled.

Switches: None added, changed, or removed.

Reviewed: 8e963393a3 against 8efb4b3eb4: Read the latest fix diff and the placement-validation and patch-generation code around it, plus the supplied description, comments, ledger, and test reports. Skimmed the broader diff and repository rules; the other changed code files were not read in full.; nothing run (a code review).

Checked and fine:

  • For game placements, validation uses the last actor-setting change for the same map and normalized placement ID; parameter-only changes do not override it.
  • The fix preserves path and schedule generation.

Testing: No code or tests were run. The author reports the five-walker Windows run on ed7e858b3; the latest validation tests have not been run, and CI has not run on this head.

Overlaps and merge order: Not checked; the network is closed.


Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.

**Recommendation: Approve.** The code is ready: only testing is left. The five walkers worked on the preceding tested head, but the current head has not run in the game and the reported talk failures remain unexplained. Recommend approval; not approved on the forge. **What `@fix` changed** I changed this pull request: the new head is 8e963393a38a. It was already up to date with `mod-api`. I edited its description to match the change. **Changed** - **Validate ordered placement changes in game/crates/content/src/plan/outputs.rs:695**: Validation now checks the last actor-setting change for the file and placement, including mod-created placements. Added regression cases for later changes, restoration, and parameter-only changes. Tests were not run as requested. Nothing was built or run: the checks run again on the new head. The change lets mods give characters paths and daily routines using the game’s own walking and schedule data. The latest fix validates the final declared actor at a routine’s placement, adding validation and tests without removing the feature. **Testing before merging (1)** (runs on the systems it can change; it doesn't hold the recommendation) - **L3**: The submitted head has not been exercised in the game, and the reported talk failures remain unexplained. *When:* The pre-rebase run had walkers that did not answer the talk button; it does not establish whether the submitted head's routines and story interactions work. **Do:** Run the five-walker scenario on the submitted head and compare the affected talk interactions with the same save and mod disabled; also exercise a patrol on Linux. **Checks:** they run again on this head; a failure shows on the pull request. <details> <summary>Also noticed (3; not asked for, not blocking)</summary> - A game actor whose schedule exists only inside its pack is read successfully but cannot be patched as a RomFS schedule. - A game actor whose schedule exists only inside its pack is not handled by the generated RomFS schedule patch, as the author noted. - A game actor whose schedule exists only inside its pack is read by schedule_of but is subsequently targeted as a RomFS file, as the author notes. </details> <details> <summary>More: does it help, other systems, switches, what was read</summary> **Does it help:** Unproven on the current head. Five walkers were reported working on ed7e858b3 on Windows; the current placement-validation changes have not run in the game. **Other systems:** The content stage reads game maps and schedules and generates patches and actor packs for Windows and Linux. The reported game run covers Windows; the description still calls for a Linux patrol and a comparison of the talk failures with the mod disabled. **Switches:** None added, changed, or removed. **Reviewed:** 8e963393a38a against 8efb4b3eb496: Read the latest fix diff and the placement-validation and patch-generation code around it, plus the supplied description, comments, ledger, and test reports. Skimmed the broader diff and repository rules; the other changed code files were not read in full.; nothing run (a code review). **Checked and fine:** - For game placements, validation uses the last actor-setting change for the same map and normalized placement ID; parameter-only changes do not override it. - The fix preserves path and schedule generation. **Testing:** No code or tests were run. The author reports the five-walker Windows run on ed7e858b3; the latest validation tests have not been run, and CI has not run on this head. **Overlaps and merge order:** Not checked; the network is closed. </details> --- <sub>Automated code review by BeanBot (gpt-6.1-terra), asked for by BeanBot, after its fix. Nothing was run; a maintainer decides.</sub>
HumanBean merged commit cc65101d4f into mod-api 2026-11-26 18:24:08 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
3 participants
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!2620
No description provided.