Cubitect / cubiomes-viewer

An efficient graphical Minecraft seed finder and map viewer.
GNU General Public License v3.0
976 stars 59 forks source link

[Feature Request] Yield Position change to Inclusive/Exclusive Range #280

Closed Jereaux closed 5 months ago

Jereaux commented 6 months ago

With the change to input a range for Locate Climate Extreme, it does not appear that the "Yield position of" field does anything at the moment. I tested a few times with using Min/Max for the same searches, and I got back the same results with either selected.

I was wondering if it would be possible to change that drop down to more of an inclusive/exclusive range field so that one could search either within the range, or outside of the range input. It could be used for excluding certain biomes with a single condition instead of needing an OR logic gate with an upper and a lower range condition assigned, or for something like Weirdness which seems to have a similar impact on terrain at upper and lower bounds it could be used to search both of those conditions at the same time.

Just to be clear, if the drop down is set to an Inclusive/Inside Range, then a search with values -10000 to 10000 which search for values between those two. So -10500 or 10500 would fail, and 500 would pass.
If you selected an Exclusive/Outside Range in the drop down a with values -10000 to 10000, the condition would pass if the value of weirdness was outside the range, so -10500 or 10500 would pass, but 500 would fail.

Cubitect commented 6 months ago

The locate climate extreme filter uses a gradient descent to find the position and value of either the minimum or maximum climate value of the specified area. The "Yield position of" field controls if the minimum or maximum is found in this way and it should be working. My guess is that you only checked a single position rather than an area? In that case the minimum and maximum are obviously the same.

The rest of your proposal sounds like the NOT logic gate with a Locate Climate Extreme condition with both an upper and lower bound. Granted, the specific use case where the area is just a single position may often coincide with the intent of excluding a value range, rather than requiring one. So I'll consider whether to include this as a build-in feature for the filter.

Jereaux commented 6 months ago

You are spot on that I was only testing at a single point. So if I get this correct, if using the same search within an area (my test was -Inf min to -10000 max Weirdness), using a Yield position of" = Minimum it's going to look for any value that exists on the min range so a single point will pass the check. If I set it to Maximum, then it would pass only if if the Maximum value present (in my case -10000 weirdness) is never broached, so in effect it makes it so the entire range searched must be under the maximum value set?

Sorry for the confusion on my part that came from pretty light testing overall. I didn't really understand how it worked so the fact that it did nothing under a single point was a bit baffling to me.

As for the exclusion using NOT logic gate, I do like that approach for certain search types where I just want to find a single point outside the range, so it should work well for setting up a search for either of two extremes for one parameter type. For a more broad way to exclude I could see some value in a separate setting on the Locate Biome Extreme condition type, but I do think with your explanation it could be lower priority than many other new potential features in my mind at least.

Thanks for all the feedback. As always, cubiomes viewer is amazing and I'm so glad you're continuing to work on it.

Cubitect commented 6 months ago

Yes that is pretty much correct. The min/max position is found independent of the bounds and the value at the found location is then compared to the specified value range to evaluate whether the condition is successfully satisfied.

If you leave both bound blank (-Inf, +Inf), for instance, the condition always succeeds, but it still finds the corresponding min/max location, so it can be examined by dependent conditions.