-
Notifications
You must be signed in to change notification settings - Fork 657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ocarina of Time: options and general cleanup #3767
Conversation
@@ -208,8 +208,8 @@ def patch_rom(world, rom): | |||
|
|||
# Fix Ice Cavern Alcove Camera | |||
if not world.dungeon_mq['Ice Cavern']: | |||
rom.write_byte(0x2BECA25,0x01); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HELP!?!?!!!!?!??!??!?!?!?! I NEED ESPEON TO EXPLAIN HIMSELF RIGHT NOW
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
About to label this release/blocker
over this oh my lord
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is your yearly reminder that ;
is perfectly legal in Python and is just ignored. Apparently it's meant for multiline statements but is fine with the other statement being null?
There are two spots in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two missed old option methods for start_inventory
in ItemPool.py
(commented on earlier). Otherwise, these changes LGTM. I ran until I had 100 successful 5-player fully random generations, there were several that failed, though many of these also failed with the previous code. No other old option methods were hit. A particularly strange (potentially concerning) thing is that generating with the same seed before and after these changes would give identical rolled options for players 2-5 but player 1 would have several deviations every single time (only ten such generations were tested).
It may be a good idea to remove the per_slot_randoms
from OoTAdjuster.py
as well.
The changes seem fine, and seem to work, I'm just slightly concerned about the player 1 problem
OoT was using the global random in many places, it wouldn't surprise me if that changed the outcome of those options. It is a little weird to only affect player 1 though. |
I've been testing this, and I just figured it out after a collective 2-ish hours digging. |
From what I understand, this happens under the conditions that:
So random.getrandbits() has this line
which basically makes it "reroll until the random is in the correct range" (Note: getrandbits can only output in [0, 2^n) ranges, so if you have 3 choices This means that each random call takes a random amount of getrandbits calls Now, at the start, due to you moving DeathLink, you "misalign" the options generation on main and on this PR. This explains why for a single player, after some point, all the options are the same. The desynced random calls happen to sync up again on the same option, and we're synced again until we come up to the moved-to-the-end DeathLink option. But in the case where we didn't add/remove an option from the start, but instead moved one from the start to the end or vice versa, consider what happens at the end of player 1 / start of player 2: Death Link gets evaluated for player 1 on main Branch Which means that random advances by the same amount, and Player 2 now starts synced between the two branches. Which means that from here on out, everything will be synced. |
Here's the diff checker for two generations where I output every call to "random.getrandbits()" (which covers all random methods), and you can see that at some point, they miraculously "sync up", and after that point, are only different briefly between the end-of-player DeathLink call on branch 1, and the start-of-player DeathLink call on branch 2 |
What is this fixing or adding?
world: MultiWorld
multiworld: World
How was this tested?
Unittests and generations of 10 OoTs with fully random settings. I know this is not comprehensive, but it was the best I could manage. Generation with 2 OoTs itemlinked together with link_replacement and replacement_item null. Did not playtest.
If this makes graphical changes, please attach screenshots.