Archipelago/worlds/tloz
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
..
docs TLOZ: Fix markdown issue with game info page (#2985) 2024-03-28 08:54:56 -05:00
ItemPool.py TLOZ: Fix non-deterministic item pool generation (#3779) 2024-08-16 20:57:04 +02:00
Items.py TLOZ: Fix rings classification, so they are actually considered for logic (#3253) 2024-05-02 16:49:39 -05:00
Locations.py [TLOZ]: Fix determinism / Add Location Name Groups / Remove Level 9 Junk Fill (#3670) 2024-07-24 14:00:16 +02:00
Options.py TLOZ: update to new options API (#2714) 2024-01-15 04:47:32 +01:00
Rom.py [TLOZ] MD5 validation update (#2080) 2023-08-07 09:31:43 +02:00
Rules.py TLOZ: Fix rings classification, so they are actually considered for logic (#3253) 2024-05-02 16:49:39 -05:00
__init__.py TLOZ: world: multiworld (#3752) 2024-08-09 22:38:42 +02:00
requirements.txt
z1_base_patch.bsdiff4