Archipelago/worlds
Mysteryem 7eda4c47f8
TLOZ: Fix non-deterministic item pool generation (#3779)
* TLOZ: Fix non-deterministic item pool generation

The way the item pool was constructed involved iterating unions of sets.
Sets are unordered, so the order of iteration of these combined sets
would be non-deterministic, resulting in the items in the item pool
being generated in a different order with the same seed.

Rather than creating unions of sets at all, the original code has been
replaced with using Counter objects. As a dict subclass, Counter
maintains insertion order, and its update() method makes it simple to
combine the separate item dictionaries into a single dictionary with the
total count of each item across each of the separate item dictionaries.

Fixes #3664 - After investigating more deeply, the only differences I
could find between generations of the same seed was the order of items
created by TLOZ, so this patch appears to fix the non-deterministic
generation issue. I did manage to reproduce the non-deterministic
behaviour with just TLOZ in the end, but it was very rare. I'm not
entirely sure why generating with SMZ3 specifically would cause the
non-deterministic behaviour in TLOZ to be frequently present, whereas
generating with other games or multiple TLOZ yamls would not.

* Change import order

---------

Co-authored-by: NewSoupVi <57900059+NewSoupVi@users.noreply.github.com>
2024-08-16 20:57:04 +02:00
..
_bizhawk
_sc2common
adventure
ahit
alttp Core: recontextualize `CollectionState.collect` (#3723) 2024-08-13 22:28:05 +02:00
apsudoku
aquaria Aquaria: Logic bug fixes (#3679) 2024-08-08 00:19:52 +02:00
archipidle
blasphemous
bomb_rush_cyberfunk
bumpstik
celeste64
checksfinder ChecksFinder: Refactor/Cleaning (#3725) 2024-08-06 16:39:56 +02:00
clique Clique: Update to new options API (#3759) 2024-08-11 14:47:17 +02:00
cv64
dark_souls_3 DS3: Version 3.0.0 (#3128) 2024-08-09 12:14:26 +02:00
dkc3
dlcquest
doom_1993 DOOM, DOOM II: Update steam URLs (#3746) 2024-08-09 17:04:59 +02:00
doom_ii DOOM, DOOM II: Update steam URLs (#3746) 2024-08-09 17:04:59 +02:00
factorio
ff1
ffmq
generic
heretic
hk HK: fix iterating all worlds instead of only HK worlds in stage_pre_fill (#3750) 2024-08-09 17:02:41 +02:00
hylics2
kdl3
kh2 KH2: Update the docs to support steam in the setup guide (#3711) 2024-08-07 23:56:22 +02:00
ladx
landstalker
lingo Lingo: Fixed Initiated-side Eight Door not opening (#3793) 2024-08-16 20:52:16 +02:00
lufia2ac
meritous
messenger
minecraft
mlss
mmbn3
musedash
noita
oot Core: recontextualize `CollectionState.collect` (#3723) 2024-08-13 22:28:05 +02:00
osrs OSRS: Implement New Game (#1976) 2024-08-06 23:13:11 +02:00
overcooked2
pokemon_emerald
pokemon_rb
raft
rogue_legacy
ror2 RoR2: Remove recursion from explore mode access rules (#3681) 2024-08-07 23:57:07 +02:00
sa2b
sc2
shivers
shorthike
sm
sm64ex
smw
smz3
soe SoE: fix determinism (#3745) 2024-08-10 13:08:24 +02:00
spire
stardew_valley Stardew Valley: Add Quality Bobber in the logic rules for fish quality gold and above #3792 2024-08-14 17:07:06 +02:00
subnautica
terraria
timespinner Timespinner: Fix eels check logic #3777 2024-08-12 00:24:09 +02:00
tloz TLOZ: Fix non-deterministic item pool generation (#3779) 2024-08-16 20:57:04 +02:00
tunic TUNIC: Give the fox a gun (in logic) (very small PR) (#3790) 2024-08-16 20:53:54 +02:00
undertale Undertale: Fix slot_data and options.as_dict() (#3774) 2024-08-12 01:53:40 +02:00
v6
wargroove
witness
yoshisisland
yugioh06
zillion
zork_grand_inquisitor
AutoSNIClient.py
AutoWorld.py
Files.py
LauncherComponents.py
__init__.py Core: fix invalid __package__ of zipped worlds (#3686) 2024-08-10 13:49:32 +02:00