Archipelago
Archipelago copied to clipboard
Core: Fix a playthrough crash when a world uses "placement based logic"
Playthrough currently rips items out from their locations to check whether they need to be collected.
However, there are some games where "this location needs to keep its item" is not equivalent to "this location needs to be checked".
Specifically, this happens when location.item == ... is checked as part of an access rule.
This can cause a completely unnecessary/avoidable crash.
An example of this is ALTTP, where the access rule of one location depends on what item is present on a different location: https://github.com/ArchipelagoMW/Archipelago/blob/main/worlds/alttp/Rules.py#L1029-L1036
This led to a crash during playthrough where the Hyrule Small Key from Sewers - Key Rat Key Drop was ripped out, which changes the logic for Hyrule Castle - Boomerang Guard Key Drop, which then becomes unreachable. Thus, it is determined that Sewers - Key Rat Key Drop is required to keep its item, which playthrough interprets as it needing to be checked to win.
But this is not true, it is only required that it keeps its Hyrule Small Key to keep the logic of Boomerang Guard less restrictive.
In a later step, playthrough rips out a different Hyrule Small Key, making Rat Key Drop unreachable, but the game is still beatable. At the end, during reachability verification, the supposedly "required" Rat Key Drop is now no longer reachable, crashing playthrough.
This PR changes playthrough generation to mark locations for whether they are required to be collected, rather than ripping their items out, bringing the effect of the code in line with what the code thinks it's doing.
Tested: Ran the crashing seed I found, it works now. Did some test gens to see if I broke anything else. Probably not enough