-
Notifications
You must be signed in to change notification settings - Fork 723
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
The Messenger: actually implement get_filler_item_name
#2070
Conversation
worlds/messenger/__init__.py
Outdated
self._filler_items = [name for name in self.random.choices(list(FILLER), | ||
weights=list(FILLER.values()), | ||
k=100)] |
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.
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) |
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.
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?
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.
in my experience, probably yes. I did not benchmark it.
worlds/messenger/__init__.py
Outdated
self._filler_items = [name | ||
for name in | ||
self.random.choices( | ||
list(filler_pool), | ||
weights=list(filler_pool.values()), | ||
k=remaining_fill | ||
)] |
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.
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.
worlds/messenger/__init__.py
Outdated
filler_pool = dict(list(FILLER.items())[2:]) | ||
self._filler_items = self.random.choices( | ||
list(filler_pool), | ||
weights=list(filler_pool.values()), |
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.
I can't help but notice a list(dict(list row of calls to arrive here.. which smells bad.
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.
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?
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.