Python script that randomizes various things in DK64. See the readme for current options that are available to be randomized as well as other features.
This pull request to randomizer/Fill.py and randomizer/Logic.py includes several improvements and bug fixes to enhance the logic and performance of the randomizer. The changes focus on optimizing location accessibility checks, improving item placement validation, and adding new data structures for better management of game elements.
Improvements to location accessibility:
randomizer/Fill.py: Refactored the should_skip_location function to use region instead of region.id for hint access checks.
randomizer/Fill.py: Optimized the GetAccessibleLocations function by introducing early exits for regions already accessible and quick skips for time of day and water/lava restrictions. [1][2]
Enhancements to item placement validation:
randomizer/Fill.py: Improved the AssumedFill function by using set operations for valid location checks and ensuring unique location usage.
Codebase simplification and performance:
randomizer/Fill.py: Replaced multiple instances of location.id with location_id for consistency and efficiency.
randomizer/Fill.py: Enhanced the efficiency of the shop location purchase logic by using discard instead of remove for the accessible set.
New data structures:
randomizer/Logic.py: Added cache, blueprint_list, and hint_list to the Logic class to improve performance and manage game elements more effectively. [1][2]
This pull request to
randomizer/Fill.py
andrandomizer/Logic.py
includes several improvements and bug fixes to enhance the logic and performance of the randomizer. The changes focus on optimizing location accessibility checks, improving item placement validation, and adding new data structures for better management of game elements.Improvements to location accessibility:
randomizer/Fill.py
: Refactored theshould_skip_location
function to useregion
instead ofregion.id
for hint access checks.randomizer/Fill.py
: Optimized theGetAccessibleLocations
function by introducing early exits for regions already accessible and quick skips for time of day and water/lava restrictions. [1] [2]Enhancements to item placement validation:
randomizer/Fill.py
: Improved theAssumedFill
function by using set operations for valid location checks and ensuring unique location usage.Codebase simplification and performance:
randomizer/Fill.py
: Replaced multiple instances oflocation.id
withlocation_id
for consistency and efficiency.randomizer/Fill.py
: Enhanced the efficiency of the shop location purchase logic by usingdiscard
instead ofremove
for theaccessible
set.New data structures:
randomizer/Logic.py
: Addedcache
,blueprint_list
, andhint_list
to theLogic
class to improve performance and manage game elements more effectively. [1] [2]