Skip to content

Commit

Permalink
MASSIVE randomizer version update!
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkirby committed Feb 25, 2023
1 parent 2f671bc commit 1aa903c
Show file tree
Hide file tree
Showing 6 changed files with 94 additions and 17 deletions.
2 changes: 2 additions & 0 deletions RandomSettingsGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,8 @@ def main():
if not os.path.isdir('failed_settings'):
os.mkdir('failed_settings')
os.rename(os.path.join('data', plando_filename), os.path.join('failed_settings', plando_filename))
with open(os.path.join('failed_settings', plando_filename+'_errlog'), 'w+') as failed_err_msg:
failed_err_msg.write(completed_process.stderr)
if i == args["plando_retries"]-1 and completed_process.returncode != 0:
raise tools.RandomizerError(completed_process.stderr)

Expand Down
14 changes: 14 additions & 0 deletions conditionals.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,3 +229,17 @@ def invert_dungeons_mq_count(random_settings, weight_dict, **kwargs):
new_mq_dungeons_count = 12 - current_mq_dungeons_count

random_settings['mq_dungeons_count'] = new_mq_dungeons_count


def replicate_old_child_trade(random_settings, extra_starting_items, **kwargs):
""" Emulate old behavior for sstarting child trade. This should be removed
once season 6 begins and is only here to keep season 5 support.
"""
ctrade = random.choices(["vanilla", "shuffle", "scz"], weights=[1,1,2])[0]
if ctrade == "vanilla":
random_settings["shuffle_child_trade"] = []
elif ctrade == "shuffle":
random_settings["shuffle_child_trade"] = ["Weird Egg"]
else:
random_settings["shuffle_child_trade"] = []
extra_starting_items['starting_items'] += ["zeldas_letter"]
9 changes: 8 additions & 1 deletion roll_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import conditionals as conds
from rslversion import __version__
sys.path.append("randomizer")
from randomizer.ItemPool import trade_items, child_trade_items
from randomizer.SettingsList import get_settings_from_tab, get_settings_from_section, get_setting_info
from randomizer.StartingItems import inventory, songs, equipment

Expand Down Expand Up @@ -58,7 +59,13 @@ def geometric_weights(N, startat=0, rtype="list"):

def draw_starting_item_pool(random_settings, start_with):
""" Select starting items, songs, and equipment. """
random_settings["starting_items"] = draw_choices_from_pool(inventory)
# random_settings["starting_items"] = draw_choices_from_pool(inventory)
random_settings["starting_items"] = draw_choices_from_pool({
name: info
for name, info in inventory.items()
if (info.itemname not in trade_items or info.itemname in random_settings["adult_trade_start"])
and (info.itemname not in child_trade_items or info.itemname in random_settings["shuffle_child_trade"] or info.itemname == 'Zeldas Letter')
})
random_settings["starting_songs"] = draw_choices_from_pool(songs)
random_settings["starting_equipment"] = draw_choices_from_pool(equipment)

Expand Down
4 changes: 3 additions & 1 deletion rsl_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def find_rom_file():
def check_for_setting_changes(weights, randomizer_settings):
""" Function to check for new settings and options when the randomizer is updated. """
ignore_list = ["tricks_list_msg", "bingosync_url", "dungeon_shortcuts", "misc_hints", "mix_entrance_pools", "mq_dungeons_specific",
"key_rings", "empty_dungeons_specific", "empty_dungeons_count", "adult_trade_start", "spawn_positions"]
"key_rings", "empty_dungeons_specific", "empty_dungeons_count", "adult_trade_start", "spawn_positions", "hint_dist"]

# Find new or changed settings by name
old_settings = list(set(weights.keys()) - set(randomizer_settings.keys()))
Expand All @@ -97,6 +97,8 @@ def check_for_setting_changes(weights, randomizer_settings):

# Find new or changed options
for setting in weights.keys():
if setting in ignore_list:
continue
# Randomizer has appropriate types for each variable but we store options as strings
randomizer_settings_strings = set(map(lambda x: x.lower(), map(str, list(randomizer_settings[setting].keys()))))
old_options = list(set(weights[setting].keys()) - randomizer_settings_strings)
Expand Down
6 changes: 3 additions & 3 deletions rslversion.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "2.3.9"
__version__ = "2.4.1"

randomizer_version = '6.2.238 R-1'
randomizer_commit = '0843b2a100de9a9669aabc35f684913fccfc4d10'
randomizer_version = '7.1.60 R-1'
randomizer_commit = 'aaaa7b9d91a5a13b468528748352d69431b2a1d4'
76 changes: 64 additions & 12 deletions weights/rsl_season5.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@
"adjust_chaos_hint_distro": [true],
"exclude_mapcompass_info_remove": [true],
"ohko_starts_with_nayrus": [true],
"invert_dungeons_mq_count": [false, 0]
"invert_dungeons_mq_count": [false, 0],
"replicate_old_child_trade": [true]
},
"tricks": [
"logic_fewer_tunic_requirements",
Expand Down Expand Up @@ -124,6 +125,23 @@
"child": 100,
"adult": 100
}
},
"shuffle_child_trade": {
"global_enable_percentage": 0,
"geometric": false,
"opt_percentage": {
"weird egg": 0,
"chicken": 0,
"zeldas letter": 0,
"keaton mask": 0,
"skull mask": 0,
"spooky mask": 0,
"bunny hood": 0,
"goron mask": 0,
"zora mask": 0,
"gerudo mask": 0,
"mask of truth": 0
}
}
},
"weights": {
Expand All @@ -132,6 +150,49 @@
"glitched": 0,
"none": 0
},
"shuffle_freestanding_items": {
"off": 1,
"all": 0,
"overworld": 0,
"dungeons": 0
},
"shuffle_pots": {
"off": 1,
"all": 0,
"overworld": 0,
"dungeons": 0
},
"shuffle_crates": {
"off": 1,
"all": 0,
"overworld": 0,
"dungeons": 0
},
"shuffle_beehives": {
"true": 0,
"false": 1
},
"correct_potcrate_appearances": {
"off": 0,
"textures_content": 0,
"textures_unchecked": 1
},
"shuffle_gerudo_valley_river_exit": {
"true": 0,
"false": 1
},
"keyring_give_bk": {
"true": 0,
"false": 1
},
"free_bombchu_drops": {
"true": 1,
"false": 0
},
"adult_trade_shuffle": {
"true": 0,
"false": 1
},
"open_forest": {
"open": 1,
"closed_deku": 1,
Expand Down Expand Up @@ -194,10 +255,6 @@
"true": 3,
"false": 17
},
"bombchus_in_logic": {
"true": 1,
"false": 1
},
"one_item_per_dungeon": {
"true": 0,
"false": 1
Expand Down Expand Up @@ -332,11 +389,6 @@
"true": 1,
"false": 1
},
"shuffle_child_trade": {
"vanilla": 1,
"shuffle": 1,
"skip_child_zelda": 2
},
"shuffle_gerudo_card": {
"true": 1,
"false": 1
Expand All @@ -345,7 +397,7 @@
"true": 1,
"false": 1
},
"shuffle_medigoron_carpet_salesman": {
"shuffle_expensive_merchants": {
"true": 2,
"false": 3
},
Expand Down Expand Up @@ -605,7 +657,7 @@
"normal": 10,
"double": 4,
"quadruple": 2,
"ohko": 1
"ohko": 100000
},
"deadly_bonks": {
"none": 19,
Expand Down

0 comments on commit 1aa903c

Please sign in to comment.