I want to make procedural terrain generation like the game Eclipsis. The Big islands in the middle and the small islands around it. I also want the well pumps and the spires (towers).
Every island needs atleast one Support and well pump. While the small islands with one well pump.
What i have tried
I’ve tried using Perlin noise and only spawn stuff when the noise is higher than a certain number. It didn’t get the shape i wanted and it is cut-off at the edges
print("terrain")
math.randomseed(os.time())
local seed = math.random(1000)
local size = 100
local divide = 10
local scale = 10
local function createTerrain(x, height, z)
for y = 0, -height, -1 do
local p = Instance.new("Part")
p.Size = Vector3.new(scale, scale, scale)
p.Anchored = true
p.Position = Vector3.new(x, y * scale, z)
p.Parent = workspace
end
end
for x = 1, size do
wait()
for z = 1, size do
local nX = x / divide
local nZ = z / divide
local noise2 = math.floor(math.noise(seed, nX, nZ) * 10)
if noise2 >= 2 then
createTerrain(x * scale, noise2, z * scale)
end
end
end
Note: i’m not expecting full script answers, only ideas on how to do it
I’ve spent some days learning about perlin noise in the past, and I had the same problems, the generator was doing it well but the edges cut off. I wasn’t able to fix it, but I saw someone speaking about a way of fixing them, maybe it could help you.
Basically, he said that you could add a density value to restrict the y, x and z axis by mixing the different axis and some noise values… I would try to find the comment.
I made this based off of the eclipsis map. It uses a single perlin noise layer for both deciding whether there should be a block or not and deciding if the top block on a specific coordinate block should be normal/hollow/well pump.
The portion that creates the block also creates 3 blocks (the amount of layers) under it instead of just 1, with each block’s type (normal/hollow/well pump) being decided based on the type of the block on top of it.
That way, I can have custom logic for each block type. For example, if a top block at a specific coordinate is selected to be a well pump, it will automatically make the blocks under it a well pump as well. If the top block is a normal block, there’s a chance for the lower ones to be a hollow block. If all of them get selected to be a normal block, instead of creating three blocks of the same type, it creates 1 block the size of all 3 blocks.