-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Automapping fix #1224 #1276
Merged
Merged
Automapping fix #1224 #1276
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
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.
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 understand that rather than discarding the whole match just because the output layer does not contain every position in the rule region, you're instead taking a shortcut in only checking the
listYes
, since thelistNo
is irrelevant for determining an out-of-range match?What I don't understand yet, is why when a layer in
listYes
does not contain this rule region position, should the match fail? Shouldn't that be treated like the cell being empty, thus doingcontinue
?In general, wouldn't it make sense to make sure the layers in
listYes
andlistNo
are all the same size, and all big enough to contain theruleRegion
? Then we can drop all thecontains
checks on them. Or is there some reason why this is not the case?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.
right.
right.
The assumption I made here is 'treat any position outside the map as if it contains no tile, i.e. the nullptr tile in the input region, but it is part of the region to inspect'.
Looking at #1224, the first solution I came up with in code here looked like
which comes from 'the stone may be just outside the map', and we don't want to have that IMHO.
So when we assume there are only nulls outside, we don't have to check any of listNo, as there is nothing to exclude (because we assume nulls).
If there is a position in listYes though, that tile is asked to be unequal to null, i.e. we want to check if there is that tile is not null. I'll look into that again if we could come up with a saner logic for that example case presented in #1224.
I think it was intentional to allow arbitrary sizes.
oh. I'd have to think about that.
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.
Right, but I was asking why the match failed when a layer in
listYes
does not contain this rule region position, whereas in the case of the stone, thelistYes
does contain the position but thesetLayer
doesn't, right?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 tried a different fix: simply assuming that tiles outside the set layer are empty, by doing:
However, it did not work, and I have no idea why. Can you explain this? I still find all this rather hard to understand. :-/
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 also find this hard to understand, so I started making a KV map of all boolean conditions.
However the answer came up when looking at the rule, which states:
The last condition seems to be a little confusing.
The rock is excluded because of the exception mentioned in the comment above the function. Essentially to deal with situations like two adjacent rocks and then not putting flowers over each other. The empty tile is excluded because we need to have 'something' there for matching.
When using your suggestion (3 times, for c1 as well as for c2 in the loops below), you can archive the corner cases in another simple different way by adding an 'inputnot_Ground' layer to the rule and put rocks in the outer tiles.
Then you remove the condition for having 'something' around.
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.
Hmm, what I still don't understand, is why then does it work for the rocks that are not on the edge? Because they too have empty tiles around them, just like rocks on the edge when you treat out-of-bounds as empty tiles, right?
Also, actually I don't understand why the empty tile is in that exclude list. :S