I will try to explain how I made my first map using Perlin Noise.
(I am not a professional at this)
Making the map:
local Part = Instance.new("Part") --For cloning
Part.Anchored = true
Part.FormFactor = "Custom"
Part.Size = Vector3.new(4,4,4)
Part.TopSurface = "Smooth"
local seed = math.random(1, 10e6)
local frequency = 3
local power = 4
local resolution = 100
for x = 1, resolution do
for z = 1, resolution do
local y1 = math.noise(
(x*frequency)/resolution,
(z*frequency)/resolution,
seed
)
local y2 = math.noise(
(x*frequency*.125)/resolution,
(z*frequency*.125)/resolution,
seed
)
local y3 = math.noise(
(x*frequency*4)/resolution,
(z*frequency*4)/resolution,
seed
)
local y = (y1*y2*power*power)+y3
local Part = Part:Clone()
Part.Parent = game.Workspace.Map
Part.CFrame = CFrame.new(x,y,z)
--[[if math.abs(y2) < .1 then
Part.BrickColor = BrickColor.Green()
elseif math.abs(y2) > .25 then
Part.BrickColor = BrickColor.Red()
else
Part.BrickColor = BrickColor.Blue()
end]]
end
end
This code makes a basic map.
local Part = Instance.new("Part") --For cloning
Part.Anchored = true
Part.FormFactor = "Custom"
Part.Size = Vector3.new(4,4,4)
Part.TopSurface = "Smooth"
This is the part of the code that creates a part.
local seed = math.random(1, 10e6)
local frequency = 3
local power = 4
local resolution = 100
This part is important, the values make the map. Try changing the values. Changing the values will help you understand what those Values do.
the Seed: The seed is kinda the name of the map. If you change the seed you will get a different map.
the Frequency: The frequency, you should keep the frequency low to get smoother terrain.
the Power: if you want higher Terrain you should make the Power a high number but if you want smoother terrain you should keep it low.
the Resolution the Resolution is basically the size of the map. The bigger the number the bigger the map will be (Idk if that sentence made sense) (if you make the resolution bigger the map gets bigger).
for x = 1, resolution do
for z = 1, resolution do
local y1 = math.noise(
(x*frequency)/resolution,
(z*frequency)/resolution,
seed
)
local y2 = math.noise(
(x*frequency*.125)/resolution,
(z*frequency*.125)/resolution,
seed
)
local y3 = math.noise(
(x*frequency*4)/resolution,
(z*frequency*4)/resolution,
seed
)
local y = (y1*y2*power*power)+y3
local Part = Part:Clone()
Part.Parent = game.Workspace.Map
Part.CFrame = CFrame.new(x,y,z)
--[[if math.abs(y2) < .1 then
Part.BrickColor = BrickColor.Green()
elseif math.abs(y2) > .25 then
Part.BrickColor = BrickColor.Red()
else
Part.BrickColor = BrickColor.Blue()
end]]
end
end
This is the part that makes the map. You should change the
for x = 1, resolution do for z = 1, resolution do
to get the map you want.
just experiment with the numbers until you get the map style you like. I will edit this post or I will make other posts to show you guys how you can add trees, water to your map if you know some stuff about Perlin Noise please reply to this post so that other people can learn too.
Edit:
How to add water?
Many people use a code to add water to their maps but I used the terrain editor.
I used the Sea Level to add water.
I suggest you keep your sea level below 1 or 0. But if you want water to be high make the sea level higher. Using sea level is easier than coding it.