Skip to content

AutoStory: compute start/end story indices with one shared function - #44

Draft
dayfine wants to merge 11 commits into
autostory/r1-select-dbfrom
autostory/r2-story-index
Draft

dayfine wants to merge 11 commits into
autostory/r1-select-dbfrom
autostory/r2-story-index

Conversation

@dayfine

@dayfine dayfine commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Depends on #43. Base: autostory/r1-select-db; autostory/story-select (PokemonAutomation#1828) is merged in, so the diff also shows its review changes to #43's code, including the select tests moved to Pokemon/AutoStory/Pokemon_AutoStorySelect_Tests.*.

The six SV start/end index helpers and the two descriptions repeated the tutorial/main-story offset maths. story_index() does it once. With PokemonAutomation#1828 merged in, the select and story-index tests live in Pokemon_AutoStorySelect_Tests.*, and r2's older SV copies of them are removed. No behaviour change; not run on a Switch. Fork CI after the PokemonAutomation#1828 merge: Ubuntu run 41525109465.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E

…with tests

Depends on the shared select database commit. The six SV index helpers and
the two descriptions repeated the same tutorial/main-story offset maths;
story_index() does it once and is tested with SV's offsets.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine added a commit that referenced this pull request Nov 1, 2026
…d AutoStory stats, for story runs

StoryRunOptions (now "Story Run") takes the game's checkpoint database
and shows Start and End checkpoint dropdowns, labeled as SV labels its
segments ("00.09 Pewter Gym: Camper Liam, then Brock") and built with
#43's make_story_select_database(); a story in sections passes them joined,
so a section's entry is at #44's story_index(). A start after the end is
refused. record_story_stats() adds a segment's run to #45's
AutoStoryStats: the segment, each passed checkpoint, each reload.

Tests: the dropdowns' labels, slugs and defaults, the start/end check,
and the stats.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
… autostory/r2-story-index

The select-database test now comes from #43; this branch keeps
story_index() and its tests, so the test exists once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
dayfine added a commit that referenced this pull request Nov 1, 2026
…s it

Moved here from #44 (user decision): a section of a story list keeps its
whole-list slugs and the end is clamped to the list. #44 keeps
story_index() and its tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
@dayfine dayfine added autostory AutoStory programs game:shared Shared or game-neutral code refactor No behavior change labels Nov 1, 2026
dayfine and others added 6 commits November 1, 2026 23:05
SV AutoStory built six near-identical start/end dropdown databases by hand
and repeated the tutorial/main-story index offset maths in six helpers and
two descriptions. make_story_select_database() and story_index() in
Pokemon/AutoStory/Pokemon_AutoStorySelect.h do each once, for other games'
AutoStory to reuse, with their tests beside them. No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
start_segment_description() and end_segment_description() computed the
tutorial/main-story segment offset inline. They now call
get_start_segment_index() / get_end_segment_index(), like the checkpoint
descriptions, which removes the last two inline copies of that offset
(pa-devbot review on PokemonAutomation#1828). No behavior
change: both getters return the same index for tutorial and main story.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
story_index() maps a tutorial or main-story position to the flat story
list. Note that this assumes two consecutive sections, which is all SV
AutoStory covers, and that a branching postgame or DLC needs another model.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Takes the reviewed version of the shared select code from
PokemonAutomation#1828: Pokemon_AutoStorySelect.h and its
tests in Pokemon/AutoStory/Pokemon_AutoStorySelect_Tests.*. The older
AutoStory index tests in PokemonSV_Tests.cpp are dropped; PokemonAutomation#1828's suite
covers them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AKYzhrMnPK61XHWEch4a6E
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autostory AutoStory programs game:shared Shared or game-neutral code refactor No behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant