TerraformersMC / Cinderscapes

An expansion of Minecraft's Nether biomes!
GNU Lesser General Public License v3.0
41 stars 21 forks source link

Twilight Vines sometimes don't connect to the ceiling at both ends #70

Open saltyseadoggo opened 3 years ago

saltyseadoggo commented 3 years ago

Expected Behaviour All Twilight Vines would connect to the Nether ceiling at both ends, as most of them do. Actual Behaviour Some Twilight Vines only connect to the Nether ceiling at one end. Steps to Reproduce

ghost commented 3 years ago

Unfortunately this is actually a limitation of how vanilla chunks generate, there's nothing we can do about it :/. You'll notice it only ever occurs in one direction because of the order in which adjacent chunks generate.

saltyseadoggo commented 3 years ago

Hm, interesting. I take it they're some kind of world generation feature? Would it be perhaps possible to generate them as structures, similar to, say, dungeons to prevent this issue? Just tossing ideas out.

ghost commented 3 years ago

I mean maybe....? Idk @SuperCoder7979 What do you think of that. It sounds like it might be a little intensive to switch to structures for something so common.

Angular-Angel commented 3 years ago

I mean, trees and caves are structures, right? So, it shouldn't be too much of a problem to make vines structures too. :/

saltyseadoggo commented 3 years ago

Would it be possible to have the twilight vine generator generate structure blocks which place the vines from a number of structure files to allow them to always connect up?

gniftygnome commented 1 year ago

I spent some time on this recently and while it's still fresh in my mind I would like to make a few comments about it.

First off is the unfortunate bit; Mojang at some point reduced the distance allowed for feature block placement, which made this bug worse.

To ameliorate the problem in the 1.18.2 and 1.19 releases, I have restricted the vine length to be short enough not to trigger the bug (by checking whether the vine would enter a far chunk, which is the most permissive effective check possible). This means you will never see really long vines (but that is not a big change; most were simply cut off previously). However, I also added diagonal vines, which allows vines to grow sqrt(2) times as long safely. Overall I think it looks pretty good.

Regarding structure generation, there are some big problems with the approach. Each chunk in a structure has to be able to generate without reference to generation in the other chunks, and in any order. It would be necessary to get the structure bounding box and then map out the entire 3D space to decide the locations of all the vines AND then serialize the vine locations to some NBT-friendly data structure, a process with serious potential performance implications and added complexity. Suggestions to use the jigsaw system ignore the fact the vine has an overall shape which the jigsaw system is entirely incapable of replicating (an absolutely massive amount of situation-specific pieces would be required).

In fact the Minecraft system most compatible with generating large multi-chunk curving vines is probably the carver system. It might be possible (probably via a number of mixins though) to create a carver which carves vine-shaped, vine-filled "voids" out of the air in the caves. I am not certain it would be worth the effort, however.

I will leave this issue open for the time being, in case something changes in Minecraft generation which makes longer vines feasible.