I want to make terrain generation like in minecraft with places where there is flat surface and places where there are mountains. However while i was using perlin noise and looked at all roblox terrain generation examples i noticed that you can only make it either have tons of mountains or just a flat surface. I looked up on google and it said that i need to use multiple octaves but i dont know how to do that in roblox. Anyone knows how to do it?
This is a very complex system. To perform this, you would have to have algorythms that change the frequency of the generation system. Here's an example from the wiki:
local seed = math.random() local width = 200 local length = 200 local amplitude = 20 local frequency = 25 for x = -width/2,width/2 do for z = -length/2,length/2 do local y = (math.noise(seed,x/frequency,z/frequency) * (amplitude/2)) + (amplitude/2) workspace.Terrain:FillBlock(CFrame.new(x*4,y*2,z*4),Vector3.new(4,y*4,4),Enum.Material.Grass) end end
Now, to make the different frequencies, we can do this:
amplitude = amplitude + math.random(-1.0,1.0) frequency = frequency + math.random(-1.0,1.0)
And that makes:
local seed = math.random() local width = 200 local length = 200 local amplitude = 20 local frequency = 25 for x = -width/2,width/2 do for z = -length/2,length/2 do local y = (math.noise(seed,x/frequency,z/frequency) * (amplitude/2)) + (amplitude/2) amplitude = amplitude + math.random(-1.0,1.0) frequency = frequency + math.random(-1.0,1.0) workspace.Terrain:FillBlock(CFrame.new(x*4,y*2,z*4),Vector3.new(4,y*4,4),Enum.Material.Grass) end end
Hope this helps!
Closed as Not Constructive by titaneagle, xPolarium, green271, zblox164, and User#21908
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?