From 9af7052e5f252cfe8ec28a3c21ec7ab5f285e4b7 Mon Sep 17 00:00:00 2001 From: AmazingAmpharos Date: Sat, 11 Nov 2017 15:28:34 -0600 Subject: [PATCH] Add balanced algorithm -From KevinCathcart, adds a "balanced" algorithm that, in theory, fixes the dungeon bias of the v26/v27 algorithm while maintaining the desirable amount of randomness it provides. --- EntranceRandomizer.py | 9 +++++---- Gui.py | 4 ++-- README.md | 14 +++++++++----- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/EntranceRandomizer.py b/EntranceRandomizer.py index 8023e2ad..cfafd40a 100644 --- a/EntranceRandomizer.py +++ b/EntranceRandomizer.py @@ -90,14 +90,15 @@ if __name__ == '__main__': category, be randomly progressive or not. Link will die in one hit. ''') - parser.add_argument('--algorithm', default='vt26', const='vt26', nargs='?', choices=['freshness', 'flood', 'vt21', 'vt22', 'vt25', 'vt26'], + parser.add_argument('--algorithm', default='balanced', const='balanced', nargs='?', choices=['freshness', 'flood', 'vt21', 'vt22', 'vt25', 'vt26', 'balanced'], help='''\ Select item filling algorithm. (default: %(default)s + balanced: vt26 derivitive that aims to strike a balance between + the overworld heavy vt25 and the dungeon heavy vt26 + algorithm. vt26: Shuffle items and place them in a random location that it is not impossible to be in. This includes - dungeon keys and items. Includes slight deliberate - bias against having too many desireable items in - Ganon's Tower. + dungeon keys and items. vt25: Shuffle items and place them in a random location that it is not impossible to be in. vt21: Unbiased in its selection, but has tendency to put diff --git a/Gui.py b/Gui.py index 7486e06c..cb646138 100644 --- a/Gui.py +++ b/Gui.py @@ -128,8 +128,8 @@ def guiMain(args=None): algorithmFrame = Frame(drowDownFrame) algorithmVar = StringVar() - algorithmVar.set('vt26') - algorithmOptionMenu = OptionMenu(algorithmFrame, algorithmVar, 'freshness', 'flood', 'vt21', 'vt22', 'vt25', 'vt26') + algorithmVar.set('balanced') + algorithmOptionMenu = OptionMenu(algorithmFrame, algorithmVar, 'freshness', 'flood', 'vt21', 'vt22', 'vt25', 'vt26', 'balanced') algorithmOptionMenu.pack(side=RIGHT) algorithmLabel = Label(algorithmFrame, text='Item distribution algorithm') algorithmLabel.pack(side=LEFT) diff --git a/README.md b/README.md index 7e837ee1..46b490de 100644 --- a/README.md +++ b/README.md @@ -108,15 +108,19 @@ This is only noticeably different if the --shuffleganon option is enabled. Select game difficulty. Affects available itempool. (default: normal) ``` ---algorithm [{freshness,flood,vt21,vt22,vt25}] +--algorithm [{freshness,flood,vt21,vt22,vt25,vt26,balanced}] ``` Select item filling algorithm. +### Balanced (Default) +This is a variation of vt26 that aims to strike a balance between the overworld heavy vt25 and the dungeon heavy vt26 algorithm. +It does this by reshuffling the remaining locations after placing dungeon items. + ### VT26 (Default) -Items and locations are shuffled like in VT25, and dungeon items are now placed using the same algorithm. It includes -a slight deliberate bias against having too many desireable items in Ganon's Tower to help counterbalance the sheer number -of chests in that single location. +Items and locations are shuffled like in VT25, and dungeon items are now placed using the same algorithm. When gannon is not +shuffled it includes a slight deliberate bias against having too many desireable items in Ganon's Tower to help counterbalance +the sheer number of chests in that single location. ### VT25 Items and locations are shuffled and placed from the top of the lists. The only thing preventing an item from being placed into a spot @@ -231,7 +235,7 @@ Use to select a different sprite sheet to use for Link. Path to a binary file of --beatableonly ``` -If set, will only ensure the goal can be achieved, but not necessarily that all locations are reachable. Currently only affects VT25 algorithm. +If set, will only ensure the goal can be achieved, but not necessarily that all locations are reachable. Currently only affects VT25, VT26 and balanced algorithms. ``` --shuffleganon