From de2aff67246c559bb2479c714f2d73e75107effb Mon Sep 17 00:00:00 2001 From: codemann8 Date: Mon, 7 Jun 2021 10:52:47 -0500 Subject: [PATCH] Adding new GUI/CLI option for OW Tile Swap --- BaseClasses.py | 7 +++-- CLI.py | 3 ++- Main.py | 4 +-- Mystery.py | 2 ++ README.md | 27 ++++++++++++++++--- resources/app/cli/args.json | 7 +++++ resources/app/cli/lang/en.json | 9 +++++++ resources/app/gui/lang/en.json | 5 ++++ .../app/gui/randomize/overworld/widgets.json | 17 +++++++++--- source/classes/constants.py | 1 + 10 files changed, 69 insertions(+), 13 deletions(-) diff --git a/BaseClasses.py b/BaseClasses.py index 3683e899..4721ef85 100644 --- a/BaseClasses.py +++ b/BaseClasses.py @@ -19,11 +19,12 @@ from RoomData import Room class World(object): - def __init__(self, players, owShuffle, shuffle, doorShuffle, logic, mode, swords, difficulty, difficulty_adjustments, + def __init__(self, players, owShuffle, owSwap, shuffle, doorShuffle, logic, mode, swords, difficulty, difficulty_adjustments, timer, progressive, goal, algorithm, accessibility, shuffle_ganon, retro, custom, customitemarray, hints): self.players = players self.teams = 1 self.owShuffle = owShuffle.copy() + self.owSwap = owSwap.copy() self.owKeepSimilar = {} self.shuffle = shuffle.copy() self.doorShuffle = doorShuffle.copy() @@ -2152,6 +2153,7 @@ class Spoiler(object): 'weapons': self.world.swords, 'goal': self.world.goal, 'ow_shuffle': self.world.owShuffle, + 'ow_swap': self.world.owSwap, 'ow_keepsimilar': self.world.owKeepSimilar, 'shuffle': self.world.shuffle, 'door_shuffle': self.world.doorShuffle, @@ -2232,8 +2234,9 @@ class Spoiler(object): outfile.write('Difficulty:'.ljust(line_width) + '%s\n' % self.metadata['item_pool'][player]) outfile.write('Item Functionality:'.ljust(line_width) + '%s\n' % self.metadata['item_functionality'][player]) outfile.write('Overworld Layout Shuffle:'.ljust(line_width) + '%s\n' % self.metadata['ow_shuffle'][player]) + outfile.write('Overworld Tile Swap:'.ljust(line_width) + '%s\n' % self.metadata['ow_swap'][player]) if self.metadata['ow_shuffle'][player] != 'vanilla': - outfile.write('Keep OW Edges Together:'.ljust(line_width) + '%s\n' % ('Yes' if self.metadata['ow_keepsimilar'][player] else 'No')) + outfile.write('Keep Similar OW Edges Together:'.ljust(line_width) + '%s\n' % ('Yes' if self.metadata['ow_keepsimilar'][player] else 'No')) outfile.write('Entrance Shuffle:'.ljust(line_width) + '%s\n' % self.metadata['shuffle'][player]) outfile.write('Door Shuffle:'.ljust(line_width) + '%s\n' % self.metadata['door_shuffle'][player]) outfile.write('Intensity:'.ljust(line_width) + '%s\n' % self.metadata['intensity'][player]) diff --git a/CLI.py b/CLI.py index bc112439..e1c61fd1 100644 --- a/CLI.py +++ b/CLI.py @@ -93,7 +93,7 @@ def parse_cli(argv, no_defaults=False): for player in range(1, multiargs.multi + 1): playerargs = parse_cli(shlex.split(getattr(ret, f"p{player}")), True) - for name in ['logic', 'mode', 'swords', 'goal', 'difficulty', 'item_functionality', 'ow_shuffle', 'ow_keepsimilar', + for name in ['logic', 'mode', 'swords', 'goal', 'difficulty', 'item_functionality', 'ow_shuffle', 'ow_swap', 'ow_keepsimilar', 'shuffle', 'door_shuffle', 'intensity', 'crystals_ganon', 'crystals_gt', 'openpyramid', 'mapshuffle', 'compassshuffle', 'keyshuffle', 'bigkeyshuffle', 'startinventory', 'triforce_pool_min', 'triforce_pool_max', 'triforce_goal_min', 'triforce_goal_max', @@ -142,6 +142,7 @@ def parse_settings(): "openpyramid": False, "shuffleganon": True, "ow_shuffle": "vanilla", + "ow_swap": "vanilla", "ow_keepsimilar": False, "shuffle": "vanilla", "shufflelinks": False, diff --git a/Main.py b/Main.py index 3e7ac554..f4f9c371 100644 --- a/Main.py +++ b/Main.py @@ -50,7 +50,7 @@ def main(args, seed=None, fish=None): for player, code in args.code.items(): if code: Settings.adjust_args_from_code(code, player, args) - world = World(args.multi, args.ow_shuffle, args.shuffle, args.door_shuffle, args.logic, args.mode, args.swords, + world = World(args.multi, args.ow_shuffle, args.ow_swap, args.shuffle, args.door_shuffle, args.logic, args.mode, args.swords, args.difficulty, args.item_functionality, args.timer, args.progressive, args.goal, args.algorithm, args.accessibility, args.shuffleganon, args.retro, args.custom, args.customitemarray, args.hints) logger = logging.getLogger('') @@ -350,7 +350,7 @@ def main(args, seed=None, fish=None): def copy_world(world): # ToDo: Not good yet - ret = World(world.players, world.owShuffle, world.shuffle, world.doorShuffle, world.logic, world.mode, world.swords, + ret = World(world.players, world.owShuffle, world.owSwap, world.shuffle, world.doorShuffle, world.logic, world.mode, world.swords, world.difficulty, world.difficulty_adjustments, world.timer, world.progressive, world.goal, world.algorithm, world.accessibility, world.shuffle_ganon, world.retro, world.custom, world.customitemarray, world.hints) ret.teams = world.teams diff --git a/Mystery.py b/Mystery.py index 87d9b920..64f2fa73 100644 --- a/Mystery.py +++ b/Mystery.py @@ -133,6 +133,8 @@ def roll_settings(weights): overworld_shuffle = get_choice('overworld_shuffle') ret.ow_shuffle = overworld_shuffle if overworld_shuffle != 'none' else 'vanilla' + overworld_shuffle = get_choice('overworld_swap') + ret.ow_swap = overworld_swap if overworld_swap != 'none' else 'vanilla' ret.ow_keepsimilar = get_choice('ow_keepsimilar') entrance_shuffle = get_choice('entrance_shuffle') ret.shuffle = entrance_shuffle if entrance_shuffle != 'none' else 'vanilla' diff --git a/README.md b/README.md index c506bca5..0ab71641 100644 --- a/README.md +++ b/README.md @@ -13,17 +13,16 @@ This is a very new mode of LTTPR so the tools and info is very limited. - There - There is an [OW OWG Reference Sheet](https://zelda.codemann8.com/images/shared/ow-owg-reference-sheet.png) that shows all the in-logic places where boots/mirror clips and fake flippers are expected from the player. # Known Issues -(Updated 2021-05-26) +(Updated 2021-06-07) ### If you want to playtest this, know these things: - Big Red Bomb may require bomb duping as ledge drops may be in the way of your path to the Pyramid Fairy crack - Do NOT grab the Frogsmith until you have seen the Blacksmith location. Doing so may prevent you from continuing in your save file. -- ~~Inverted regions/rules/logic is NOT implemented yet. Generation should fail 100%.~~ _(Fixed with 0.1.4.0)_ - If you fake flipper, beware of transitioning south. You could end up at the top of the waterfall in the southeast of either world. If you mistakenly drop down, it is important to NOT make any other movements and S+Q immediately when the game allows you to (might take several seconds, the game has to scroll back to the original point of water entry) or there will be a hardlock. Falling from the waterfall is avoidable but it is super easy to do as it is super close to the transition. ### Known bugs: -- ~~Camera unlocks, this is a known issue and will eventually be fixed at a later time~~ _(Fixed with 0.1.1.2)_ -- ~~When generating, there is a message about one location that remains unfilled. You will find a Nothing item at that location.~~ _(Fixed with 0.1.1.0)_ +- Screens that loop on itself and also have free-standing items, the sprites are duplicated and can cause item duplication +- When OWG are performed to enter mega-tile screens (large OW screens), there is a small chance that an incorrect VRAM reference value causes the map graphics to offset in increments of 16 pixels - There may be an issue with progression being front-loaded in the seed in some scenarios, due to an unsophisticated shuffle algorithm that could make varying-sized parts of each world unreachable # Feedback and Bug Reports @@ -62,6 +61,20 @@ OW Transitions are shuffled, but both worlds will have a matching layout. OW Transitions are shuffled within each world separately. +## Overworld Tile Swap (--ow_swap) + +### Vanilla + +OW tiles remain in their original worlds. + +### Mixed + +OW tiles are randomly chosen to become a part of the opposite world + +### Crossed + +OW tiles remain in their original world, but transitions can now be travel cross-world. + ## Keep Similar Edges Together (--ow_keepsimilar) This keeps similar edge transitions together. ie. The 2 west edges of Potion Shop will be paired to another set of two similar edges @@ -81,6 +94,12 @@ Show the help message and exit. For specifying the overworld layout shuffle you want as above. (default: vanilla) +``` +--ow_swap +``` + +For specifying the overworld tile swap you want as above. (default: vanilla) + ``` --ow_keepsimilar ``` diff --git a/resources/app/cli/args.json b/resources/app/cli/args.json index 121bc200..34066b63 100644 --- a/resources/app/cli/args.json +++ b/resources/app/cli/args.json @@ -116,6 +116,13 @@ "full" ] }, + "ow_swap": { + "choices": [ + "vanilla", + "mixed", + "crossed" + ] + }, "ow_keepsimilar": { "action": "store_true", "type": "bool" diff --git a/resources/app/cli/lang/en.json b/resources/app/cli/lang/en.json index f043afa5..97ef3fd4 100644 --- a/resources/app/cli/lang/en.json +++ b/resources/app/cli/lang/en.json @@ -202,6 +202,15 @@ "Full: Overworld transitions are shuffled, but both worlds", " will have an independent map shape." ], + "ow_swap": [ + "This swaps the tiles of the overworld from one world to the other.", + "Vanilla: All overworld tiles remain in their original world as", + " they were in the base game.", + "Mixed: Overworld tiles are randomly chosen to become part of", + " the opposite world.", + "Crossed: Overworld tiles remain in their original world, but", + " the transitions are shuffled cross world." + ], "ow_keepsimilar": [ "This keeps similar edge transitions together. ie. the two west edges on", "Potion Shop will be paired with another similar pair." ], diff --git a/resources/app/gui/lang/en.json b/resources/app/gui/lang/en.json index 47dd7891..007bb73d 100644 --- a/resources/app/gui/lang/en.json +++ b/resources/app/gui/lang/en.json @@ -114,6 +114,11 @@ "randomizer.overworld.overworldshuffle.parallel": "Parallel", "randomizer.overworld.overworldshuffle.full": "Full", + "randomizer.overworld.overworldswap": "Tile Swap", + "randomizer.overworld.overworldswap.vanilla": "Vanilla", + "randomizer.overworld.overworldswap.mixed": "Mixed", + "randomizer.overworld.overworldswap.crossed": "Crossed", + "randomizer.overworld.keepsimilar": "Keep Similar Edges Together", "randomizer.entrance.openpyramid": "Pre-open Pyramid Hole", diff --git a/resources/app/gui/randomize/overworld/widgets.json b/resources/app/gui/randomize/overworld/widgets.json index 4a0f2034..dfacfbd6 100644 --- a/resources/app/gui/randomize/overworld/widgets.json +++ b/resources/app/gui/randomize/overworld/widgets.json @@ -1,17 +1,26 @@ { "widgets": { + "keepsimilar": { + "type": "checkbox", + "default": true + }, "overworldshuffle": { "type": "selectbox", - "default": "parallel", + "default": "vanilla", "options": [ "vanilla", "parallel", "full" ] }, - "keepsimilar": { - "type": "checkbox", - "default": true + "overworldswap": { + "type": "selectbox", + "default": "mixed", + "options": [ + "vanilla", + "mixed", + "crossed" + ] } } } \ No newline at end of file diff --git a/source/classes/constants.py b/source/classes/constants.py index 1b213b3a..ddab86c0 100644 --- a/source/classes/constants.py +++ b/source/classes/constants.py @@ -74,6 +74,7 @@ SETTINGSTOPROCESS = { }, "overworld": { "overworldshuffle": "ow_shuffle", + "overworldswap": "ow_swap", "keepsimilar": "ow_keepsimilar" }, "entrance": {