You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ast.NameConstant was deprecated in Python 3.8 such that attempting to create an ast.NameConstant creates an ast.Constant instead (see https://docs.python.org/3/library/ast.html#ast.AST), this means that all checks against the string dump of a node being 'NameConstant(True)' or 'NameConstant(False)' are never hit, because the string dumps will instead be 'Constant(True)' or 'Constant(False)'.
I would have submitted a PR to make this change, but doing so causes generation with entrance randomization enabled to fail (yaml attached in a zip) and I have no idea why.
Changing these to use 'Constant(False)'/'Constant(True)' seems to work:
So whatever spot.never = True or spot.always = True did in the past seems to no longer work correctly:
Calculating Access Rules.
Uncaught exception
Traceback (most recent call last):
File "G:\git_Repos_other\Archipelago\Generate.py", line 531, in <module>
multiworld = ERmain(erargs, seed)
^^^^^^^^^^^^^^^^^^^^
File "G:\git_Repos_other\Archipelago\Main.py", line 150, in main
AutoWorld.call_all(multiworld, "set_rules")
File "G:\git_Repos_other\Archipelago\worlds\AutoWorld.py", line 181, in call_all
call_single(multiworld, method_name, player, *args)
File "G:\git_Repos_other\Archipelago\worlds\AutoWorld.py", line 171, in call_single
raise e
File "G:\git_Repos_other\Archipelago\worlds\AutoWorld.py", line 164, in call_single
ret = _timed_call(method, *args, multiworld=multiworld, player=player)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\git_Repos_other\Archipelago\worlds\AutoWorld.py", line 150, in _timed_call
ret = method(*args)
^^^^^^^^^^^^^
File "G:\git_Repos_other\Archipelago\worlds\oot\__init__.py", line 818, in set_rules
shuffle_random_entrances(self)
File "G:\git_Repos_other\Archipelago\worlds\oot\EntranceShuffle.py", line 452, in shuffle_random_entrances
set_all_entrances_data(multiworld, player)
File "G:\git_Repos_other\Archipelago\worlds\oot\EntranceShuffle.py", line 21, in set_all_entrances_data
return_entrance = world.get_entrance(return_entry[0], player)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "G:\git_Repos_other\Archipelago\BaseClasses.py", line 424, in get_entrance
return self.regions.entrance_cache[player][entrance_name]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
KeyError: 'Barinade Boss Room -> Jabu Jabus Belly Boss Door'
Exception in <bound method OOTWorld.set_rules of <worlds.oot.OOTWorld object at 0x00000213B0007650>> for player 1, named Player1.
I don't know why the crash occurs with the fix; the purpose of self.never was essentially to let us discard entrances and locations that could never be used, in order to streamline searches. In practice, it looks like OoTR now mostly uses them to simplify rules editing (i.e. a hinted location has a rule that its hint must be accessible first).
What happened?
ast.NameConstant
was deprecated in Python 3.8 such that attempting to create anast.NameConstant
creates anast.Constant
instead (see https://docs.python.org/3/library/ast.html#ast.AST), this means that all checks against the string dump of a node being'NameConstant(True)'
or'NameConstant(False)'
are never hit, because the string dumps will instead be'Constant(True)'
or'Constant(False)'
.To check, run the following:
I would have submitted a PR to make this change, but doing so causes generation with entrance randomization enabled to fail (yaml attached in a zip) and I have no idea why.
Changing these to use
'Constant(False)'
/'Constant(True)'
seems to work:Archipelago/worlds/oot/RuleParser.py
Line 388 in f06d450
Archipelago/worlds/oot/RuleParser.py
Line 393 in f06d450
But changing these to use
'Constant(False)'
/'Constant(True)'
causes generation with entrance randomization to fail:Archipelago/worlds/oot/RuleParser.py
Line 489 in f06d450
Archipelago/worlds/oot/RuleParser.py
Line 491 in f06d450
So whatever
spot.never = True
orspot.always = True
did in the past seems to no longer work correctly:Ocarina of Time.yaml.zip
What were the expected results?
There should not be conditional branches than can never be hit.
Software
Local generation
The text was updated successfully, but these errors were encountered: