-
Notifications
You must be signed in to change notification settings - Fork 684
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
The Witness: Change all option name comparisons to strings instead of numeric values #2503
Conversation
This will likely conflict with #2499 so I'll wait for that before un-drafting this one, bc that one is more important |
I used a regex search and found some other comparisons that could be strings and some simplify-able comparisons: |
3705b8e
to
d0b3d78
Compare
I'm happy with The line Some of the code is not mine and I'm worried that removing "> 0" could cause some problem with negative values and it's outside of the scope of this PR anyway As for the two remaining things relating to options, I've changed those now :) Thanks |
just peeked at it and |
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.
I read through the changes, primarily to the postgame section, to check that they lined up with my understanding of the game. I then ran 1500 fully-random, differently-seeded generations on main
and option_names
and compared the outputs. I also specifically checked all 96 reasonable combinations of postgame settings. The outputs were identical except when the one additional postgame consideration occurred (lines 324-235 of player_logic.py
), which is the expected behavior.
This PR is at the bottom of a pretty big dependency chain at this point, so it'd be epic if this could be prioritised over other Witness PRs 🙏 It shouldn't be super hard to review I think |
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.
LGTM
Having any kind of unit test that verifies the options put the corresponding items/things into the pool/member variables, and that slot data has the correct output of the correct input wouldn't hurt going forward though. (It would make sure it behaves the same before and after, and save you from typos in strings)
… numeric values (ArchipelagoMW#2503) * Refactor postgame code to be more readable * Change all references to options to strings * oops * Fix some outdated code related to yaml-disabled EPs * Small fixes to short/longbox stuff (thanks Medic) * comment * fix duplicate * Removed triplicate lmfao * Better comment * added another 'unfun' postgame consideration * comment * more option strings * oops * Remove an unnecessary comparison * another string missed * Another was missed * This would create a really bad merge error
… numeric values (ArchipelagoMW#2503) * Refactor postgame code to be more readable * Change all references to options to strings * oops * Fix some outdated code related to yaml-disabled EPs * Small fixes to short/longbox stuff (thanks Medic) * comment * fix duplicate * Removed triplicate lmfao * Better comment * added another 'unfun' postgame consideration * comment * more option strings * oops * Remove an unnecessary comparison * another string missed * Another was missed * This would create a really bad merge error
… numeric values (ArchipelagoMW#2503) * Refactor postgame code to be more readable * Change all references to options to strings * oops * Fix some outdated code related to yaml-disabled EPs * Small fixes to short/longbox stuff (thanks Medic) * comment * fix duplicate * Removed triplicate lmfao * Better comment * added another 'unfun' postgame consideration * comment * more option strings * oops * Remove an unnecessary comparison * another string missed * Another was missed * This would create a really bad merge error
… numeric values (ArchipelagoMW#2503) * Refactor postgame code to be more readable * Change all references to options to strings * oops * Fix some outdated code related to yaml-disabled EPs * Small fixes to short/longbox stuff (thanks Medic) * comment * fix duplicate * Removed triplicate lmfao * Better comment * added another 'unfun' postgame consideration * comment * more option strings * oops * Remove an unnecessary comparison * another string missed * Another was missed * This would create a really bad merge error
Refactor all the options checking to do
world.options.shuffle_EPs == "individual"
instead ofworld.options.shuffle_EPs == 1
Also, do a refactor of the shuffle_postgame code, which is where most of the option checking happens. This part probably needs to be looked over by someone who understands the game. I'm gonna request a review from Exempt-Medic I think.