Core: don't start threads for 'pass'
Core: print output progress every 10 files (OoT output may take a while, so let's give some user feedback on progress) Subnautica: remove empty output method
This commit is contained in:
parent
1b27fc495f
commit
2e2ca1665b
8
Main.py
8
Main.py
|
@ -182,7 +182,7 @@ def main(args, seed=None):
|
||||||
if world.players > 1:
|
if world.players > 1:
|
||||||
balance_multiworld_progression(world)
|
balance_multiworld_progression(world)
|
||||||
|
|
||||||
logger.info('Generating output files.')
|
logger.info(f'Beginning output...')
|
||||||
outfilebase = 'AP_' + world.seed_name
|
outfilebase = 'AP_' + world.seed_name
|
||||||
|
|
||||||
pool = concurrent.futures.ThreadPoolExecutor()
|
pool = concurrent.futures.ThreadPoolExecutor()
|
||||||
|
@ -194,6 +194,8 @@ def main(args, seed=None):
|
||||||
output_file_futures = []
|
output_file_futures = []
|
||||||
|
|
||||||
for player in world.player_ids:
|
for player in world.player_ids:
|
||||||
|
# skip starting a thread for methods that say "pass".
|
||||||
|
if AutoWorld.World.generate_output.__code__ is not world.worlds[player].generate_output.__code__:
|
||||||
output_file_futures.append(pool.submit(AutoWorld.call_single, world, "generate_output", player, temp_dir))
|
output_file_futures.append(pool.submit(AutoWorld.call_single, world, "generate_output", player, temp_dir))
|
||||||
output_file_futures.append(pool.submit(AutoWorld.call_stage, world, "generate_output", temp_dir))
|
output_file_futures.append(pool.submit(AutoWorld.call_stage, world, "generate_output", temp_dir))
|
||||||
|
|
||||||
|
@ -340,7 +342,9 @@ def main(args, seed=None):
|
||||||
# retrieve exceptions via .result() if they occured.
|
# retrieve exceptions via .result() if they occured.
|
||||||
if multidata_task:
|
if multidata_task:
|
||||||
multidata_task.result()
|
multidata_task.result()
|
||||||
for future in output_file_futures:
|
for i, future in enumerate(concurrent.futures.as_completed(output_file_futures)):
|
||||||
|
if i % 10 == 0:
|
||||||
|
logger.info(f'Generating output files ({i}/{len(output_file_futures)}).')
|
||||||
future.result()
|
future.result()
|
||||||
|
|
||||||
pool.shutdown() # wait for all queued tasks to complete
|
pool.shutdown() # wait for all queued tasks to complete
|
||||||
|
|
|
@ -53,9 +53,6 @@ class SubnauticaWorld(World):
|
||||||
def create_regions(self):
|
def create_regions(self):
|
||||||
create_regions(self.world, self.player)
|
create_regions(self.world, self.player)
|
||||||
|
|
||||||
def generate_output(self, output_directory: str):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def fill_slot_data(self):
|
def fill_slot_data(self):
|
||||||
slot_data = {}
|
slot_data = {}
|
||||||
return slot_data
|
return slot_data
|
||||||
|
|
Loading…
Reference in New Issue