Skip to content

Step a structural zero-length "follow the player" walk each turn - #16

Open
angstsmurf wants to merge 1 commit into
jcwild:masterfrom
angstsmurf:zero-length-follow-walk
Open

Step a structural zero-length "follow the player" walk each turn#16
angstsmurf wants to merge 1 commit into
jcwild:masterfrom
angstsmurf:zero-length-follow-walk

Conversation

@angstsmurf

@angstsmurf angstsmurf commented Jul 27, 2026

Copy link
Copy Markdown

Problem

Son of Camelot cannot be completed with the current ADRIFT runner (regardless of the reply to the Adventure Upgrade dialog at the start.)

A zero-length looping walk — a lone Player 0 step with Loop set, which is the standard "follow the player" pattern — never moves its walker at all.

lStop only restarts a looping walk when Length > 0. That guard is needed, since a 0-length restart would recurse lStart <-> lStop forever, but it also means such a walk is left Finished immediately after its own lStart, and DoAnySteps' Status = StatusEnum.Running gate then rejects it on every subsequent turn.

Everything else is already in place for these walks to work: TurnBasedStuff calls IncrementTimer for every walk regardless of status, IncrementTimer calls DoAnySteps unconditionally, and with Length 0 TimerFromStartOfWalk stays 0, so the lone step would match each tick if the gate let it through.

Repro: Son of Camelot (Finn Rosenlov, IF Comp 2011). Megan's walk is exactly this shape.

Restore the attached save file in this game, type TELL MEGAN ABOUT MERLIN and then E. Instead of the expected text "Megan enters right after you" she stays put, and the game cannot be completed.

Fix: let a Finished walk through the gate when it loops and is structurally zero-length. The test is on the step turn counts, not on the runtime Length: a normal patrol walk that was stopped before it ever started is also Finished with Length 0 (never lStart'ed, so ResetLength never ran), but its steps carry real durations and it must stay stopped rather than jump to its first step.

The change is in ADRIFT/Item Classes/clsCharacter.vb. Note that the copy at ADRIFT/clsCharacter.vb has the same code but is not referenced by any of the four .vbproj files, so I left it untouched.

I have verified the reasoning against the source and tested the equivalent change in two other ADRIFT implementations (across ~110 games, without regressions), but I have not been able to build and run this repo's Runner myself. I have also verified the problem in Adrift Runner 5.0.36.6 on Windows 10.

🤖 Generated with Claude Code (but edited by a human)

Soc.tas.zip

…turn

A zero-length looping walk -- a lone `Player 0` step with Loop set, which is
the standard "follow the player" pattern -- never moves its walker at all.

lStop only restarts a looping walk when `Length > 0`. That guard is needed,
since a 0-length restart would recurse lStart <-> lStop forever, but it also
means such a walk is left Finished immediately after its own lStart, and
DoAnySteps' `Status = StatusEnum.Running` gate then rejects it on every
subsequent turn.

Everything else is already in place for these walks to work: TurnBasedStuff
calls IncrementTimer for every walk regardless of status, IncrementTimer calls
DoAnySteps unconditionally, and with Length 0 TimerFromStartOfWalk stays 0, so
the lone step would match each tick if the gate let it through.

Repro: Son of Camelot (Finn Rosenlov, IF Comp 2011). Megan's walk is exactly
this shape, so she stays put instead of following the player down to Merlin's
grave, and the game cannot be completed.

Let a Finished walk through the gate when it loops and is structurally
zero-length. The test is on the step turn counts, not on the runtime Length: a
normal patrol walk that was stopped before it ever started is also Finished
with Length 0 (never lStart'ed, so ResetLength never ran), but its steps carry
real durations and it must stay stopped rather than jump to its first step.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@angstsmurf
angstsmurf marked this pull request as ready for review July 27, 2026 19:20
angstsmurf added a commit to angstsmurf/spatterlight that referenced this pull request Jul 27, 2026
The rationale claimed the real ADRIFT Runner still steps such a walker every
turn and that FrankenDrift's `Status = Running` gate was what broke it. Not so:
upstream ADRIFT has the identical gate in clsWalk.DoAnySteps, so a structurally
zero-length looping walk is dead there too. Comment only; the fix itself is
unchanged and is now offered upstream as jcwild/ADRIFT-5#16.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant