Open Mysteryem opened 2 months ago
The python 3.8 issue was fixed in https://github.com/OoTRandomizer/OoT-Randomizer/commit/0eb85cb8be443036a9d91b6f21e9be63d6125fa3 to just add the Constant(False)
etc options as alternatives.
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).
AP, however, still drops entrances here: https://github.com/ArchipelagoMW/Archipelago/blob/6287bc27a68ace32679fe8a41a580df7180cd9d8/worlds/oot/__init__.py#L583-L586
whereas that was removed from OoTR in https://github.com/OoTRandomizer/OoT-Randomizer/commit/6a8967cfa25060edd6793c3b9699fb33b195df4b#diff-bfdf4e3e2ed58a0618ffff5f14862b7a0b5427b9ce41ce7fc8edb19224e1862c
(Behavior for item locations and event locations seems to be same as current OoTR.)
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: https://github.com/ArchipelagoMW/Archipelago/blob/f06d4503d83209b8fae6897eef500493d57826e8/worlds/oot/RuleParser.py#L388 https://github.com/ArchipelagoMW/Archipelago/blob/f06d4503d83209b8fae6897eef500493d57826e8/worlds/oot/RuleParser.py#L393But changing these to use
'Constant(False)'
/'Constant(True)'
causes generation with entrance randomization to fail: https://github.com/ArchipelagoMW/Archipelago/blob/f06d4503d83209b8fae6897eef500493d57826e8/worlds/oot/RuleParser.py#L489 https://github.com/ArchipelagoMW/Archipelago/blob/f06d4503d83209b8fae6897eef500493d57826e8/worlds/oot/RuleParser.py#L491So 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