From 75de61646574cc8d021c99f8119c6969ee348975 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Thu, 24 Mar 2022 17:15:52 +0100 Subject: [PATCH] Core: remove sending_visible (#339) * Core: remove sending_visible Only used by Factorio and that use predates start_location_hints, which works perfectly fine for this purpose. * Factorio: minor cleanup --- Main.py | 7 +------ worlds/AutoWorld.py | 4 ---- worlds/factorio/__init__.py | 7 ++++++- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/Main.py b/Main.py index b35a1bec..c7a4b8f6 100644 --- a/Main.py +++ b/Main.py @@ -342,12 +342,9 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No for player, world_precollected in world.precollected_items.items()} precollected_hints = {player: set() for player in range(1, world.players + 1 + len(world.groups))} - sending_visible_players = set() for slot in world.player_ids: slot_data[slot] = world.worlds[slot].fill_slot_data() - if world.worlds[slot].sending_visible: - sending_visible_players.add(slot) def precollect_hint(location): entrance = er_hint_data.get(location.player, {}).get(location.address, "") @@ -367,9 +364,7 @@ def main(args, seed=None, baked_server_options: Optional[Dict[str, object]] = No assert location.item.code is not None locations_data[location.player][location.address] = \ location.item.code, location.item.player, location.item.flags - if location.player in sending_visible_players: - precollect_hint(location) - elif location.name in world.start_location_hints[location.player]: + if location.name in world.start_location_hints[location.player]: precollect_hint(location) elif location.item.name in world.start_hints[location.item.player]: precollect_hint(location) diff --git a/worlds/AutoWorld.py b/worlds/AutoWorld.py index fd3b44af..ee31b89a 100644 --- a/worlds/AutoWorld.py +++ b/worlds/AutoWorld.py @@ -132,10 +132,6 @@ class World(metaclass=AutoWorldRegister): item_names: Set[str] # set of all potential item names location_names: Set[str] # set of all potential location names - # If the game displays all contained items to the user, this flag pre-fills the hint system with this information - # For example the "full" tech tree information option in Factorio - sending_visible: bool = False - web: WebWorld = WebWorld() def __init__(self, world: MultiWorld, player: int): diff --git a/worlds/factorio/__init__.py b/worlds/factorio/__init__.py index 04c8f907..cb41b027 100644 --- a/worlds/factorio/__init__.py +++ b/worlds/factorio/__init__.py @@ -57,6 +57,7 @@ class Factorio(World): attack_traps_wanted = self.world.attack_traps[player].value traps_wanted = ["Evolution Trap"] * evolution_traps_wanted + ["Attack Trap"] * attack_traps_wanted self.world.random.shuffle(traps_wanted) + for tech_name in base_tech_table: if traps_wanted and tech_name in useless_technologies: self.world.itempool.append(self.create_item(traps_wanted.pop())) @@ -71,11 +72,15 @@ class Factorio(World): self.world.get_location(tech_name, player).place_locked_item(tech_item) else: self.world.itempool.append(tech_item) + map_basic_settings = self.world.world_gen[player].value["basic"] if map_basic_settings.get("seed", None) is None: # allow seed 0 map_basic_settings["seed"] = self.world.slot_seeds[player].randint(0, 2 ** 32 - 1) # 32 bit uint - self.sending_visible = self.world.tech_tree_information[player] == TechTreeInformation.option_full + # used to be called "sending_visible" + if self.world.tech_tree_information[player] == TechTreeInformation.option_full: + # mark all locations as pre-hinted + self.world.start_location_hints[self.player].value.update(base_tech_table) generate_output = generate_mod