Skip to content

Conversation

@nicopop
Copy link
Contributor

@nicopop nicopop commented Jun 12, 2025

Rework get_item_counts to only create the item counts once(1 time) at the end of create_items
this should once and for all fix the counts by using the pool straight out of create_items instead of trying to recreate the item pool later from multiworld and precollected
I also made rules get the count of progression items by default but
I also included a ! suffix if people want to use the old logic of All being every copy of an item not just the ones with progressions in their classification
the ! suffix is a something that can and probably should be something else is I just dont know what, It could even be removed entirely
since I remembered State doesnt count non-progression items while generating meaning any All! would potentially never be in logic while generating

This was tested in 2 tests using the same test manual with 3 copies of an item with 1 in game.json starting_items

  • 1. 1 in start_inventory_from_pool
  • 2. 1 in start_inventory

@nicopop nicopop self-assigned this Jun 12, 2025
@nicopop nicopop marked this pull request as ready for review June 14, 2025 20:04
src/__init__.py Outdated

item_counts = {}
item_counts: dict[int, Counter[str]] = {}
progression_counts: dict[int, Counter[str]] = {}
Copy link
Collaborator

@FuzzyGamesOn FuzzyGamesOn Jun 29, 2025

Choose a reason for hiding this comment

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

As part of this PR, it looks like all calls to world.get_item_counts() were changed to do only progression, and I don't see any other references to world.item_counts that use it in a non-prog way. (And pseudo-count
keywords only do state, so only prog.) So I have two questions:

  1. What's the use case for having a non-prog item counts? What uses it or could use it?
  2. If prog is the default usage, shouldn't get_item_counts() default to prog_only?

Copy link
Contributor Author

@nicopop nicopop Jun 29, 2025

Choose a reason for hiding this comment

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

@FuzzyGamesOn

  1. I wanted to leave a way to get the original all item counts for potential hooks that used those counts (if there was any)
  2. similar to 1 prior to this pr the default call would return all item so I made it a choice so it wouldnt break any hooks that would use this.

if we dont care/worry about backward compat for created hooks then I can change it to default to progs and even remove the non prog support if thats what we wants

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess there's some potential value to being able to get overall counts at the end of create_items, even if we don't use it. Thanks for clarifying. 😄

Copy link
Collaborator

@FuzzyGamesOn FuzzyGamesOn left a comment

Choose a reason for hiding this comment

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

Just a couple small changes. Looks good otherwise!

Copy link
Collaborator

@silasary silasary left a comment

Choose a reason for hiding this comment

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

I'm happy with this

@silasary silasary merged commit 8a1de58 into main Jul 4, 2025
@silasary silasary deleted the item_count_rework branch July 4, 2025 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants