I’m just starting to get my head around Perlin Noise and how it works. Now that I have created the function, how could i use that to create a height map? And even if i figure that out, how does one make the blocks in positions according to that height map?
Or am I completely seeing this wrong? Is perlin noise used to generate the height map, and then the height map is used to generate the terrain, or is the terrain generated straight from the values given my the perlin noise function?
(Yes I want something Minecraft related, I know people have asked before but I haven’t found an answer to these specific questions. Any help would be greatly appreciated! )
You want an example for a Minecraft like terrain generator? Just take a look at the Minecraft starter package for Unity. It contains all you need.
main way perlin noise implemented is to generate SAME noises on different targets. for example, to cover some surface without using a texture and be sure that this surface will look same on every generating and on every client it generates.
so in your case you can use simple UnityEngine.Random to got all randomization you need. heightmap, box placing, painting etc - just write algorithms to apply random to your world
Your boxes will have x and y coordinates. Since most perlin noise functions take 1 parameter, use some hash function that takes your x and y values and then pass the hash to the perlin noise function. This will give you a height. Unfortunately, the heightmap isn’t going to be very smooth, so you should do some interpolation and smoothing of the nearby values. This article explains that process fairly well (see the paragraph “2-dimensional Smooth Noise”).
^^ those are tests i just did on the unity perlin function. image and distribution data. see end of thread.