Zillion: fix unreproducible seeds (#1166)

* fix zillion unreproducible seeds

* world to multiworld merge
This commit is contained in:
Doug Hoskisson 2022-11-01 06:45:17 -07:00 committed by GitHub
parent 95ea0541e6
commit 962e48c078
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 2 deletions

View File

@ -9,7 +9,7 @@ from worlds.AutoWorld import call_all
class WorldTestBase(unittest.TestCase):
options: typing.Dict[str, typing.Any] = {}
world: MultiWorld
multiworld: MultiWorld
game: typing.ClassVar[str] # define game name in subclass, example "Secret of Evermore"
auto_construct: typing.ClassVar[bool] = True

View File

@ -0,0 +1,29 @@
from typing import cast
from test.worlds.zillion import ZillionTestBase
from worlds.zillion import ZillionWorld
class SeedTest(ZillionTestBase):
auto_construct = False
def test_reproduce_seed(self) -> None:
self.world_setup(42)
z_world = cast(ZillionWorld, self.multiworld.worlds[1])
r = z_world.zz_system.randomizer
assert r
randomized_requirements_first = tuple(
location.req.gun
for location in r.locations.values()
)
self.world_setup(42)
z_world = cast(ZillionWorld, self.multiworld.worlds[1])
r = z_world.zz_system.randomizer
assert r
randomized_requirements_second = tuple(
location.req.gun
for location in r.locations.values()
)
assert randomized_requirements_first == randomized_requirements_second

View File

@ -133,6 +133,7 @@ class ZillionWorld(World):
self.zz_system.make_patcher(rom_dir_name)
self.zz_system.make_randomizer(zz_op)
self.zz_system.seed(self.multiworld.seed)
self.zz_system.make_map()
# just in case the options changed anything (I don't think they do)

View File

@ -1 +1 @@
git+https://github.com/beauxq/zilliandomizer@c97298ecb1bca58c3dd3376a1e1609fad53788cf#egg=zilliandomizer==0.4.5
git+https://github.com/beauxq/zilliandomizer@10549a126b3293595ddb6816b896c1f88ce344c5#egg=zilliandomizer==0.4.6