1
\$\begingroup\$

Currently I'm making a voxel survival game. About a month ago I embarked on procedurally generating terrain using Perlin noise. I understand how to use and apply it for the most part. However I do not understand how to vary terrain structure. Let me say that in a way you probably can understand because "me no grammar good".

By changing frequency and amplitude I know I can change the resulting terrain, varying it from rolling hills to jagged peaks. However the end result will always be the same: either never ending hills or never ending mountains. I don't understand really how I would mix those two "terrain structures" together to get area's of hills and area's of mountains.

\$\endgroup\$
2

2 Answers 2

0
\$\begingroup\$

My suggestion would be to modify the Perlin noise parameters based either on formulae, interpolation from known points, or a (much simpler) map texture. For example, you could modify the amount you scale each octave, and/or the amount you distort the pseudo-random function.

As an example of each of the three approaches:

  1. Apply a simple function: Increase the amplitude of the higher frequencies and/or the Perlin noise function as a whole by the x co-ordinate to have smooth hills going to mountains.
  2. Interpolation: Choose known points that should have certain properties, e.g. hilly/smooth/low/hi, set parameters appropriately at those points, then interpolate the parameters between them using some sort of distance function from the nearest neighbours or a spline.
  3. Map: Set the exact parameters to use for every point on the map, and then generate. Easier than it sounds, this "map" would likely have simple blocks of colour or smooth gradients that even a developer can draw. Still allows variation by changing the pseudo-random seed for the Perlin noise.
\$\endgroup\$
0
\$\begingroup\$

The way I(And I believe many others) do it is to have not only one noise generator, but multiple ones, configured differently, and then interpolate between them based on some value(perhaps chunk type, perhaps just another noise function). Also generating a specific terrain type is more feasible by combining multiple noises too.

The website of libnoise has some nice information about all this, and also about the various noise generation and mixing techniques.

Some basic generators are:

  • Perlin
  • Simplex
  • Ridged Multi
  • Constant
  • Gabor Noise (less common)
  • Voronoi (less common)

Some manipulators:

  • Add
  • Multiply
  • Scale

Some interpolators/selectors:

  • Select( if control > 0.5 A else B )
  • Blend ( blend A with B based on control )
\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged .