Hi there,
I’m not the best at using perlin noise, mathematically wise. However, how would you make caves off a basic perlin-noise terrain?
Here’s a “test-code”, that I’ll make it better in the future, and turn it into a triangle map.
local p = workspace:WaitForChild('Part');
p.Anchored = true;
local folder = Instance.new'Folder';
folder.Parent = workspace;
folder.Name = 'Parts';
local f = 67
local coeff = 450;
function calc(x,z,o)
local height = 0;
local r = math.random(8,8*2);
for i = 1, r do
height = height + math.noise(x/(coeff/i)+o,z/(coeff/i)+o);
end
height = height/r;
return height;
end
for i = 1, 450 do
for j = 1, 450 do
local new = p:Clone();
new.Parent = folder;
new.Position = Vector3.new(i*new.Size.x, 0+coeff*calc(i,j,f), j*new.Size.z);
end
end
game.Debris:AddItem(p,0);