Skip to content
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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

NewSoupVi
Copy link
Member

@NewSoupVi NewSoupVi commented Mar 10, 2025

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.

@github-actions github-actions bot added affects: core Issues/PRs that touch core and may need additional validation. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. labels Mar 10, 2025
@NewSoupVi NewSoupVi added the is: refactor/cleanup Improvements to code/output readability or organizization. label Mar 10, 2025
@NewSoupVi NewSoupVi changed the title MultiServer.py: Store Hint Priority & the found attribute together in an IntFlag for efficiency Core, MultiServer, CommonClient: Store Hint Priority & the found attribute together in an IntFlag for efficiency Mar 10, 2025

is_pure_trap = (
ItemClassification.trap in item_flags
and not ItemClassification.useful in item_flags
Copy link
Contributor

@EmilyV99 EmilyV99 Mar 10, 2025

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.

Copy link
Contributor

@EmilyV99 EmilyV99 left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects: core Issues/PRs that touch core and may need additional validation. is: refactor/cleanup Improvements to code/output readability or organizization. waiting-on: peer-review Issue/PR has not been reviewed by enough people yet.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants