How to make caves in my terrain

How do I…

Make caves generate randomly in my procedurally generated world (like minecraft, but in 2d from the side).

What is the expected result

i tried using the generate dungeon extension. It should let me generate caves, right?

What is the actual result

Well… Sort of. It lets you make on at the origin, which is not what i wand, because everything is random, and i want to have more than one.


Have you considered creating the cave on a separate layer, and then “moving” it to the position and layer you want?

Hmm, it did cross my mind, but now that i think about it, how exactly would i move that mass of temporary objects uniformly to a specific spot?

Consider using noise map Implementing Procedural Generation - GDevelop documentation
It can be easily modified to generate caves after following the steps

Select all the objects on the layer, then as a subevent repeat over each object and move them. Do it in that order, to reduce the number of objects iterated over.