forked from mirror/Archipelago
Core: Better scaling explicit indirect conditions (#4582)
* Core: Better scaling explicit indirect conditions When the number of connections to retry was large and `queue` was large `new_entrance not in queue` would get slow. For the average supported world, the difference this change makes is negligible. For a game like Blasphemous, with a lot of explicit indirect conditions, generation of 10 template Blasphemous yamls with `--skip_output --seed 1` and progression balancing disabled went from 19.0s to 17.9s (5.9% reduction in generation duration). * Create a new variable for the new set created from the intersection
This commit is contained in:
@@ -788,9 +788,11 @@ class CollectionState():
|
||||
self.multiworld.worlds[player].reached_region(self, new_region)
|
||||
|
||||
# Retry connections if the new region can unblock them
|
||||
for new_entrance in self.multiworld.indirect_connections.get(new_region, set()):
|
||||
if new_entrance in blocked_connections and new_entrance not in queue:
|
||||
queue.append(new_entrance)
|
||||
entrances = self.multiworld.indirect_connections.get(new_region)
|
||||
if entrances is not None:
|
||||
relevant_entrances = entrances.intersection(blocked_connections)
|
||||
relevant_entrances.difference_update(queue)
|
||||
queue.extend(relevant_entrances)
|
||||
|
||||
def _update_reachable_regions_auto_indirect_conditions(self, player: int, queue: deque[Entrance]):
|
||||
reachable_regions = self.reachable_regions[player]
|
||||
|
||||
Reference in New Issue
Block a user