From 046463113ca5b9122c566e4c8b308ce5e7f9b157 Mon Sep 17 00:00:00 2001 From: spinerak Date: Thu, 6 Jun 2024 02:54:35 +0200 Subject: [PATCH] Tweaked generation parameters and methods --- worlds/yachtdice/Options.py | 8 ++++---- worlds/yachtdice/__init__.py | 39 ++++++++++++++++++++---------------- 2 files changed, 26 insertions(+), 21 deletions(-) diff --git a/worlds/yachtdice/Options.py b/worlds/yachtdice/Options.py index 32eec57911..87159ae56d 100644 --- a/worlds/yachtdice/Options.py +++ b/worlds/yachtdice/Options.py @@ -45,7 +45,6 @@ class minimalNumberOfDiceAndRolls(Choice): You start with one dice and one roll. """ display_name = "Minimal number of dice and rolls in pool" - option_2_dice_and_2_rolls = 1 option_5_dice_and_3_rolls = 2 option_5_dice_and_5_rolls = 3 option_6_dice_and_4_rolls = 4 @@ -170,9 +169,10 @@ class pointsSize(Choice): class minimizeExtraItems(Choice): """ - Besides necessary items, Yacht Dice has extra items in the item pool. - It is possible however to decrease the number of extra items - by putting categories Fives, Sixes and Pair early into the playthrough. Would you like to do this? + Besides necessary items, Yacht Dice has extra useful/filler items in the item pool. + It is possible however to decrease the number of extra items in multiplayer games. + Do you want to reduce the number of extra items? + (this option only does something in multiplayer games) """ display_name = "Minimize extra items" option_no_dont = 1 diff --git a/worlds/yachtdice/__init__.py b/worlds/yachtdice/__init__.py index adb3d6ee9c..0cb7d7fe52 100644 --- a/worlds/yachtdice/__init__.py +++ b/worlds/yachtdice/__init__.py @@ -51,7 +51,7 @@ class YachtDiceWorld(World): "race": self.multiworld.is_race, } - def generate_early(self): + def generate_early(self): self.itempool = [] self.precollected = [] @@ -136,7 +136,7 @@ class YachtDiceWorld(World): #Yacht Dice needs extra filler items so it doesn't get stuck in generation. if self.options.minimize_extra_items.value == 2: - extraPercentage = max(0.1, 0.5 - self.multiworld.players / 10) + extraPercentage = max(0.1, 0.8 - self.multiworld.players / 10) else: extraPercentage = 0.7 @@ -164,7 +164,8 @@ class YachtDiceWorld(World): weights[0] = weights[0] / 5 * frags_per_dice weights[1] = weights[1] / 5 * frags_per_roll - extraPointsAdded = 0 + extra_points_added = 0 + multipliers_added = 0 while dice_simulation(self.itempool + self.precollected, "state_is_a_list", self.options) < 1000: all_items = self.itempool + self.precollected @@ -175,14 +176,20 @@ class YachtDiceWorld(World): if roll_fragments_in_pool + 1 >= 6 * frags_per_roll: weights[1] = 0 # cannot have 6 rolls - if extraPointsAdded > 300: - weights[5] = 0 + if multipliers_added > 50: + weights[2] = 0 + weights[3] = 0 + + if extra_points_added > 300: + weights[5] = 0 #if all weights are zero, allow to add fixed score multiplier, double category, points. if sum(weights) == 0: - weights[2] = 1 + if multipliers_added <= 50: + weights[2] = 1 weights[4] = 1 - weights[5] = 1 + if extra_points_added <= 300: + weights[5] = 1 which_item_to_add = self.multiworld.random.choices([0,1,2,3,4,5], weights = weights)[0] @@ -201,9 +208,11 @@ class YachtDiceWorld(World): elif which_item_to_add == 2: self.itempool += ["Fixed Score Multiplier"] weights[2] /= 1.05 + multipliers_added += 1 elif which_item_to_add == 3: self.itempool += ["Step Score Multiplier"] weights[3] /= 1.1 + multipliers_added += 1 elif which_item_to_add == 4: #increase chances of "free-score categories" cat_weights = [2, 2, 1, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1] @@ -223,25 +232,27 @@ class YachtDiceWorld(World): c = self.multiworld.random.choices([0,1,2], weights = probs)[0] if c == 0: self.itempool += ["1 Point"] - extraPointsAdded += 1 + extra_points_added += 1 weights[5] /= 1.01 elif c==1: self.itempool += ["10 Points"] - extraPointsAdded += 10 + extra_points_added += 10 weights[5] /= 1.1 elif c==2: self.itempool += ["100 Points"] - extraPointsAdded += 100 + extra_points_added += 100 weights[5] /= 2 else: raise Exception("Unknown point value (Yacht Dice)") else: raise Exception("Invalid index when adding new items in Yacht Dice") - + #count the number of locations in the game. extra_plando_items is set in generate_early #and counts number of plando items *not* from pool. already_items = len(self.itempool) + self.extra_plando_items + 1 #+1 because of Victory item + + extra_locations_needed += (already_items - 70) // 20 self.number_of_locations = already_items + extra_locations_needed # From here, we will count the number of items in the self.itempool, and add items to the pool, @@ -356,12 +367,6 @@ class YachtDiceWorld(World): #in the pre_fill, make sure one dice and one roll is early, so that you will have 2 dice and 2 rolls soon self.multiworld.early_items[self.player]["Dice"] = 1 self.multiworld.early_items[self.player]["Roll"] = 1 - - #put more items early since we want less extra items. - if self.options.minimize_extra_items.value == 2: - self.multiworld.early_items[self.player]["Category Pair"] = 1 - self.multiworld.early_items[self.player]["Category Fives"] = 1 - self.multiworld.early_items[self.player]["Category Sixes"] = 1 def fill_slot_data(self): #make slot data, which consists of yachtdice_data, options, and some other variables.