Simple math.noise world generation [Updated]

Math.noise is easy way to make world generation, draws curved lines and repeats by map size and coordinates like this:

Let’s start:
Make script in Workspace

math.noise(x, y, z)

Ok we have XYZ coordinates, now we need Seed number.

local seed = math.random(1,999999) --Random seed that helps draw of Curved Lines.
math.noise(x, y, seed)

Now we have Seed number, but we need size of map and XY coordinates, map size.

local seed = math.random(1,999999) --Random seed that helps draw of Curved Lines.
local map_size = 50 --Repeats Curve Lines by XY coords.
for x = 0, map_size do
	for y = 0, map_size do
		local h = math.noise(x, y, seed)
	end
end

Good, now we need Height, and terrain Smooth.

local smooth = 50 --How smooth will be Curved Lines.
local seed = math.random(1,999999) --Random seed that helps draw of Curved Lines.
local height = 50 --Max height of Curved Lines.
local map_size = 50 --Repeats Curve Lines by XY coords.
for x = 0, map_size do
	for y = 0, map_size do
		local h = math.noise(x / smooth, y / smooth, seed) * height
	end
end

And to finish this world generation we will make terrain parts and part size.

local size = 2 --Size of part.
local smooth = 50 --How smooth will be Curved Lines.
local seed = math.random(1,999999) --Random seed that helps draw of Curved Lines.
local height = 50 --Max height of Curved Lines.
local map_size = 50 --Repeats Curve Lines by XY coords.
for x = 0, map_size do
	for y = 0, map_size do
		local h = math.noise(x / smooth, y / smooth, seed) * height
		local p = Instance.new("Part")
		p.Position = Vector3.new(x * size, h, y * size)
		p.Anchored = true
		p.Size = Vector3.new(size, size, size)
		p.Parent = game.Workspace
	end
end

And start the place, WOW we made it:

8 Likes

Can you explain a bit more and tell where to put the script? It will be very confusing for new devs trying to learn world generation. Thanks!

1 Like

Can you actually explain what each code does so that beginner devs can understand it more? This feels more a resource than a tutorial.

If i’m correct, because it is relating to map, it should so in ServerScriptService. If it was local everyone would have a different map.

1 Like

I think script can be located in Workspace and ServerScriptService.

1 Like

Cant it be in workspace too?
Although can be in SSS (serverscriptservice)

1 Like

This is so cool, I attempted this and the results were amazing. Reminds me of the old Roblox Terrain.
Here’s a YouTube how-to link for anyone who does not know what I am talking about.

1 Like

Yes, the script can be located in Workspace or ServerScriptService, and Workspace is not local, it is a server like ServerScriptService, so you can create a script in Workspace or ServerScriptService.