View Full Version : Noisy caves

11-16-2013, 07:42 PM
We're used to thresholding 2D noise to get continent outlines, when we say that everything below a certain value in the height field is water, and everything above it is land.

It just occurred to me that we might get some decent caves if we also threshold at the top, so that everything between two threshold values is cave, and everything outside them is rock, as this would turn the "blobs" you get in the former method into something more like irregular contour bands.

You can do this in Gimp by loading a height field, navigating to Colors -> Threshold, and positioning the two sliders somewhere in the middle of the histogram.

For my tests, I wrote a program that would generate some random fractal noise, find the peak of the gray-level histogram, and threshold the image at plus or minus a "diggyness" value about the peak. For example, if the peak of the histogram is at 110, and diggyness is 25, then gray values from 85 to 135 will be cave, and values outside that range will be rock. Increasing diggyness increases the amount of open space; varying the type and parameters of the fractal noise varies the overall character of the cave system (rough, smooth, squiggly, straight, big rooms, small rooms, etc.).

Here's an example of a cave system made with "hybrid multifractal" noise, parameters H = 0.2, lacunarity = 2, octaves = 6, offset = 0.5, gain = 4, and diggyness of 50, and another with "heterogeneous terrain" noise of the same parameters (except gain, which doesn't apply).

11-19-2013, 04:19 AM
I still love that old-school D&D look...

11-19-2013, 05:00 AM
A few more.

11-20-2013, 01:47 AM
I agree, the Old School Blue look certainly has its appeal. Looking good.