OoT-Randomizer icon indicating copy to clipboard operation
OoT-Randomizer copied to clipboard

maximum recursion depth exceeded while calling a Python object

Open Surdjak opened this issue 2 years ago • 1 comments

It's pretty obvious why it happened but I still wanted to report this. In short, there's most likely too much randomization as all the ER options are activated and i'm trying to generate a 4-world coop seed. Removing one-way still lead to an error but not a python one at least, it's the "too much tries" one. I don't know if main branch intend to include your changes or something close to it but either way they will probably come up with the same problem if it's indeed just a combinatorial problem. I don't know if a better logic can be used but if it does, I imagine it would be a pretty big refactor.

Setting string: HSARCSBSL62AEMTDDS7PF8KA4QMERGA9CAAKSBJ6399P55Z495STAAEACJD8SZAAAAADA5VASST87A2VECHV9

Update: Took me a while to notice the obvious but it happens when generating the spoiler. Short term solution would be to not generate it.

maximum recursion depth exceeded while calling a Python object
Traceback (most recent call last):
  File "D:\N64\Randomizers\OoT-Randomizer-Fork\OoTRandomizer.py", line 58, in start
    main(settings)
  File "D:\N64\Randomizers\OoT-Randomizer-Fork\Main.py", line 46, in main
    spoiler = generate(settings)
  File "D:\N64\Randomizers\OoT-Randomizer-Fork\Main.py", line 120, in generate
    return make_spoiler(settings, worlds)
  File "D:\N64\Randomizers\OoT-Randomizer-Fork\Main.py", line 180, in make_spoiler
    spoiler.create_playthrough()
  File "D:\N64\Randomizers\OoT-Randomizer-Fork\Spoiler.py", line 144, in create_playthrough
    worlds = self.copy_worlds()
  File "D:\N64\Randomizers\OoT-Randomizer-Fork\Spoiler.py", line 122, in copy_worlds
    worlds = [world.copy(copy_dict=copy_dict) for world in self.worlds]
  File "D:\N64\Randomizers\OoT-Randomizer-Fork\Spoiler.py", line 122, in <listcomp>
    worlds = [world.copy(copy_dict=copy_dict) for world in self.worlds]
  File "D:\N64\Randomizers\OoT-Randomizer-Fork\World.py", line 361, in copy
    new_world.dungeons = [dungeon.copy(copy_dict=copy_dict) for dungeon in self.dungeons]
  File "D:\N64\Randomizers\OoT-Randomizer-Fork\World.py", line 361, in <listcomp>
    new_world.dungeons = [dungeon.copy(copy_dict=copy_dict) for dungeon in self.dungeons]
  File "D:\N64\Randomizers\OoT-Randomizer-Fork\Dungeon.py", line 38, in copy
    new_dungeon.regions = [region.copy(copy_dict=copy_dict) for region in self.regions]
  File "D:\N64\Randomizers\OoT-Randomizer-Fork\Dungeon.py", line 38, in <listcomp>
    new_dungeon.regions = [region.copy(copy_dict=copy_dict) for region in self.regions]
  File "D:\N64\Randomizers\OoT-Randomizer-Fork\Region.py", line 62, in copy
    new_region.exits = [entrance.copy(copy_dict=copy_dict) for entrance in self.exits]
  File "D:\N64\Randomizers\OoT-Randomizer-Fork\Region.py", line 62, in <listcomp>
    new_region.exits = [entrance.copy(copy_dict=copy_dict) for entrance in self.exits]
  File "D:\N64\Randomizers\OoT-Randomizer-Fork\Entrance.py", line 40, in copy
    new_entrance.connected_region = self.connected_region.copy(copy_dict=copy_dict)
  File "D:\N64\Randomizers\OoT-Randomizer-Fork\Region.py", line 63, in copy
    new_region.locations = [location.copy(copy_dict=copy_dict) for location in self.locations]
  File "D:\N64\Randomizers\OoT-Randomizer-Fork\Region.py", line 63, in <listcomp>
    new_region.locations = [location.copy(copy_dict=copy_dict) for location in self.locations]
  File "D:\N64\Randomizers\OoT-Randomizer-Fork\Location.py", line 64, in copy
    new_location.item = self.item.copy(copy_dict=copy_dict)
  [...]
RecursionError: maximum recursion depth exceeded while calling a Python object

Surdjak avatar Jun 26 '23 06:06 Surdjak

Thank you for your report and all the details, it does look like there is a general issue with generating multiworld seeds with a lot of shuffle settings. I was able to reproduce it in the main branch as well so it doesn't seem to be related to any of the changes specific to my branch, but I brought it up to the others so it can be looked into.

Also it can happen without any ER settings so disabling the spoiler log is probably the only workaround for now. Either that or disabling a certain amount of Item Shuffle settings because it looks like it only happens when a lot of those are enabled (probably due to the amount of items to handle for the randomizer)

Roman971 avatar Jul 03 '23 23:07 Roman971