cubiomes-viewer icon indicating copy to clipboard operation
cubiomes-viewer copied to clipboard

Feature suggestion: Quad-structure-finder for every structure

Open Delvin4519 opened this issue 4 years ago • 4 comments

Similar to issue #30 , but add support for quad structures for every structure, so not just ocean monuments or witch huts. Quad igloos, quad villages, quad mansions would be very interesting.

As #30 says, add support for structure seeds for all versions and all structures. Quad structures for all structures

Delvin4519 avatar Apr 19 '21 14:04 Delvin4519

This is something that I would love to see

Vedertesu avatar Apr 20 '21 05:04 Vedertesu

The concept of a quad-structure is based on having the bounding box of four structures simultaneously within the despawn range of a player. This is only useful if that bounding box actually has special mob spawing behaviour, such as Swamp-huts and Monuments. The main other candidate for a quad-structure of this type would be Outposts, but they are too large and you can never get more spawning spaces than could already be achieved with 2 Outposts.

Regarding "quad-structures" with no special function, in the new release v1.6.0 you have the option to add a custom structure-salt to the 48-bit seed generator and replace the swamp-huts with some other structures. However, this will only work for structures that also have a uniform distribution of region-size=32 and chunk-gap=8 (e.g. desert and jungle temples, igloos and villages).

The algorithms that generate these quad-structure protobase lists are very specific for the above structure configs and cannot be generalized for all structures. This means, whatever I would implement won't perform much better than what you can already do by adding a condition that says: 4 structures of this type within this rectangle.

Mansions? They are always a minimum of 320 blocks apart, I don't think that qualifies for any sense of quad-structure.

Cubitect avatar Jun 04 '21 00:06 Cubitect

Would still be helpful to find seeds with 4 mansions within a 384x384 area, that would still be a quad structure since it's the closest 4 mansions can get.

Delvin4519 avatar Jun 06 '21 00:06 Delvin4519

Finding quad-structures of swamp huts, desert pyramids, jungle temples, igloos, villages and outposts should be relatively straightforwards to achieve in the recent versions by playing around with the structure salts, even if they are still not presented as direct option.

Other structures essentially use different algorithms, so quad-structures in general don't really exist as such.

I have included quad-monuments in the tool despite a lack of a hard definition, mostly because their bounding boxes are somewhat useful, and there happen to be near misses of actual quad-monuments, where up to 98% of the area is inside the 128 block despawn range. There is no fast way to find these (that I am aware of), but there are so few of them that I could just hard code them into the tool. (Another reason was that I am pretty sure I was the first to find these seeds, so they were an interesting and novel feature to include.)

Considering quad-mansions with some maths..

Mansions in particular are different to other structures. They have a region size of 80 chunks, a chunk gap of 20 and follow a triangular distribution. As I mentioned before, this means that the minimum distance between mansions is 20 chunks, or 320 blocks. However, the chance for two mansions to be as close to one another as possible is very small due to the triangular distribution. Assuming a properly random sampling it would be one in (60^2)^2 = 12960000 for just one direction. For a perfect quad-structure, it would be the quartic of that, i.e. 1:60^16. That is 14 order of magnitude greater than the set of 2^48 structure seeds has, so I can be very confident they don't exist. Even if we relax the requirement and allow imperfect placement in the corners, there is virtually no chance for any 'good' quad-mansions to exist. The best you can do regarding a 'quad-structure' would be to go through all 2^48 seeds and just pick out an arbitrary number of best seeds or so. I don't really fancy doing such a brute force search for so many days for some arbitrary definition of quad-structures. If that is what you really want, I feel it would be better to write a specific search tool.

Something that might be interesting and should also exist are perfect double-mansions. Such a configuration would need to satisfy the above chance of 1:12960000 for one direction and be arbitrarily aligned in the other direction. If my math is correct, this should come out to be a 2 in 2392274605 chance if both a North-South and a East-West orientation is acceptable. So I would expect there to be around 235k such structure seeds.

So a double-mansion finder might become a thing. However, until there is a fast algorithm that can generate these structure seeds in a minute or less, I don't think this should become a builtin finder in the GUI. This should rather be provided as a seed list file that can be loaded with the 48-bit seed generator instead.

Cubitect avatar Jul 23 '21 19:07 Cubitect