Skip to content

Bug: TUNIC: 'all state' constructed in stage_extend_hint_information collects most items twice #6334

Description

@Mysteryem

What happened?

multiworld.get_all_state() cannot be used to produce a valid 'all state' after Core AP's main fill has been run because get_all_state() collects all items from multiworld.itempool and all reachable placed items, which typically results in collecting every item into the 'all state' twice.

With default arguments, get_all_state() also collects items from each worlds' get_pre_fill_items(), which would generally be invalid to do after the pre_fill step because those items should be placed after the pre_fill step, so collecting items from each world's get_pre_fill_items() would often result in collecting those items a second time.

def stage_extend_hint_information(cls, multiworld: MultiWorld, hint_data: dict[int, dict[int, str]]) -> None:
tunic_er_worlds: list[TunicWorld] = [world for world in multiworld.get_game_worlds("TUNIC")
if world.options.entrance_rando]
if not tunic_er_worlds:
return
hint_data.update({world.player: {} for world in tunic_er_worlds})
all_state = multiworld.get_all_state()

multiworld.get_all_state():

Archipelago/BaseClasses.py

Lines 452 to 464 in 6875f9d

ret = CollectionState(self, allow_partial_entrances)
for item in self.itempool:
self.worlds[item.player].collect(ret, item)
if collect_pre_fill_items:
for player in self.player_ids:
subworld = self.worlds[player]
for item in subworld.get_pre_fill_items():
subworld.collect(ret, item)
if perform_sweep:
ret.sweep_for_advancements()
return ret

What were the expected results?

The 'all state' that is constructed should only collect each Item instance at most once.

Software

Local generation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions