Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How Could I Make Voxel Cave Generation?

Asked by 2 years ago

What I need: I only need a way to generate a block 1000 blocks deep with random caves in it.

What I have tried:

local RANGE = 100
local ROWS = 100
local COLUMNS = 100
local function createPart(x,y,alpha)
    local part = Instance.new('Part')
    part.Size = Vector3.new(4,4,4)
    part.Position = Vector3.new(x*4,alpha*RANGE,y*4)
    part.Parent = workspace.Rocks
    part.Anchored = true
end
for y = 1,COLUMNS do
    for x = 1,ROWS do
        local noise = math.noise(x/ROWS,y/COLUMNS,0)
        createPart(x,y,noise)
    end
end

I understand and am able to make a simple terrain with that, but not a cave. Answers would be appreciated! How could I do this?

0
Hi bro, to be able to do this, you have to learn something called Perlin Noise, which is very advanced and I don't recommend for beginners, but you can try if you want guest_20I8 266 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

Alright I figured this out myself with perlin noise to generate random holes in a 3d square! Question closed.

Ad

Answer this question