From 121091c5a322eb3524fe9bcbc21754709ec6a05f Mon Sep 17 00:00:00 2001 From: aerinon Date: Thu, 28 Dec 2023 17:22:36 -0700 Subject: [PATCH] fix(generation): reduce memory usage for bunny walk calculations fix(key logic): make partial the default --- BaseClasses.py | 2 +- CLI.py | 2 +- RELEASENOTES.md | 14 +++++++++++++- Rules.py | 12 +++++++----- 4 files changed, 22 insertions(+), 8 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index c57e6a1b..ea311db9 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -170,7 +170,7 @@ class World(object): set_player_attr('door_self_loops', False) set_player_attr('door_type_mode', 'original') set_player_attr('trap_door_mode', 'optional') - set_player_attr('key_logic_algorithm', 'default') + set_player_attr('key_logic_algorithm', 'partial') set_player_attr('shopsanity', False) set_player_attr('mixed_travel', 'prevent') diff --git a/CLI.py b/CLI.py index e0039b65..ac628018 100644 --- a/CLI.py +++ b/CLI.py @@ -228,7 +228,7 @@ def parse_settings(): "intensity": 3, "door_type_mode": "original", "trap_door_mode": "optional", - "key_logic_algorithm": "default", + "key_logic_algorithm": "partial", "decoupledoors": False, "door_self_loops": False, "experimental": False, diff --git a/RELEASENOTES.md b/RELEASENOTES.md index 0c754ac6..f299105b 100644 --- a/RELEASENOTES.md +++ b/RELEASENOTES.md @@ -109,7 +109,19 @@ These are now independent of retro mode and have three options: None, Random, an # Bug Fixes and Notes -* 1.2.0.22u +* 1.4.0.0v + * Generation: fix for bunny walk logic taking up too much memory + * Key Logic: Partial is now the new default +* 1.3.0.9v + * Ganonhunt: playthrough no longer collects crystals + * Vanilla Fill: Uncle weapon is always a sword, medallions for Mire/TR will be vanilla + * Customizer: support shufflebosses/shuffleenemies as well as boss_shuffle/enemy_shuffle +* 1.3.0.8v + * No Logic Standard ER: Rain doors aren't blocked if no logic is enabled. + * MW Progression Balancing: Change to be percentage based instead of raw count. (80% threshold) + * Take anys: Good Bee cave chosen as take any should no longer prevent generation + * Money balancing: Fixed generation issue + 1.2.0.22u * Flute can't be activated in rain state (except glitched modes) (Thanks codemann!) * ER: Minor fix for Link's House on DM in Insanity (escape cave should not be re-used) * Logic issues: diff --git a/Rules.py b/Rules.py index b2073ab1..91c35c63 100644 --- a/Rules.py +++ b/Rules.py @@ -1711,16 +1711,17 @@ def set_bunny_rules(world, player, inverted): # for each such entrance a new option is added that consist of: # a) being able to reach it, and # b) being able to access all entrances from there to `region` - seen = {region} - queue = deque([(region, [])]) + queue = deque([(region, [], {region})]) + seen_sets = set([frozenset({region})]) while queue: (current, path) = queue.popleft() for entrance in current.entrances: new_region = entrance.parent_region - if new_region.type in (RegionType.Cave, RegionType.Dungeon) and new_region in seen: + new_seen = seen.union({new_region}) + if new_region.type in (RegionType.Cave, RegionType.Dungeon) and new_seen in seen_sets: continue new_path = path + [entrance.access_rule] - seen.add(new_region) + seen_sets.add(frozenset(new_seen)) if not is_link(new_region): if world.logic[player] == 'owglitches': if region.type == RegionType.Dungeon and new_region.type != RegionType.Dungeon: @@ -1757,7 +1758,8 @@ def set_bunny_rules(world, player, inverted): else: continue if is_bunny(new_region): - queue.append((new_region, new_path)) + # todo: if not owg or hmg and entrance is in bunny_impassible_doors, then skip this nonsense? + queue.append((new_region, new_path, new_seen)) else: # we have reached pure light world, so we have a new possible option possible_options.append(path_to_access_rule(new_path, entrance))