From 62088c34dd76feb111fc97f10926792e01c4d01f Mon Sep 17 00:00:00 2001 From: Dinopony Date: Tue, 27 Feb 2024 18:56:39 +0100 Subject: [PATCH] OoS: Various improvements --- worlds/tloz_oos/Client.py | 14 +- worlds/tloz_oos/Options.py | 6 +- worlds/tloz_oos/__init__.py | 4 +- worlds/tloz_oos/data/logic/DungeonsLogic.py | 2 +- worlds/tloz_oos/docs/oos_setup_en.md | 202 +++++++++----------- 5 files changed, 105 insertions(+), 123 deletions(-) diff --git a/worlds/tloz_oos/Client.py b/worlds/tloz_oos/Client.py index 8146b4814e23..44cd0c8ba3f6 100644 --- a/worlds/tloz_oos/Client.py +++ b/worlds/tloz_oos/Client.py @@ -63,9 +63,8 @@ async def set_auth(self, ctx: "BizHawkClientContext") -> None: pass async def game_watcher(self, ctx: "BizHawkClientContext") -> None: - # if ctx.slot_data is not None: - # if ctx.slot_data["goal"] == Goal.option_beat_onox: - # self.goal_flag = BEAT_ONOX_FLAG + if not ctx.server or not ctx.server.socket.open or ctx.server.socket.closed: + return try: # Handle giving the player items @@ -108,6 +107,7 @@ async def game_watcher(self, ctx: "BizHawkClientContext") -> None: ]) # Read location flags from RAM + local_checked_locations = set(ctx.locations_checked) for name, location in LOCATIONS_DATA.items(): if "local" in location and location["local"] is True: continue @@ -123,14 +123,12 @@ async def game_watcher(self, ctx: "BizHawkClientContext") -> None: bit_mask = location["bit_mask"] if "bit_mask" in location else 0x20 if flag_bytes[byte_offset] & bit_mask == bit_mask: location_id = self.location_name_to_id[name] - self.local_checked_locations.add(location_id) + local_checked_locations.add(location_id) break - for loc in ctx.locations_checked: - self.local_checked_locations.add(loc) - # Send locations - if self.local_checked_locations != ctx.locations_checked: + if self.local_checked_locations != local_checked_locations: + self.local_checked_locations = local_checked_locations await ctx.send_msgs([{ "cmd": "LocationChecks", "locations": list(self.local_checked_locations) diff --git a/worlds/tloz_oos/Options.py b/worlds/tloz_oos/Options.py index cf8c39e17549..edd0f149da6c 100644 --- a/worlds/tloz_oos/Options.py +++ b/worlds/tloz_oos/Options.py @@ -112,7 +112,7 @@ class OracleOfSeasonsOldMenShuffle(Choice): diplay_name = "Shuffle Old Men" option_vanilla = 0 - option_shuffle_values = 1 + option_shuffled_values = 1 # option_turn_into_locations = 2 default = 0 @@ -151,9 +151,9 @@ class OracleOfSeasonsFoolsOre(Choice): """ In the vanilla game, the Fool's Ore is the item "given" by the strange brothers in "exchange" for your feather. The way the vanilla game is done means you never get to use it, but it's by far the strongest weapon in the game - (dealing 4 times more damage than a L-2 sword!) + (dealing 4 times more damage than an L-2 sword!) - Vanilla: Fool's Ore appears in the item pool with its stats unchanged - - Balanced: Fool's Ore appears in the item pool but its stats are lowered to become comparable to a L-2 sword + - Balanced: Fool's Ore appears in the item pool but its stats are lowered to become comparable to an L-2 sword - Excluded: Fool's Ore doesn't appear in the item pool at all. Problem solved! """ display_name = "Fool's Ore" diff --git a/worlds/tloz_oos/__init__.py b/worlds/tloz_oos/__init__.py index 935134dec5ba..0f4eb353de62 100644 --- a/worlds/tloz_oos/__init__.py +++ b/worlds/tloz_oos/__init__.py @@ -140,7 +140,7 @@ def shuffle_portals(): self.random.choice(SEASONS), "left" ] - if self.options.shuffle_old_men == "shuffle_values": + if self.options.shuffle_old_men == "shuffled_values": shuffled_rupees = list(self.old_man_rupee_values.values()) self.random.shuffle(shuffled_rupees) self.old_man_rupee_values = dict(zip(self.old_man_rupee_values, shuffled_rupees)) @@ -362,6 +362,6 @@ def generate_output(self, output_directory: str): item_name = loc.item.name if loc.item.player == loc.player else "Archipelago Item" yamlObj["locations"][loc.name] = item_name - filename = f"{self.multiworld.get_out_file_name_base(self.player)}.apseasons" + filename = f"{self.multiworld.get_out_file_name_base(self.player)}.patcherdata" with open(os.path.join(output_directory, filename), 'w') as f: yaml.dump(yamlObj, f) diff --git a/worlds/tloz_oos/data/logic/DungeonsLogic.py b/worlds/tloz_oos/data/logic/DungeonsLogic.py index 8abf08cd3f9a..e7879a6bdeac 100644 --- a/worlds/tloz_oos/data/logic/DungeonsLogic.py +++ b/worlds/tloz_oos/data/logic/DungeonsLogic.py @@ -746,7 +746,7 @@ def make_d8_logic(player: int): ["d8 spinner", "d8 magnet ball room", False, None], ["d8 spinner", "d8 armos chest", False, lambda state: oos_has_magnet_gloves(state, player)], ["d8 armos chest", "d8 spinner chest", False, None], - ["d8 spike room", "frypolar entrance", False, lambda state: oos_has_magnet_gloves(state, player)], + ["d8 spinner chest", "frypolar entrance", False, lambda state: oos_has_magnet_gloves(state, player)], ["frypolar entrance", "frypolar owl", False, lambda state: oos_can_use_mystery_seeds(state, player)], ["frypolar entrance", "d8 darknut chest", False, lambda state: all([ any([ diff --git a/worlds/tloz_oos/docs/oos_setup_en.md b/worlds/tloz_oos/docs/oos_setup_en.md index 9878bc2e610c..901d58567168 100644 --- a/worlds/tloz_oos/docs/oos_setup_en.md +++ b/worlds/tloz_oos/docs/oos_setup_en.md @@ -2,118 +2,102 @@ ## Required Software -- [Landstalker Archipelago Client](https://github.com/Dinopony/randstalker-archipelago/releases) (only available on Windows) -- A compatible emulator to run the game - - [RetroArch](https://retroarch.com?page=platforms) with the Genesis Plus GX core - - [Bizhawk 2.9.1 (x64)](https://tasvideos.org/BizHawk/ReleaseHistory) with the Genesis Plus GX core -- Your legally obtained Landstalker US ROM file (which can be acquired on [Steam](https://store.steampowered.com/app/71118/Landstalker_The_Treasures_of_King_Nole/)) +- [Oracle of Seasons .apworld](https://github.com/Dinopony/Archipelago/releases/latest) +- [Oracles Archipelago Patcher](https://github.com/Dinopony/oracles-archipelago-patcher/releases/latest) +- [Bizhawk 2.9.1 (x64)](https://tasvideos.org/BizHawk/ReleaseHistory) +- Your legally obtained Oracle of Seasons US ROM file ## Installation Instructions -- Unzip the Landstalker Archipelago Client archive into its own folder -- Put your Landstalker ROM (`LandStalker_USA.SGD` on the Steam release) inside this folder -- To launch the client, launch `randstalker_archipelago.exe` inside that folder - -Be aware that you might get antivirus warnings about the client program because one of its main features is to spy -on another process's memory (your emulator). This is something antiviruses obviously dislike, and sometimes mistake -for malicious software. - -If you're not trusting the program, you can check its [source code](https://github.com/Dinopony/randstalker-archipelago/) -or test it on a service like Virustotal. +1. Download the **Oracle of Seasons .apworld file** and put it inside the "lib/worlds/" subdirectory of your Archipelago install directory +2. Generate a seed using your .yaml settings file (see template below) +3. When generating, the server built for you a .patcherdata file that can be fed to the **Oracles Archipelago Patcher** software, download it +4. Download the **Oracles Archipelago Patcher** software and unzip it in its own directory +5. Put your **Oracle of Seasons US ROM** inside this folder (name doesn't matter as long as it has the .gbc file extension) +6. Right-click on that file, select "Open With..." and point to the **oracles-archipelago-patcher.exe** inside the same directory where you previously put the vanilla ROM +7. Get your own .patcherdata file that was generated by Archipelago Server while generating +8. If everything went fine, the patched ROM should have appeared next to the .patcherdata file +9. Open the patched ROM inside Bizhawk +10. Inside Bizhawk, go into "Tools > Lua Console", then "Script > Open Script" and pick the "connector_bizhawk_generic.lua" file inside the "dta/lua/" subfolder of your Archipelago install +11. Launch Bizhawk Generic Client, it should automatically connect to the emulator +12. Connect the Client to the AP Server of your choice, and you can start playing! ## Create a Config (.yaml) File -### What is a config file and why do I need one? - -See the guide on setting up a basic YAML at the Archipelago setup -guide: [Basic Multiworld Setup Guide](/tutorial/Archipelago/setup/en) - -### Where do I get a config file? - -The [Player Settings Page](../player-settings) on the website allows you to easily configure your personal settings -and export a config file from them. - -## How-to-play - -### Connecting to the Archipelago Server - -Once the game has been created, you need to connect to the server using the Landstalker Archipelago Client. - -To do so, run `randstalker_archipelago.exe` inside the folder you created while installing the software. - -A window will open with a few settings to enter: -- **Host**: Put the server address and port in this field (e.g. `archipelago.gg:12345`) -- **Slot name**: Put the player name you specified in your YAML config file in this field. -- **Password**: If the server has a password, put it there. - -![Landstalker Archipelago Client user interface](/static/generated/docs/Landstalker%20-%20The%20Treasures%20of%20King%20Nole/ls_guide_ap.png) - -Once all those fields were filled appropriately, click on the `Connect to Archipelago` button below to try connecting to -the Archipelago server. - -If this didn't work, double-check your credentials. An error message should be displayed on the console log to the -right that might help you find the cause of the issue. - -### ROM Generation - -When you connected to the Archipelago server, the client fetched all the required data from the server to be able to -build a randomized ROM. - -You should see a window with settings to fill: -- **Input ROM file**: This is the path to your original ROM file for the game. If you are using the Steam release ROM - and placed it inside the client's folder as mentioned above, you don't need to change anything. -- **Output ROM directory**: This is where the randomized ROMs will be put. No need to change this unless you want them - to be created in a very specific folder. - -![Landstalker Archipelago Client user interface](/static/generated/docs/Landstalker%20-%20The%20Treasures%20of%20King%20Nole/ls_guide_rom.png) - -There also a few cosmetic options you can fill before clicking the `Build ROM` button which should create your -randomized seed if everything went right. - -If it didn't, double-check your `Input ROM file` and `Output ROM path`, then retry building the ROM by clicking -the same button again. - -### Connecting to the emulator - -Now that you're connected to the Archipelago server and have a randomized ROM, all we need is to get the client -connected to the emulator. This way, the client will be able to see what's happening while you play and give you in-game -the items you have received from other players. - -You should see the following window: - -![Landstalker Archipelago Client user interface](/static/generated/docs/Landstalker%20-%20The%20Treasures%20of%20King%20Nole/ls_guide_emu.png) - -As written, you have to open the newly generated ROM inside either Retroarch or Bizhawk using the Genesis Plus GX core. -Be careful to select that core, because any other core (e.g. BlastEm) won't work. - -The easiest way to do so is to: -- open the emu of your choice -- if you're using Retroarch and it's your first time, download the Genesis Plus GX core through Retroarch user interface -- click the `Show ROM file in explorer` button -- drag-and-drop the shown ROM file on the emulator window -- press Start to reach file select screen (to ensure game RAM is properly set-up) - -Then, you can click on the `Connect to emulator` button below and it should work. - -If this didn't work, try the following: -- ensure you have loaded your ROM and reached the save select screen -- ensure you are using Genesis Plus GX and not another core (e.g. BlastEm will not work) -- try launching the client in Administrator Mode (right-click on `randstalker_archipelago.exe`, then - `Run as administrator`) -- if all else fails, try using one of those specific emulator versions: - - RetroArch 1.9.0 and Genesis Plus GX 1.7.4 - - Bizhawk 2.9.1 (x64) - -### Play the game - -If all indicators are green and show "Connected," you're good to go! Play the game and enjoy the wonders of isometric -perspective. - -The client is packaged with both an **automatic item tracker** and an **automatic map tracker** for your comfort. - -If you don't know all checks in the game, don't be afraid: you can click the `Where is it?` button that will show -you a screenshot of where the location actually is. - -![Landstalker Archipelago Client user interface](/static/generated/docs/Landstalker%20-%20The%20Treasures%20of%20King%20Nole/ls_guide_client.png) - -Have fun! \ No newline at end of file +Edit the following template for your settings: +```yaml +"The Legend of Zelda: Oracle of Seasons": + progression_balancing: 50 + accessibility: items + + # Determine the amount of essences required to get the Maku Seed and be able to confront Onox + # (number between 0 and 8) + required_essences: 8 + + # The world of Holodrum is split in regions, each one having its own default season being forced when entering it. + # This options gives several ways of manipulating those default seasons. + # - vanilla: default seasons for each region are the ones from the original game + # - randomized: each region has its own random default season picked at generation time + # - singularity: only one season is randomly picked and put in every region in the game + default_seasons: randomized + + # Determines which animal companion you can summon using the Flute, as well as the layout of the Natzu region. + # - ricky: the kangaroo with boxing skills + # - dimitri: the swimming dinosaur who can eat anything + # - moosh: the flying blue bear with a passion for Spring Bananas + animal_companion: random + + # The difficulty of the logic used to generate the seed. + # - casual: expects you to know what you would know when playing the game for the first time + # - medium: expects you to know well the alternatives on how to do basic things, but won't expect any trick + # - hard: expects you to have all knowledge and to be able to perform difficult tricks + logic_difficulty: casual + + # - vanilla: each dungeon entrance leads to its intended dungeon + # - shuffle: each dungeon entrance leads to a random dungeon picked at generation time + shuffle_dungeons: shuffle + + # - vanilla: pairs of portals are the same as in the original game + # - shuffle: each portal in Holodrum is connected to a random portal in Subrosia picked at generation time + shuffle_portals: shuffle + + # This option defines how the "secret sequence" (both directions and seasons) leading to the Noble Sword pedestal + # is handled by the randomizer. + # - vanilla: the sequence is the same as in the original game + # - randomized: the sequence is randomized, and you need to use the Phonograph on the Deku Scrub to learn the sequence + lost_woods_item_sequence: randomized + + # Determine how the Old Men that can be found under specific bushes are handled by the randomizer + # - vanilla: Each Old Man gives/takes the amount of rupees it usually does in the base game + # - shuffled_values: The rupee values given/taken are shuffled among Old Men + shuffle_old_men: vanilla + + # Defines the quality of the rings that will be shuffled in your seed: + # - any: any ring can potentially be shuffled (including literally useless ones) + # - only_useful: only useful rings will be shuffled + ring_quality: only_useful + + # In the vanilla game, the Fool's Ore is the item "given" by the strange brothers in "exchange" for your feather. + # The way the vanilla game is done means you never get to use it, but it's by far the strongest weapon in the game + # (dealing 4 times more damage than an L-2 sword!) + # - vanilla: Fool's Ore appears in the item pool with its stats unchanged + # - balanced: Fool's Ore appears in the item pool but its stats are lowered to become comparable to an L-2 sword + # - excluded: Fool's Ore doesn't appear in the item pool at all. Problem solved! + fools_ore: balanced + + # When enabled, you can warp to start by holding Start while exiting map screen. + # This makes backtracking a bit more bearable in seeds where Gale Seeds take time to obtain and prevent + # most softlock situations from happening. + # Enabling this is HIGHLY encouraged in most cases. + warp_to_start: on + + # - default: play the beeping sound at the usual frequency when low on health + # - half: play the beeping sound two times less when low on health + # - quarter: play the beeping sound four times less when low on health + # - disabled: never play the beeping sound when low on health + heart_beep_interval: default + +description: 'YAML Template for Oracle of Seasons' +game: "The Legend of Zelda: Oracle of Seasons" +name: Player +``` \ No newline at end of file