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

The Messenger: actually implement get_filler_item_name #2070

Merged
merged 4 commits into from
Aug 1, 2023

Conversation

alwaysintreble
Copy link
Collaborator

What is this fixing or adding?

Returns more proper filler for item links instead of hardcoded "Time Shard" which is basically worthless. The 100 is a completely arbitrary number, could be any number really, but that should be enough to satisfy most multiworlds, as maximum filler generated without starting_inventory is 98. This isn't high priority, as it really only has an effect on item links.

How was this tested?

Generated a few multiworlds to satisfy all the different combinations and tests.

If this makes graphical changes, please attach screenshots.

Comment on lines 174 to 176
self._filler_items = [name for name in self.random.choices(list(FILLER),
weights=list(FILLER.values()),
k=100)]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
self._filler_items = [name for name in self.random.choices(list(FILLER),
weights=list(FILLER.values()),
k=100)]
self._filler_items = self.random.choices(list(FILLER), weights=list(FILLER.values()), k=20)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i guess it's better to have a smaller cache, and need to create it more frequently, than just create a too large one once?

Copy link
Member

Choose a reason for hiding this comment

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

in my experience, probably yes. I did not benchmark it.

Comment on lines 136 to 142
self._filler_items = [name
for name in
self.random.choices(
list(filler_pool),
weights=list(filler_pool.values()),
k=remaining_fill
)]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
self._filler_items = [name
for name in
self.random.choices(
list(filler_pool),
weights=list(filler_pool.values()),
k=remaining_fill
)]
self._filler_items = self.random.choices(
list(filler_pool),
weights=list(filler_pool.values()),
k=remaining_fill
)

formatting is not easily fixable in this editor.

filler_pool = dict(list(FILLER.items())[2:])
self._filler_items = self.random.choices(
list(filler_pool),
weights=list(filler_pool.values()),
Copy link
Member

Choose a reason for hiding this comment

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

I can't help but notice a list(dict(list row of calls to arrive here.. which smells bad.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

i want it to remain as a dict, but i trim off the first few key, value pairs. is there a better way to do that?

@Berserker66 Berserker66 merged commit 6befc91 into ArchipelagoMW:main Aug 1, 2023
12 checks passed
@ThePhar ThePhar added the is: enhancement Issues requesting new features or pull requests implementing new features. label Aug 16, 2023
@alwaysintreble alwaysintreble deleted the messenger-filler branch October 12, 2023 11:23
FlySniper pushed a commit to FlySniper/Archipelago that referenced this pull request Nov 14, 2023
kl3cks7r pushed a commit to kl3cks7r/Archipelago that referenced this pull request Dec 15, 2023
Jouramie pushed a commit to Jouramie/Archipelago that referenced this pull request Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is: enhancement Issues requesting new features or pull requests implementing new features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants