I want to create a baseplate using Perlin noise and parts and I’m wondering how I can do that because there are not that many tutorials out there for Roblox Perlin noise.
I have used perlin noise before for something similiar. I can go in studio in some of those old projects and grab some code if you have more questions, but here are some discussions I found on the forums that should help you out:
I want to make it a hilly terrain I found something like it ages ago that was what I wanted it came with a city and forest thing by roblox staff or something
You may want to play around with perlin noise and look more into it. Also, I recommend making multiple octaves of noise and layering them on top of each other as I personally think it looks better. I have not touched it in a few years but I just made something real quick that works. “Amp” is the variable that is the multiplier of the height that you get. Size_x and z are the amount of blocks in the x and z direction that are to be generated. You can also play around with what numbers they are divided by as well if you want. This also makes blocks on top of each other, which is not all that efficient but I did it just for demonstration. Here is the code and some screenshots:
math.randomseed(os.time())
local block = game:GetService("ServerStorage"):WaitForChild("Block")
local size_x = 64
local size_z = 64
local seed = math.random(1, 10^8)
local amp = 56
local function draw(x, y, z)
local new = block:Clone()
new.CFrame = CFrame.new(x, y, z)
new.Parent = workspace
end
for x = 0, size_x*block.Size.X, block.Size.X do
wait()
for z = 0, size_z*block.Size.Z, block.Size.Z do
draw(x, 0, z)
local height = math.noise(x/280.5, z/292.7, seed)*amp
height = math.floor(height)
for i = 0, height*block.Size.Y, block.Size.Y do
draw(x, i, z)
end
end
end
local PositionX, PositionY, PositionZ = 100, 10, 100
local NoiseScale = 50
local Amplitude = 25
math.randomseed(tick())
local MathRandom = math.random()
local Size = 5
for Number = 1, PositionX do
for Number2 = 1, PositionY do
for Number3 = 1, PositionZ do
local MathNoiseX = math.noise(Number2 / NoiseScale, Number3 / NoiseScale, MathRandom) * Amplitude
local MathNoiseY = math.noise(Number / NoiseScale, Number3 / NoiseScale, MathRandom) * Amplitude
local MathNoiseZ = math.noise(Number / NoiseScale, Number2 / NoiseScale, MathRandom) * Amplitude
local Density = MathNoiseX + MathNoiseY + MathNoiseZ
if Density < 20 and Density > 15 then
local Part = Instance.new("Part")
Part.Position = Vector3.new(Number * Size, Number2 * Size, Number3 * Size)
Part.Anchored = true
Part.Parent = workspace
end
end
end
end