find revealed locations by a very common substring#1661
Merged
Conversation
that's a consequence of search running in two passes: finding locations whose name best match the given string, then filter the list to only keep already revealed locations. And also the list produced by the first pass having a finite size. They're screens upon screens of locations matching "Ruins..." (or "Ruins of..." for that matter) in the Wrothgarian Mountains, so only a subset of the names are kept by the first pass; And since the revealed dungeon name is not in the intermediate list (by pure bad luck), the second pass doesn't keep any names. Simplest fix is just to increase the size of the intermediate list. The first pass creates the list using a priority queue, so it should stay very fast. Other possibilities include swapping the two passes (search among the name of the locations that are revealed) but I don't know how fast we can create the list of all revealed locations; or add a predicate parameter to the function filtering names, so we can check if the location is revealed just before it's put in the intermediate list. Forums: https://forums.dfworkshop.net/viewtopic.php?f=24&t=3292
Owner
|
I think a regression from this change - sometimes when searching for a location (e.g. "daggerf" in Daggerfall) will drop back to an empty search box without any results. Doesn't always happen, no errors in logs. I'll update if I manage to pin it down any further. Edit: Scratch that, reducing maxMatchingResults back to 20 and can still reproduce this problem. Not sure then what caused this, I haven't encountered before. Will dive in later when I can. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
that's a consequence of search running in two passes: finding locations whose name best match the given string, then filter the list to only keep already revealed locations. And also the list produced by the first pass having a finite size.
They're screens upon screens of locations matching "Ruins..." (or "Ruins of..." for that matter) in the Wrothgarian Mountains, so only a subset of the names are kept by the first pass; And since the revealed dungeon name is not in the intermediate list (by pure bad luck), the second pass doesn't keep any names.
Simplest fix is just to increase the size of the intermediate list. The first pass creates the list using a priority queue, so it should stay very fast.
Other possibilities include swapping the two passes (search among the name of the locations that are revealed) but I don't know how fast we can create the list of all revealed locations; or add a predicate parameter to the function filtering names, so we can check if the location is revealed just before it's put in the intermediate list.
Forums: https://forums.dfworkshop.net/viewtopic.php?f=24&t=3292