1.16.5 Random Cave Generation From Predefined Graph

Discussion in 'Spigot Plugin Development' started by Goatii, Jun 12, 2021.

  1. Hi there,

    I want to generate a cave system from a set of pre-defined vertices and edges.

    [​IMG]

    I can easily generate this graph randomly but then want to place it into Minecraft as a cave system, which I am currently struggling with, as I want it to look realistic and not just generate a bunch of ellipsoids at each vertex and connect them with a 3x3 straight tunnel.

    I would like to end up with a list of all blocks in the specified area, grouped by their y coordinate, so that I can then use that in the future if I decide to place things inside my cave, like lanterns etc.

    Ideally, while creating this list, I would go through every block in the region and mark it as either outside-cave, inside-cave or cave-border, with the blocks being either outside or inside the cave and the border of the cave respectivly. This would allow me to only place the cave border blocks, cutting down on lag.

    I've looked into perlin noise and worrms but don't fully understand it - I'd definetly be willing to learn if that was the best way to go about it, but as I don't quite know I don't want to start learning and find out it's not what I should have been doing down the line.

    Thanks