Skip to content

Default pre-5.0.22 adventures to HighestPriorityPassingTask - #15

Open
angstsmurf wants to merge 1 commit into
jcwild:masterfrom
angstsmurf:taskexecution-pre-5022-default
Open

Default pre-5.0.22 adventures to HighestPriorityPassingTask#15
angstsmurf wants to merge 1 commit into
jcwild:masterfrom
angstsmurf:taskexecution-pre-5022-default

Conversation

@angstsmurf

@angstsmurf angstsmurf commented Jul 26, 2026

Copy link
Copy Markdown

Problem

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

UNLOCK CHAIN will produce the response "The heavy chain cannot be locked or unlocked" instead of the intended "The key fits perfectly in the lock, and within seconds the chain is unlocked."

(There is a similar problem in Death Shack, where OPEN DOOR outputs "You can't do that here!", making the game unwinnable.)

clsAdventure.TaskExecution defaults to HighestPriorityTask, and Load500 only ever overrides it when the adventure file carries an explicit <TaskExecution> element:

If .Item("TaskExecution") IsNot Nothing Then a.TaskExecution = ...

However, the <TaskExecution> element and the HighestPriorityTask mode were both introduced in 5.0.22, so adventures authored before 5.0.22 never carry the element, and run the v4 "highest priority passing task" logic — the same logic the v4 .taf loader still sets explicitly (FileIO.vb, .TaskExecution = clsAdventure.TaskExecutionEnum.HighestPriorityPassingTask). This makes these games unwinnable: puzzles whose task is a lower-priority passing task never fire, because a higher-priority failing-with-output library task claims the turn.

Repro: Return to Camelot. The central unlock chain puzzle hits the stock library unlock %object% task → "The heavy chain cannot be locked or unlocked", so the armour-freeing task never runs and the game can't be completed.

This was reproduced in ADRIFT Runner 5.0.36.6 on Windows 10, running Return to Camelot and Death Shack with the attached save files.

Fix

When <TaskExecution> is absent and the file version is < 5.000022, fall back to HighestPriorityPassingTask.

The ElseIf is additionally guarded with Not bLibrary, following the Title/Author idiom a few lines above, so that loading an old library file in the Generator can't clobber the setting of the adventure that is already loaded.

Validation

I can't build the WinForms solution here (macOS), so this was validated by applying the identical change to the FrankenDrift port of this source (awlck/frankendrift#69): Return to Camelot and Death Shack both then reach *** You have won ***, with the full transcripts cross-checked byte-for-byte against a second, independent ADRIFT 5 interpreter (Scarier, which version-gates the same default). No other game in a ~110-game regression corpus changed behaviour.

🤖 Generated with Claude Code (but edited by a human)
RtC.tas.zip
deathshack.tas.zip

clsAdventure.TaskExecution defaults to HighestPriorityTask, and Load500 only
ever overrides it when the file carries an explicit <TaskExecution> element.
But both that element and the HighestPriorityTask mode arrived in 5.0.22.
Adventures written before then never carry the element, and ran the v4
"highest priority passing task" logic -- the same logic the v4 .taf loader
still sets explicitly. Leaving them on the modern default can make them
unwinnable: a puzzle whose task is a lower priority passing task never fires
because a higher priority failing-with-output library task claims the turn.

Repro: Return to Camelot (Finn Rosenlov, IF Comp 2011), file version
5.000020. "unlock chain" hits the stock library "unlock %object%" task
("The heavy chain cannot be locked or unlocked"), so the armour-freeing task
never runs and the game cannot be completed.

When the element is absent and dFileVersion < 5.000022, fall back to
HighestPriorityPassingTask. Guarded with Not bLibrary so that loading an old
library file cannot clobber the setting of the adventure already loaded.

Co-Authored-By: Claude Opus 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