-
Notifications
You must be signed in to change notification settings - Fork 680
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
Plando: Prevent duplicate candidate locations #2286
Conversation
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.
Thanks!
I still think we should rework how item plando is run under the hood when we have time since this had multiple issues now.
@@ -845,7 +845,7 @@ def failed(warning: str, force: typing.Union[bool, str]) -> None: | |||
for target_player in worlds: | |||
locations += non_early_locations[target_player] | |||
|
|||
block['locations'] = locations | |||
block['locations'] = list(dict.fromkeys(locations)) |
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.
this actually seems to be the fastest way to drop duplicates in vanilla python.
Actually, I'm wondering if it's supposed to be more likely to hit a location if it's listed twice. Similar to weights. |
As the one who originally wrote plando before it was expanded on, I'm relatively sure I did not have that intention. |
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.
tested against the problem yamls/seed that was posted in the discord bug report, as well as a few more gens with different seeds. all genned successfully.
Merging as-is. I was leaving this open for berserker to have the final looksies since this is valuable for rolling the async. |
What is this fixing or adding?
https://discord.com/channels/731205301247803413/1161022518631608320/1161022518631608320
If a user specifies early_locations, non_early_locations, or manually puts the same location name multiple times in the locations field, plando can place items onto non-existent duplicate locations, leading to unfilled locations.
How was this tested?
Added the following plando to a default DS3 yaml, and generated alongside 2 LttP yamls.
Checked that the issue was no longer present. It should be noted that in the case of specific duplication, it treats the length of the list as the number of unique locations.
If this makes graphical changes, please attach screenshots.