From 9454e557fcdea316c22abb47e70ae8f86d93fd47 Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 2 Nov 2026 11:40:06 -0800 Subject: [PATCH 1/3] Design: AutoStory story tracks for postgame and DLC How the shared start/end selection could grow past SV's two sections: which cases append (postgame) and which branch (DLC), a track sketch, and why checkpoint ids beat one global index for saved settings. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E --- docs/design/AutoStory-StoryTracks.md | 70 ++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 docs/design/AutoStory-StoryTracks.md diff --git a/docs/design/AutoStory-StoryTracks.md b/docs/design/AutoStory-StoryTracks.md new file mode 100644 index 0000000000..213ae7beb5 --- /dev/null +++ b/docs/design/AutoStory-StoryTracks.md @@ -0,0 +1,70 @@ +# AutoStory: story tracks for postgame and DLC + +Status: **design note only**. Nothing here is implemented; it records how the +shared start/end selection could grow past two sections, so the next person to +add a postgame or DLC starts from the right questions. + +## Today + +`Pokemon/AutoStory/Pokemon_AutoStorySelect.h` (upstream PokemonAutomation/Arduino-Source#1828) +builds the start/end dropdowns and maps a selection back to one flat story list: + +- SV AutoStory has one ordered list, `ALL_AUTO_STORY_SEGMENT_LIST()`, segments + 0 to 40, ending with "40: Finish Main Story" (the AI Professor). No postgame, + no The Teal Mask, no The Indigo Disk. +- The list is cut into two consecutive sections, tutorial then main story. Each + has its own start/end dropdowns; `STORY_SECTION` picks which pair counts. +- `story_index(bool main_story, index_in_section, first_main_story_index)` turns + a position in a section back into the flat index. +- FRLG and BDSP have one section; their checkpoints have stable string ids + (`"00.08"`). + +## What doesn't fit + +| Case | Shape | One list cut into sections? | +|---|---|---| +| FRLG postgame (Sevii 4-7, National Dex after the Hall of Fame) | carries straight on from the main story | yes: more checkpoints, or a third section | +| SV postgame (Academy Ace Tournament, ...) | carries straight on from the ending | yes | +| SV The Teal Mask | branches: can start partway through the main story, then its own linear story | no | +| SV The Indigo Disk | branches, and needs The Teal Mask finished | no | +| another game with 0, 1 or 3 DLCs | per-game count | only if sections are data, not a bool or shared enum | + +## Sketch: tracks + +```cpp +struct StoryRef{ + std::string track; // "main" + std::string entry; // a checkpoint id in that track +}; + +struct StoryTrack{ + std::string id; // "tutorial", "main", "postgame", "teal_mask" + std::string name; // shown in the UI + std::vector entries; // linear within the track + std::optional starts_after; // Teal Mask: after main X; + // Indigo Disk: after Teal Mask's end; + // postgame: after main's end +}; + +// Each game supplies its tracks as data. +const std::vector& story_tracks(); +``` + +- A run picks one track, then a start and an end inside it. As now, the save + must match the start checkpoint; `starts_after` documents and validates the + order, it doesn't drive the run. +- UI: a track dropdown, then start/end dropdowns filtered to that track. With one + track (FRLG, BDSP today) the track dropdown can be hidden. +- Identify checkpoints by track id plus entry id (or stable string ids), not by + one global index. SV stores the dropdown choice as an index string in users' + saved settings; splicing a DLC into one flat numbering would shift every later + index and silently change saved settings. A migration from SV's current + two-section settings would map (section, index) to (track, entry id). +- An appended postgame needs only a new track (or more entries in "main"); the + branch cases are what force `starts_after` and per-track ids. + +## When to do it + +Not before a game needs a third section. The first one decides the shape: FRLG's +postgame is an append; SV DLC is a branch. Until then `story_index()` carries a +NOTE pointing here. From 9acc54b9e899905626c8fa8d7419ea114f78e8c3 Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 2 Nov 2026 11:40:28 -0800 Subject: [PATCH 2/3] Design: story tracks note, the NOTE states the assumption Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E --- docs/design/AutoStory-StoryTracks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/design/AutoStory-StoryTracks.md b/docs/design/AutoStory-StoryTracks.md index 213ae7beb5..fb487bb541 100644 --- a/docs/design/AutoStory-StoryTracks.md +++ b/docs/design/AutoStory-StoryTracks.md @@ -67,4 +67,4 @@ const std::vector& story_tracks(); Not before a game needs a third section. The first one decides the shape: FRLG's postgame is an append; SV DLC is a branch. Until then `story_index()` carries a -NOTE pointing here. +NOTE stating the two-section assumption. From 2424f33de92e0a1bea519eee84fa296517907547 Mon Sep 17 00:00:00 2001 From: dayfine Date: Mon, 2 Nov 2026 12:00:32 -0800 Subject: [PATCH 3/3] docs: AutoStory sections are break points; DLC appends, DLC-first unsupported Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E --- docs/design/AutoStory-StoryTracks.md | 86 +++++++++++++++++----------- 1 file changed, 51 insertions(+), 35 deletions(-) diff --git a/docs/design/AutoStory-StoryTracks.md b/docs/design/AutoStory-StoryTracks.md index fb487bb541..e5d9148fa6 100644 --- a/docs/design/AutoStory-StoryTracks.md +++ b/docs/design/AutoStory-StoryTracks.md @@ -1,7 +1,7 @@ -# AutoStory: story tracks for postgame and DLC +# AutoStory: sections, postgame and DLC Status: **design note only**. Nothing here is implemented; it records how the -shared start/end selection could grow past two sections, so the next person to +shared start/end selection grows past SV's main story, so the next person to add a postgame or DLC starts from the right questions. ## Today @@ -19,17 +19,52 @@ builds the start/end dropdowns and maps a selection back to one flat story list: - FRLG and BDSP have one section; their checkpoints have stable string ids (`"00.08"`). -## What doesn't fit +## Rule: a section is a break -| Case | Shape | One list cut into sections? | +A section ends where the user must step in, not where the content changes +(jw098 on #1828): SV's tutorial ends where the user levels up the Pokemon by +hand. Content that needs no break is more checkpoints at the end of the last +section. + +## Cases + +| Case | Shape | Model | |---|---|---| -| FRLG postgame (Sevii 4-7, National Dex after the Hall of Fame) | carries straight on from the main story | yes: more checkpoints, or a third section | -| SV postgame (Academy Ace Tournament, ...) | carries straight on from the ending | yes | -| SV The Teal Mask | branches: can start partway through the main story, then its own linear story | no | -| SV The Indigo Disk | branches, and needs The Teal Mask finished | no | -| another game with 0, 1 or 3 DLCs | per-game count | only if sections are data, not a bool or shared enum | +| FRLG / SV postgame | carries on from the ending | append to the last section | +| SV DLC, run after the main story | carries on from the ending | append; a new section only if a break is needed | +| DLC that needs grinding first (e.g. Legends Z-A's DLC is a big step up) | break before it | new section | +| DLC started partway through the main story | branch: later checkpoints can't assume one game state | **not supported**: DLC runs only after the main story | +| another game with 0, 1 or 3 DLCs | per-game count | sections as data, not a bool | + +Decision (user, 2026-11-02): disallow DLC-first. A player may go off to the DLC +by hand, but AutoStory's DLC checkpoints assume the main story is done. + +## DLC bought later + +A user ran the main story, the DLC comes out, they buy it and want only the DLC: -## Sketch: tracks +1. The DLC checkpoints are appended after the main story's last one (or form + the next section). Appending moves no existing index, so saved start/end + settings still mean the same checkpoints. +2. The user picks the first DLC checkpoint as start and the last as end. Each + checkpoint starts from the save, so it doesn't matter whether the main story + was played by AutoStory or by hand. +3. The first DLC checkpoint states its precondition (main story done, DLC + installed, where to stand) and checks it at the start: no DLC or wrong spot + stops the run with a clear message before anything is saved. + +## What changes in code + +- `story_index(bool main_story, ...)` assumes two sections. A third one (a + break before a DLC) turns the bool into a section index and the section list + into per-game data. +- Inserting checkpoints mid-list would shift saved indices; only append, or + identify checkpoints by stable string ids (FRLG and BDSP already have them, + e.g. `"00.08"`). + +## If branches are ever supported: tracks + +Only needed if DLC-first (or another free-order choice) is supported. Sketch: ```cpp struct StoryRef{ @@ -38,33 +73,14 @@ struct StoryRef{ }; struct StoryTrack{ - std::string id; // "tutorial", "main", "postgame", "teal_mask" + std::string id; // "main", "teal_mask" std::string name; // shown in the UI std::vector entries; // linear within the track - std::optional starts_after; // Teal Mask: after main X; - // Indigo Disk: after Teal Mask's end; - // postgame: after main's end + std::optional starts_after; // where the branch leaves "main" }; - -// Each game supplies its tracks as data. -const std::vector& story_tracks(); ``` -- A run picks one track, then a start and an end inside it. As now, the save - must match the start checkpoint; `starts_after` documents and validates the - order, it doesn't drive the run. -- UI: a track dropdown, then start/end dropdowns filtered to that track. With one - track (FRLG, BDSP today) the track dropdown can be hidden. -- Identify checkpoints by track id plus entry id (or stable string ids), not by - one global index. SV stores the dropdown choice as an index string in users' - saved settings; splicing a DLC into one flat numbering would shift every later - index and silently change saved settings. A migration from SV's current - two-section settings would map (section, index) to (track, entry id). -- An appended postgame needs only a new track (or more entries in "main"); the - branch cases are what force `starts_after` and per-track ids. - -## When to do it - -Not before a game needs a third section. The first one decides the shape: FRLG's -postgame is an append; SV DLC is a branch. Until then `story_index()` carries a -NOTE stating the two-section assumption. +A run picks a track, then start and end inside it; checkpoints are identified by +track plus entry id; SV's saved (section, index) settings migrate to (track, id). +Later checkpoints in "main" would then need a known state for both orders, which +is why this stays out until someone needs it.