- Home /
How to mix different amplitudes and frequencies when procedurally generating terrain? (Perlin Noise)
I recently took up a personal project to make a game similar to CubeWorld (For those of you who know what that is). I am a complete beginner, and as such I understand that I will not be able to make terrain as good as Cubeworld or Minecraft. I'm making this project on Unity3D and have had success until I hit this brick wall. I implemented a mix of Perlin 2d and 3d by generating a turbulence value from Perlin 3d and feeding that into the 2d Noise. This works well for me but it creates very uniform terrain with the entire world having similar amplitude and frequency. I tried fixing this by randomizing the amplitude and frequency, again with Perlin Noise. This seems to have done absolutely nothing. I can create nice looking terrain, for my standards, with low amplitude and with high amplitude respectively. However, I am having trouble mixing the two together to have some parts of the world low rolling hills and others fairly mountainous. Looking at the image below, from CubeWorld, you can see a nice looking structure to the left, rolling hills in the middle, and a beautiful mountainous region to the right. I can achieve all of these individually but am unable to mix them and have them all take place in the same world. If any of you could guide me with tips, pointers, tutorials you can send me a link to, or pseudocode that would really help me. Take note I am still a beginner to procedural terrain generation so don't use any fancy words.
P.S. Other than this I have found a separate issue. Every time I load the game the terrain looks exactly the same. If anybody could help me with "seeding" the terrain where I could have the player input a seed and generate the world somehow based on that I would really appreciate it.
Also P.S. I use CubeWorld a lot as an example of terrain that I am aiming for, but you don't need to know what that is. I just use it as an example. All good games with procedural voxel generation achieve this and it is somehow eluding me.
My Get3DNoise() and Get2DNoise() functions look like this:
return (Perlin.Noise((x) / frequency, (y) / frequency, (z) / frequency)) * (amplitude);
return (Perlin.Noise((x) / frequency, (z) / frequency)) * (amplitude);
The library I use for Perlin noise can be found here: https://github.com/keijiro/PerlinNoise