Angry-Pixel / The-Betweenlands

A dark, hostile environment...
http://bit.ly/TheBetweenlands
244 stars 77 forks source link

Locating mechanic - suggestion #639

Open LawsOfScience opened 6 years ago

LawsOfScience commented 6 years ago

First off, this mod is an absolutely breathtaking mod with how immersive and detailed it is. It adds in a myriad of new blocks, tools, mobs, bosses, and mechanics within one dimension with a story behind it all to boot, and I adore that.

Now, my suggestion. Seeing that it can be quite difficult to traverse the entire dimension looking for a structure like a Wight Fortress or a Cragrock Tower, especially (and mainly) when you are exploring in Creative mode, I propose that you guys implement a /locate command tuned to this mod's structures so that it can be easy for people like me who toy with mods in Creative mode to find these structures.

I'm sorry if this has already been suggested/implemented, but I couldn't find any evidence of either. Thank you for considering this!

Divineaspect commented 6 years ago

an in game location method would also be quite nice.

TheCyberBrick commented 6 years ago

Unfortunately this is not possible due to the way the structures are implemented. It's certainly something we want to add but it's not going to happen until the world gen rewrite for 1.13

FoxSamu commented 5 years ago

Weird. If the betweenlands has custom world storage methods, it could just look for the closest entry, right? It would only be a small injection... And for unexplored structures, just use a specific seed formula ( seed = x 8377266... ^ z 394738... ) to calculate a seed for that chunk, and use that for determining if a structure can generate there. A chunk generator could then determine close chunks that turn out to have a structure (according to that seed formula).

TheCyberBrick commented 5 years ago

Like I said, the way the structures are implemented right now it doesn't work. I didn't say it's not possible in general. The structures do some tests whether there's enough space to generate etc. so it depends on the surroundings, i.e. a chunk seed doesn't help.

TheCyberBrick commented 5 years ago

A good way to achieve more consistent structure gen and a way to be able to locate them before generation is probably to use small sub biomes. That's what I've used for the new spirit tree structure and it works great there. This way gives us much more control on a large scale/long distances and makes it possible to adapt the terrain according to the structure (e.g. flat terrain for the fortress without ruins/trees in the way, or a large enough island for the cragrock tower). I don't plan on doing this before 1.13 though.

If the betweenlands has custom world storage methods, it could just look for the closest entry, right?

Not necessarily. Our structures aren't saved in the global world data that is always loaded in memory. They're saved to seperate files and the chunks store references to those files, so to locate structures it'd have to scan over a lot of chunks.

FoxSamu commented 5 years ago

It's right that structures check for space. But vanilla structures also do that, and there is a chance not to find a structure at the position that the locate command told (strongholds do especially). The locate command does not neccesarily find a structure: it guesses an approximate location where there is possibly a structure. 1.13 has nothing changed on this because it's just impossible to check if a structure has enough space while the region is not jet generated...

FoxSamu commented 5 years ago

Vanilla just iterates the chunks for locating (MapGenStructure), so BL can do that too (and then look at the references to those storage files). But no matter if that has to wait for 1.13. : )

TheCyberBrick commented 5 years ago

It's right that structures check for space. But vanilla structures also do that, and there is a chance not to find a structure at the position that the locate command told (strongholds do especially). The locate command does not neccesarily find a structure: it guesses an approximate location where there is possibly a structure. 1.13 has nothing changed on this because it's just impossible to check if a structure has enough space while the region is not jet generated...

That's why I intend to change the structures to not depend on the surroundings and instead adapt the surroundings to the structure. Then you can know for sure whether a structure has generated or not which would be necessary for this: https://github.com/Angry-Pixel/The-Betweenlands/issues/744

Vanilla just iterates the chunks for locating (MapGenStructure), so BL can do that too (and then look at the references to those storage files). But no matter if that has to wait for 1.13. : )

No. We'd have to load the chunks. The reference is stored in the chunk file :P

FoxSamu commented 5 years ago

No. We'd have to load the chunks. The reference is stored in the chunk file :P

Lol: forgot about that... But the random seed formula only needs coordinates. And as I said: you can't be completely sure if a structure can generate without knowing the terrain (or you might get strange generation artifacts :P).

TheCyberBrick commented 5 years ago

If the terrain is generated in such a way that the structure can always generate at a specific position then the structure doesn't need to do any checks (except whether it's at the correct position, e.g. in the center of a specific sub biome). That's how the spirit tree generates.

FoxSamu commented 5 years ago

Such that the terrain generator knows about the structure? But anyway, I don't care... I guess we are a little bit getting off topic now. I'm just trying to help solving issues in software I like. :P