Cave Demo
This was my first attempt at a procedurally generated 3d cave system.
It uses two heightfields for the ceiling and floor and the geometry divided into cells. The generation algorithm creates a line that the tunnel will follow which uses a 'wander' steering behaviour for the smooth randomness. The walls are then set at a pseudo random distance from this line.
The path also has a branching factor, and occasionally creates larger caverns.
The main problems it encounters are to do with the fact there can only be one ceiling or floor, so when path cross at different heights you end up with a chasm effect. It can create some interesting rock formations where there are a few paths in proximity.