-
Notifications
You must be signed in to change notification settings - Fork 842
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
Core, MultiServer, CommonClient: Store Hint Priority & the found attribute together in an IntFlag for efficiency #4721
base: main
Are you sure you want to change the base?
Conversation
|
||
is_pure_trap = ( | ||
ItemClassification.trap in item_flags | ||
and not ItemClassification.useful in item_flags |
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.
The fact that useful trap is in many cases used to mark a trap as "never exclude", would still make these wanted to be avoided. Then again, if someone uses the flag to mean "actually useful", then this would not be desired. Neither way here is correct, but, that's entirely the fault of the never_exclude
/useful
bullshit, so, 🤷♀️ I guess this is fine
Also if we go with the change of "default to unspecified, add commands for other priorities", then this is obsolete anyway- which I think is a change strongly worth making.
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.
Looks good now. Didn't test, but, changes look sound.
This was discussed in the Discord some time ago.
There were a lot of considerations when making this, the main one being backwards compatibility.
I'm going to refer to versions without HintPriority as 0.5.1, versions with the current implementation of HintPriority as 0.6.0, and this PR as... "this PR".
Connecting a "this PR" CommonClient to an 0.5.1 game should correctly report Found / Not Found.
Connecting a "this PR" CommonClient to an 0.6.0 game will only report Found / Not Found, and not let you change any priorities. I really don't think it's worth it to make a proper compatibility layer beyond that, but I'm willing to be convinced otherwise.
Loading a 0.5.1 savegame on "this PR" MultiServer.py should correctly convert all the hints to unspecified priority with their found status retained.
Loading a 0.6.0 savegame on "this PR" MultiServer.py will strip all of the hints of their priority and set it to unspecified, while retaining the correct found status. This is the part I'm most unhappy about, as the release of the hypothetical 0.6.1 with this PR in would wipe everyone's priorities, and everyone would have to go and reapply them for their ongoing games. I might make a compatibility layer here if enough people think it's an issue.
I left room for 6 more "technical flags" and theoretically infinite new statuses.