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] Dynamic relative position #283

Closed 0x000006 closed 5 months ago

0x000006 commented 5 months ago

Currently we already have relative positions, but the position they are relative to is always static.

For example Cubiomes has a condition to find a village in a 200 block radius around {0, 0}. It finds a village at {96, 32} so it passes the condition. Next condition is a ruined portal within 50 blocks of that village. Let's assume that there is a portal nearby at {80, 16}

The relative position is currently always static, so it searches between {25, 25} and {-25, -25} (the center of the village condition). The portal condition would fail, because it's out of range.

But if the relative position was dynamic, it would search between {96 + 25, 32 + 25} = {121, 57} and {96 - 25, 32 - 25} = {71, 7}. The condition would succeed, because the portal is within 50 blocks of the actual village, not withing 50 blocks of the center of the village condition.

This feature can also potentially save some CPU time, because for example if we are searching for something around the spawn point we don't need to set it near a fixed point, we can search around it depending on where it is.

Cubitect commented 5 months ago

That's what the "Location is relative to" option is for (it isn't static). When a condition passes, it yields at least one position, that it's children use as their relative starting point.

Some things to note though:

0x000006 commented 5 months ago

Thanks!