SubTerra - PCG Cave Generator

Most procedural cave generators on Fab are built as standalone actors. They generate a cave, but they don’t integrate naturally with Unreal Engine’s PCG workflow.

SubTerra takes a different approach, Instead of building everything around a single actor, the entire generation pipeline is exposed as modular PCG nodes.

You can use the complete cave generator, or combine individual nodes with the rest of your existing PCG graph to build your own procedural workflows, the result is a cave generator that feels like a natural extension of Unreal Engine rather than a separate tool.

The plugin also focuses on producing caves that are practical for gameplay, not just visually interesting, every generated layout is fully connected, supports multiple elevation levels through walkable ramps, and produces organic rock formations instead of smooth metaball-style tunnels.

Once the cave is generated, its surface is automatically classified into FloorWall, and Ceiling PCG points, making it easy to populate the environment with your own assets using Unreal’s existing PCG tools.

How it Works

It's built entirely on UE5's PCG framework, so it slots into your existing PCG setup instead of being a separate black-box actor. From a single seed it scatters a bunch of rooms and connects them with tunnels using a spanning tree + a few extra loops so the layout's always fully traversable but different every seed.

That whole thing gets written into a signed distance field (basically a 3D voxel volume), I roughen the walls with fractal noise so it reads like actual rock instead of smooth metaball blobs, then run marching cubes over it to get a watertight, collidable mesh. The heavy part runs on worker threads so the editor doesn't hitch.

Using it, you've got two routes:

  • Easy mode: drop one actor in your level and a full cave shows up. Then you just tweak sliders in the details panel — room count, room size, tunnel width, levels, noise, stalactites — and it regenerates live in the editor (no play mode). There's a regenerate hotkey for rolling whole new layouts too.
  • Full control: wire the PCG nodes yourself in a graph. It outputs Floor/Wall/Ceiling surface points you can pipe straight into Epic's mesh spawner (or any scatter plugin) to decorate the walls.

Documentation and Fab Links in comments

u/Alvens_Dev — 5 days ago

Sub-Terra PCG Cave Labyrinth Generator

Hi everyone,

Most cave generators on the marketplace are standalone actor-based systems that don't easily fit into existing procedural pipelines. To solve this, I spent the last few months building SubTerra—a C++ plugin built entirely around UE5's PCG framework and Signed Distance Fields (SDF).

Instead of using legacy ProceduralMeshComponent or blocky metaballs, it utilizes a custom-written Marching Cubes mesher and fBm (fractional Brownian motion) noise to generate organic, believable rock walls at runtime or in the editor.

What makes it different:

  • PCG-Native: It uses composable PCG nodes that slot directly into your existing procedural graphs.
  • Walkable Ramps: It generates multi-level caverns with switchback, slope-limited ramps that characters can actually walk up.
  • Seamless Tiling: You can divide large worlds into tiles with identical seam voxels to avoid visible cracks or performance drops.
  • PCG Scatter Output: It automatically categorizes and aligns points for Floor, Wall, and Ceiling, making it easy to drop in static mesh decorators (like stalactites or rocks) using Epic's spawner.

Performance:
Tested on a modest 6-core Intel i5-8400:

  • An entire connected labyrinth regenerates its logic in ~19ms.
  • Mesh extraction runs asynchronously on worker threads, keeping the editor framerate stable during bakes.

It includes full C++ source code, 11 custom PCG nodes, a drop-in demo actor, and 59 automated test cases.

I would love to hear your thoughts on the workflow or any features you think are missing. Let me know if you have any questions!

I will put the links to the documentation and the Fab listing in the comments below!

u/Alvens_Dev — 10 days ago