From 4b7c453219db3bc1474af8fbe80f908f41fe1fc6 Mon Sep 17 00:00:00 2001 From: Catobat <69204835+Catobat@users.noreply.github.com> Date: Mon, 12 Jan 2026 21:53:52 +0100 Subject: [PATCH] Add ow_fog setting --- BaseClasses.py | 9 +++++++-- CLI.py | 7 ++++++- Main.py | 3 +++ README.md | 6 ++++++ Rom.py | 2 +- resources/app/cli/args.json | 9 +++++++++ resources/app/cli/lang/en.json | 3 +++ resources/app/gui/lang/en.json | 2 ++ resources/app/gui/randomize/overworld/widgets.json | 7 +++++++ source/classes/CustomSettings.py | 2 ++ source/classes/constants.py | 3 ++- source/tools/MysteryUtils.py | 1 + 12 files changed, 49 insertions(+), 5 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index f8f86bec..d2bd6ddf 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -33,6 +33,7 @@ class World(object): self.owCrossed = self.owCrossed if self.owCrossed != 'polar' or self.owMixed else 'none' self.owWhirlpoolShuffle = {} self.owFluteShuffle = {} + self.owFog = {} self.shuffle = shuffle.copy() self.doorShuffle = doorShuffle.copy() self.intensity = {} @@ -3049,6 +3050,7 @@ class Spoiler(object): 'ow_mixed': self.world.owMixed, 'ow_whirlpool': self.world.owWhirlpoolShuffle, 'ow_fluteshuffle': self.world.owFluteShuffle, + 'ow_fog': self.world.owFog, 'bonk_drops': self.world.shuffle_bonk_drops, 'shuffle_followers': self.world.shuffle_followers, 'shuffle': self.world.shuffle, @@ -3323,6 +3325,8 @@ class Spoiler(object): outfile.write('OW Tile Flip (Mixed):'.ljust(line_width) + '%s\n' % yn(self.metadata['ow_mixed'][player])) outfile.write('Whirlpool Shuffle:'.ljust(line_width) + '%s\n' % yn(self.metadata['ow_whirlpool'][player])) outfile.write('Flute Shuffle:'.ljust(line_width) + '%s\n' % self.metadata['ow_fluteshuffle'][player]) + if self.metadata['ow_layout'][player] == 'grid' or self.metadata['ow_mixed'][player]: + outfile.write('Overworld Fog:'.ljust(line_width) + '%s\n' % yn(self.metadata['ow_fog'][player])) outfile.write('\n') outfile.write('Entrance Shuffle:'.ljust(line_width) + '%s\n' % self.metadata['shuffle'][player]) if self.metadata['shuffle'][player] != 'vanilla': @@ -3725,7 +3729,7 @@ boss_mode = {"none": 0, "simple": 1, "full": 2, "chaos": 3, 'random': 3, 'unique orlayout_mode = {"vanilla": 0, "grid": 1, "wild": 2} orcrossed_mode = {"none": 0, "polar": 1, "grouped": 2, "unrestricted": 4} -# byte 12: KMBQ FF?? (keep similar, mixed/tile flip, bonk drops, follower quests, flute spots) +# byte 12: KMBQ FFO? (keep similar, mixed/tile flip, bonk drops, follower quests, flute spots, fog) flutespot_mode = {"vanilla": 0, "balanced": 1, "random": 2} # byte 13: FBBB TTPP (flute_mode, bow_mode, take_any, prize shuffle) @@ -3793,7 +3797,7 @@ class Settings(object): (0x80 if w.owKeepSimilar[p] else 0) | (0x40 if w.owMixed[p] else 0) | (0x20 if w.shuffle_bonk_drops[p] else 0) | (0x10 if w.shuffle_followers[p] else 0) - | (flutespot_mode[w.owFluteShuffle[p]] << 4), + | (flutespot_mode[w.owFluteShuffle[p]] << 4) | (0x02 if w.owFog[p] else 0), (flute_mode[w.flute_mode[p]] << 7 | bow_mode[w.bow_mode[p]] << 4 | take_any_mode[w.take_any[p]] << 2 | prizeshuffle_mode[w.prizeshuffle[p]]), @@ -3881,6 +3885,7 @@ class Settings(object): args.bonk_drops[p] = True if settings[12] & 0x20 else False args.shuffle_followers[p] = True if settings[12] & 0x10 else False args.ow_fluteshuffle[p] = r(flutespot_mode)[(settings[12] & 0x0C) >> 2] + args.ow_fog[p] = True if settings[12] & 0x02 else False if len(settings) > 13: args.flute_mode[p] = r(flute_mode)[(settings[13] & 0x80) >> 7] diff --git a/CLI.py b/CLI.py index 0b4dceba..3afd4a71 100644 --- a/CLI.py +++ b/CLI.py @@ -130,6 +130,9 @@ def parse_cli(argv, no_defaults=False): ret.ow_layout = 'wild' ret.ow_parallel = False + if ret.ow_no_fog: + ret.ow_fog = False + if player_num: defaults = copy.deepcopy(ret) for player in range(1, player_num + 1): @@ -142,7 +145,7 @@ def parse_cli(argv, no_defaults=False): for name in ['logic', 'mode', 'swords', 'goal', 'difficulty', 'item_functionality', 'ow_shuffle', 'ow_layout', 'ow_parallel', 'ow_terrain', 'ow_crossed', 'ow_keepsimilar', 'ow_mixed', 'ow_whirlpool', 'ow_fluteshuffle', - 'flute_mode', 'bow_mode', 'take_any', 'boots_hint', 'shuffle_followers', + 'ow_fog', 'flute_mode', 'bow_mode', 'take_any', 'boots_hint', 'shuffle_followers', 'shuffle', 'door_shuffle', 'intensity', 'crystals_ganon', 'crystals_gt', 'openpyramid', 'mapshuffle', 'compassshuffle', 'keyshuffle', 'bigkeyshuffle', 'prizeshuffle', 'startinventory', 'usestartinventory', 'bombbag', 'shuffleganon', 'overworld_map', 'restrict_boss_items', @@ -213,6 +216,8 @@ def parse_settings(): "ow_mixed": False, "ow_whirlpool": False, "ow_fluteshuffle": "vanilla", + "ow_fog": True, + "ow_no_fog": False, "shuffle_followers": False, "bonk_drops": False, "shuffle": "vanilla", diff --git a/Main.py b/Main.py index 1f8c92ab..15b5099f 100644 --- a/Main.py +++ b/Main.py @@ -453,6 +453,7 @@ def init_world(args, fish): world.owKeepSimilar = args.ow_keepsimilar.copy() world.owWhirlpoolShuffle = args.ow_whirlpool.copy() world.owFluteShuffle = args.ow_fluteshuffle.copy() + world.owFog = args.ow_fog.copy() world.shuffle_followers = args.shuffle_followers.copy() world.shuffle_bonk_drops = args.bonk_drops.copy() world.open_pyramid = args.openpyramid.copy() @@ -765,6 +766,7 @@ def copy_world(world): ret.owKeepSimilar = world.owKeepSimilar.copy() ret.owWhirlpoolShuffle = world.owWhirlpoolShuffle.copy() ret.owFluteShuffle = world.owFluteShuffle.copy() + ret.owFog = world.owFog.copy() ret.shuffle_followers = world.shuffle_followers.copy() ret.shuffle_bonk_drops = world.shuffle_bonk_drops.copy() ret.open_pyramid = world.open_pyramid.copy() @@ -986,6 +988,7 @@ def copy_world_premature(world, player, create_flute_exits=True): ret.owKeepSimilar = world.owKeepSimilar.copy() ret.owWhirlpoolShuffle = world.owWhirlpoolShuffle.copy() ret.owFluteShuffle = world.owFluteShuffle.copy() + ret.owFog = world.owFog.copy() ret.shuffle_followers = world.shuffle_followers.copy() ret.shuffle_bonk_drops = world.shuffle_bonk_drops.copy() ret.open_pyramid = world.open_pyramid.copy() diff --git a/README.md b/README.md index f4c3102e..86d65eee 100644 --- a/README.md +++ b/README.md @@ -434,6 +434,12 @@ This gives each OW tile a random chance to be flipped to the opposite world For randomizing the flute spots around the overworld +``` +--ow_no_fog +``` + +With OW Grid Layout Shuffle or Mixed, this disables the fog that prevents you from seeing unvisited screens on the overworld map. + ``` --shuffle_followers ``` diff --git a/Rom.py b/Rom.py index 78be7463..374ea4a6 100644 --- a/Rom.py +++ b/Rom.py @@ -658,7 +658,7 @@ def patch_rom(world, rom, player, team, is_mystery=False, rom_header=None): write_int16(rom, 0x150002, owMode) write_int16(rom, 0x150004, owFlags) - write_int16(rom, 0x150008, owFog) + write_int16(rom, 0x150008, owFog if world.owFog[player] else 0x00) # patch entrance/exits/holes for region in world.regions: diff --git a/resources/app/cli/args.json b/resources/app/cli/args.json index 6e2e462c..22044974 100644 --- a/resources/app/cli/args.json +++ b/resources/app/cli/args.json @@ -224,6 +224,15 @@ "random" ] }, + "ow_fog": { + "action": "store_true", + "help": "suppress", + "type": "bool" + }, + "ow_no_fog": { + "action": "store_true", + "type": "bool" + }, "shuffle": { "choices": [ "vanilla", diff --git a/resources/app/cli/lang/en.json b/resources/app/cli/lang/en.json index 8b0c40ec..8eee7a1f 100644 --- a/resources/app/cli/lang/en.json +++ b/resources/app/cli/lang/en.json @@ -280,6 +280,9 @@ " spots from being on any adjacent screen.", "Random: New flute spots will be generated with minimal bias." ], + "ow_no_fog": [ + "With OW Grid Layout Shuffle or Mixed, this disables the fog that prevents", + "you from seeing unvisited screens on the overworld map." ], "door_shuffle": [ "Select Door Shuffling Algorithm. (default: %(default)s)", "Basic: Doors are mixed within a single dungeon.", diff --git a/resources/app/gui/lang/en.json b/resources/app/gui/lang/en.json index 1d1cee1f..8fd119e8 100644 --- a/resources/app/gui/lang/en.json +++ b/resources/app/gui/lang/en.json @@ -183,6 +183,8 @@ "randomizer.overworld.overworldflute.balanced": "Balanced", "randomizer.overworld.overworldflute.random": "Random", + "randomizer.overworld.fog": "Enable Overworld Map Fog in appropriate modes", + "randomizer.entrance.openpyramid": "Pre-open Pyramid Hole", "randomizer.entrance.openpyramid.auto": "Auto", diff --git a/resources/app/gui/randomize/overworld/widgets.json b/resources/app/gui/randomize/overworld/widgets.json index a2332d30..9a58ad66 100644 --- a/resources/app/gui/randomize/overworld/widgets.json +++ b/resources/app/gui/randomize/overworld/widgets.json @@ -48,6 +48,13 @@ "config": { "pady": [20,0] } + }, + "fog": { + "type": "checkbox", + "default": true, + "config": { + "pady": [20,0] + } } }, "rightOverworldFrame": { diff --git a/source/classes/CustomSettings.py b/source/classes/CustomSettings.py index 32b9cda0..a425b5db 100644 --- a/source/classes/CustomSettings.py +++ b/source/classes/CustomSettings.py @@ -101,6 +101,7 @@ class CustomSettings(object): args.ow_mixed[p] = get_setting(settings['ow_mixed'], args.ow_mixed[p]) args.ow_whirlpool[p] = get_setting(settings['ow_whirlpool'], args.ow_whirlpool[p]) args.ow_fluteshuffle[p] = get_setting(settings['ow_fluteshuffle'], args.ow_fluteshuffle[p]) + args.ow_fog[p] = get_setting(settings['ow_fog'], args.ow_fog[p]) args.shuffle_followers[p] = get_setting(settings['shuffle_followers'], args.shuffle_followers[p]) args.bonk_drops[p] = get_setting(settings['bonk_drops'], args.bonk_drops[p]) args.shuffle[p] = get_setting(settings['shuffle'], args.shuffle[p]) @@ -373,6 +374,7 @@ class CustomSettings(object): settings_dict[p]['ow_mixed'] = world.owMixed[p] settings_dict[p]['ow_whirlpool'] = world.owWhirlpoolShuffle[p] settings_dict[p]['ow_fluteshuffle'] = world.owFluteShuffle[p] + settings_dict[p]['ow_fog'] = world.owFog[p] settings_dict[p]['shuffle_followers'] = world.shuffle_followers[p] settings_dict[p]['bonk_drops'] = world.shuffle_bonk_drops[p] settings_dict[p]['shuffle'] = world.shuffle[p] diff --git a/source/classes/constants.py b/source/classes/constants.py index 2960a1cc..069afeae 100644 --- a/source/classes/constants.py +++ b/source/classes/constants.py @@ -99,7 +99,8 @@ SETTINGSTOPROCESS = { "keepsimilar": "ow_keepsimilar", "mixed": "ow_mixed", "whirlpool": "ow_whirlpool", - "overworldflute": "ow_fluteshuffle" + "overworldflute": "ow_fluteshuffle", + "fog": "ow_fog" }, "entrance": { "entranceshuffle": "shuffle", diff --git a/source/tools/MysteryUtils.py b/source/tools/MysteryUtils.py index 65fffd56..d73f9d67 100644 --- a/source/tools/MysteryUtils.py +++ b/source/tools/MysteryUtils.py @@ -139,6 +139,7 @@ def roll_settings(weights): ret.ow_whirlpool = get_choice_bool('whirlpool_shuffle') overworld_flute = get_choice('flute_shuffle') ret.ow_fluteshuffle = overworld_flute if overworld_flute != 'none' else 'vanilla' + ret.ow_fog = get_choice_bool('overworld_fog') ret.shuffle_followers = get_choice_bool('shuffle_followers') ret.bonk_drops = get_choice_bool('bonk_drops') entrance_shuffle = get_choice('entrance_shuffle')