WIP: feat(content): a mod's own maps, entrances, exits and adventures, with characters, talks, schedules and plants #3284
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!3284
Loading…
Reference in a new issue
No description provided.
Delete branch "dyst/Longshot:feat/content-maps-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
The content API adds and changes the game's things (actors, items, texts, placements), but only in the game's own places. A mod can't add a place: a room or an area of its own, a way in and out, and characters that live and talk there. This stack adds that, so a mod can be a small adventure of its own (#217).
This is a stack. It holds #3282 (the clock, 2 commits) and #3283 (animations, 1 commit) at its base, then 11 commits of its own, each one area. Review it commit by commit; the parts will go out as their own PRs as they leave WIP. Its own commits:
actor()takes aname(the text over its speech, in every language), what itholdsin each hand, andrange(the distances it is active, drawn and loaded at).place()takescreateRange. A component added from another actor can be changed as it is copied.schedule()takesstates(other days while a flag is set or clear), ahome(a spot it goes to and vanishes at, by a door) and abed.content.talk: a character's conversation as data, with texts in every language, choices, questions (flags, items, rupees, the hour), and flags set and items given or taken. It is written as an event flow of the mod's own.content::flowwrites the game's BFEVFL layout, checked byte for byte against the 72 game flows of those kinds.content.map: a new map with one of the game's maps' sky, light and rules, empty layouts, and the mod's collision.content.entrance: a place on any map Link can arrive at. It exists only while needed, because the game holds about five near each other.content.exit: a box that takes Link to an entrance.world.travelTo.place()takes age"none",when(the game's Presence) andname.content.plants: turf, moss, stones and undergrowth at a mod's points, in a game map or one of the mod's.content::foliagereads and writes the game's.flnt.map()takes a.glbfor its collision. Every triangle is solid, and the surface (stone, grass, wood, ladder, …) comes from the material's name, with boxes of water. It is built on the player's PC into one of the game's small compounds, its ground's shape swapped for the model's. The mesh shape, compound and container code is cut down from phive-bfres-tools (MIT, by the same author).walk-checkexample asks the game's own collision the same during play, on any map.content.adventure: a save begun with the mod on starts at the mod's entrance in place of the game's opening, and stays in the mod's maps. The player's other saves are never touched. A save made after arriving at a mod's entrance keeps that arrival, and its flag is set as the save loads. A mod made only of content was never "running", so its exits and hour-bound flags were not followed: now they are.Nothing of the game is in a mod or in this PR: every file of the game's that this uses is read from the player's own game when the mod is prepared.
Read first:
game/crates/content/src/plan/maps.rsandgame/crates/game-core/src/travel.rs(maps, entrances, travel),content/src/collision/(the collision), thenplan/declare.rsandgame/modapi/schema/content.tomlfor the API.docs/modding/content.mddescribes each area for mod authors.Testing
Tested: Windows 11, RTX 3080, NVIDIA 621.47,
dev.py game-testsfrom a save at Hyrule Castle's gate, over a base of mainf359e2621(before this branch was rebased onto mainde6fb7b5d; the rebase changed only generated docs and one list of services inapi/src/services/mod.rs). A test mod made a room of its own from a.glb(a floor, a platform, two entrances and an exit in a corner):world.travelTotook Link to the room's first entrance, and the map loaded.gfx.world.model) showed with #3261's fix applied locally, and not without it. #3261 is in main now, so this head has it.Checks:
cargo testofgame-core,api,content,schema,schema-genandmodtool,cargo clippy -D warnings,cargo fmt --checkandschema-gen --checkpass on the head.Still to test (each by hand, in the game, Windows unless named):
name,holdsandrange, expecting its name over its speech, the held actors in its hands, and it drawn and loaded at those distances.states,homeandbed, expecting it to follow the flag's day, go home through its door and sleep in its bed.walk-checkexample on a game map.content.adventure: a new save with the mod on, expecting it to start at the mod's entrance and keep its arrival over a save and load.Measurements
Nothing to measure in play: the content stage runs while mods are prepared, before the game starts, and only for mods that declare content. Per frame, the adventure and exits add a check of the running content mods, which is empty without them. How long a large mod takes to prepare (images on several threads) is not measured yet.
Risks
game/crates/content). Players without content mods run the same game as before: the new code runs only for mods that declare maps, talks, plants and the rest.game-core/src/travel.rs) is shared with the game's own travels: a mistake there could affect a travel with no mod. The change keeps main's age wait and adds the mod's arrival inside it.Checklist
Ready for review
main; the title is a Conventional Commit. On current main, but a stack of several areas: it goes out as separate PRs.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. The preparation time of a large mod is owed.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
world.setTime and holdTime (the game's own set of its clock), game.hourPassed (each whole hour, those of a jump and of a load too), and a content flag bound to hours of the clock (bind: { hours }), which a placement's when and a schedule's state follow with no script, while a map loads too. Ported onto main from the API extensions stack without its maps commit (travelTo and exits stay there). Co-Authored-By: Claude Opus 5.5 <[email protected]>`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]>actor() takes name (the text over its speech, in every language, or false for none), holds (an actor in each hand, or all another game actor holds) and range (the distances it is active, drawn and loaded within); changeActor takes holds and range; place takes createRange; a patrol and a schedule's action say holds. A component added from another actor may be changed as it is copied (add: { ref, from, set }): the pack spec's component-from line. Co-Authored-By: Claude Opus 5.5 <[email protected]>schedule() takes states (other days while a flag is set or clear: the mod's, the game's or another mod's), home (a spot gone to and vanished at, by a door of the map) and bed (where it sleeps), and an action's home, sleep and warp. A keys patch's add may copy another path of the file ("from"), which the states' talk is made with. Co-Authored-By: Claude Opus 5.5 <[email protected]>Tested in game: Windows 11, RTX 3080, NVIDIA 621.47, dev.py game-tests from a save at Hyrule Castle's gate, over a base of main
f359e2621(before the rebase ontode6fb7b5d): a test mod's room made from a .glb: world.travelTo took Link to its entrance and the map loaded; he stood on the model's floor (y 0) and landed on its platform (y 0.60); the exit in a corner took him to the second entrance; in a window with the game's own upscaler the room's model showed with #3261's fix. Characters, schedules, talks, plants, tints, ground checks and adventure() have not run in the game yet (Still to test).Possibly related, for context:
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.