Hello there!
I recently got interested in the topic of Perlin noise and terrain generation so after a bit of research I messed around in studio and made a script that generates random terrain
After narrowing down how I wanted my terrain to look, I was confronted with the fact that the terrain is infact not smooth and bumpy, it looks ok with grass but without it…
Ive seen on devfourm a few posts showing other people finding solutions to this such as increasing part size (which i tried), and switching to other methods besides FillBlock (which im using) such as FillCircle (also tried) and WriteVoxels
Im asking for help because I am completely new to terrain, literally first time ever using it, so attempting to look at other solutions was difficult or confusing for me.
Here is the script im using
local TerrainSizeX = 500 -- length
local TerrainSizeZ = 1000 -- width
local resolution = 6000 -- how zoomed in or smooth it looks
local frequency = 8 -- how often it makes something cool (1 is less 10 is more)
local amplitude = 150 -- how high / how steep
local seed = math.random(-100000000,100000000)
seed = 100000000
workspace.Terrain:Clear()
task.wait(1)
local function getHeight(x,z)
local noiseHeight = math.noise((x+seed)/resolution*frequency,(z+seed)/resolution*frequency)
noiseHeight = math.clamp(noiseHeight,-0.2,0.35) +0.2
return noiseHeight
end
local function genTerrain(pos)
--workspace.Terrain:FillBlock(CFrame.new(pos),Vector3.new(1,1,1),Enum.Material.Ground)
workspace.Terrain:FillBall(pos,2,Enum.Material.Ground)
end
local function genPart(pos)
local part = Instance.new("Part")
part.Size = Vector3.new(1,1,1)
part.Anchored = true
part.Position = pos
part.Parent = workspace.Folder
end
for x = -TerrainSizeZ/2, TerrainSizeZ/2 do
task.spawn(function()
for z = 0, TerrainSizeZ do
local height = getHeight(x*4,z*4)
local pos = Vector3.new(x*4,height*amplitude,z*4)
genTerrain(pos)
--genPart(pos)
task.wait()
end
end)
--break
end
Any help would be greatly appreciated, for reference I’m trying to make the terrain smooth like this