# Random Cave Generation

• 12-04-2008, 11:26 PM
RobA
Random Cave Generation
Inspired by isomage's efforts at random cave generation I did a bit of research on random walks and came across this description on simulating bacteria using random walks with a gradient bias.

I turned to my trusty swiss army knife, processing and cobbled together a random walk with gradient bias engine....then started building gradients to make gave maps.

My first experiment was just to verify the algorithm would follow random walk along the gradient from light to dark.

Attachment 8192

and the walk:
Attachment 8193

Then I came up with this perlin noise with a left to right bias map:
Attachment 8194

which created this "cave" structure
Attachment 8195

and here is a comparison showing the lineup:
Attachment 8196

I think there could be some promise in this...

-Rob A>
• 12-05-2008, 03:02 AM
isomage
That does look promising. My maps are made by random walks -- three traces of two-dimensional fractional Brownian motion with different fractal dimensions and independent random skew. Your Perlin map looks like it could have been done with my generator; probably the gradient is providing skew, and the Perlin noise is effectively being summed over successive steps to produce Brownian motion -- the same general effect, but from a much more accessible procedure :)

Try compositing multiple walks with different gradients (direction and magnitude) and different noise fields, and you'll probably get results equivalent to mine.

Nicely done!
• 12-05-2008, 07:33 AM
Steel General
Cool stuff guys, even if I only understand a small portion of it. :)
• 12-06-2008, 07:57 AM
Sagenlicht
Perlin Noise
Hmm RobA, could you post your script? I downloaded processing and would like to see an example. Would make starting easier :) Processing really looks promising.
• 12-06-2008, 03:06 PM
RobA
The script is for the random walk, not the perlin noise generation :(

I have been building noise gradients in gimp and importing them....

I think there is a better way to do this, I think I'll create a gradient array from the image and switch the whole random walk to vector math...

-Rob A>