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: fix unfilled items "Per-Player Count" #2661

Merged
merged 5 commits into from
Apr 21, 2024

Conversation

Silvris
Copy link
Collaborator

@Silvris Silvris commented Jan 3, 2024

What is this fixing or adding?

At some point (likely the region caching rework), multiworld.get_locations was changed to include unfilled locations as well as filled, creating a mismatch between the evaluated per-player count and the actual player location count.

How was this tested?

Debugging two plando bugs, and wondering why the counts were showing an additional 2 locations.

If this makes graphical changes, please attach screenshots.

@alwaysintreble alwaysintreble added is: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. affects: core Issues/PRs that touch core and may need additional validation. labels Jan 5, 2024
@PoryGone PoryGone added the waiting-on: peer-review Issue/PR has not been reviewed by enough people yet. label Feb 10, 2024
Copy link
Contributor

@Ixrec Ixrec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is my first time looking at fill.py, since qwint asked for more eyes on this in Discord, but I can't make heads or tails of what's going on with this change even with the PR description.

get_locations() if location.item and .get_filled_locations() seem to be doing the same thing, from looking at the (current) implementation of get_filled_locations(), so changing that part seems like a clear readability improvement.

That would imply the real change is the deletion of the .update() below. This appears to only affect the "Per-Player counts" log, but why do we want these counts to include unplaced items while excluding unfilled locations? Since they don't specify, I would've naively expected these counts to be all items and locations, including the unplaced items and unfilled locations.

And the PR description says that get_locations() used to be filled only. But if that's the case, why is there already a if location.item check here? Does "filled" mean something different from "has an item"?

@Silvris
Copy link
Collaborator Author

Silvris commented Mar 5, 2024

The unfilled locations are already accounted for within .get_locations(), we don't need to duplicate them. I wasn't actually sure that it used to be filled only, I just assumed that to be the case since it would justify the existence of adding the unfilled. We have to update the items, as since these items remained unplaced, they have no ties to any location.

@Exempt-Medic Exempt-Medic added the waiting-on: author Issue/PR is waiting for feedback or changes from its author. label Apr 5, 2024
@Exempt-Medic Exempt-Medic removed the waiting-on: author Issue/PR is waiting for feedback or changes from its author. label Apr 10, 2024
@qwint
Copy link
Contributor

qwint commented Apr 14, 2024

not certain about the code changes but they seem simple enough
but I did test both main and this branch using my world (minit) to submit too many items and not enough items and see the messaging, which seems to replicate the issue Silvris is trying to solve and show it corrected on the PR's branch
too few items on main (6 too few), the Counters misrepresent unfilled locations
image

too few items on this pr (6 too few), the Counters match the rest of the info
image

too many items on main (9 too many), no issue
image

too many items on this pr (9 too many), no change (so no issue)
image

@ThePhar ThePhar merged commit 915ad61 into ArchipelagoMW:main Apr 21, 2024
15 checks passed
qwint pushed a commit to qwint/Archipelago that referenced this pull request Jun 24, 2024
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: bug/fix Issues that are reporting bugs or pull requests that are fixing bugs. 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.

7 participants