Speed up Progression Balancing, mostly by using generators and pre-sorts where the opportunity exists

In some cases multi-thousand element lists were created in-memory with near identical contents, per player, then discarded and reassembled.
Was testing against a case with 3 GB of additional memory use (50 players) which appeared to get stuck, but really was just very slow. This example case is fixed with these changes.
Additionally, progression balancing is now run after ShopSlotFill, so it is now "aware" of the changed progression shops can produce.
As well, special handling for keys was removed, as not all games will have the notion of keys.
This commit is contained in:
Fabian Dill
2021-02-05 08:07:12 +01:00
parent 239b365264
commit 96d544ac84
4 changed files with 34 additions and 32 deletions

View File

@@ -216,13 +216,13 @@ def main(args, seed=None):
elif args.algorithm == 'balanced':
distribute_items_restrictive(world, True)
if world.players > 1:
balance_multiworld_progression(world)
logger.info("Filling Shop Slots")
ShopSlotFill(world)
if world.players > 1:
balance_multiworld_progression(world)
logger.info('Patching ROM.')