Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How Could I Make Voxel Cave Generation?

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?

1 comment

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

1 answer

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

This discussion is preserved as it was. New answers, comments, and votes are closed.