local module = require(script.Parent.PerlinNoise)
for x = -64/2, 64/2 do
wait()
for y = -64/2, 64/2 do
for z = -64/2, 64/2 do
local noise = module.new({x, y, z, 4}, 15, 3, 0.5)
if noise > .15 then
local g = Instance.new("Part")
g.Parent = workspace
g.Size = Vector3.new(1, 1, 1)
g.Position = Vector3.new(x, y, z)
g.Anchored = true
end
end
end
end
From what I remember, generating a 2D heightmap (for the Y-axis), then two more heightmaps which indicate how far points on the original generation should move (on both X and Z) and create a new part there. The last two heightmaps should be setup to only move a small amount, so as not to create floating blobs. Even with this small amount of variation, it should make a difference in the end product.
If someone could simplify this, that would be nice.
also please include a tag so if tyridge doesn’t reply I won’t miss out. e.g. perlin
local module = require(script.Parent.PerlinNoise)
for x = -64/2, 64/2 do
wait()
for y = -64/2, 64/2 do
for z = -64/2, 64/2 do
local noise = (module.new({x, y, z, 4}, 15, 3, 0.5)) - (y/(64*2))
if noise > .15 then
local g = game:GetService("ServerStorage").Block:Clone()
g.Parent = workspace
g.Size = Vector3.new(1, 1, 1)
g.Position = Vector3.new(x, y, z)
g.Anchored = true
end
end
end
end
See how there’s extra terrain poking out that doesn’t occur in perlin noise? That’s just the same 2D heightmap, but with another heightmap used on it. The outcome of the second heightmap, instead of telling it the height of that terrain, tells it to create a new voxel of terrain that is positioned at (position on original heightmap) + (heightmap two gives X axis offset) + (heightmap three gives Z axis offset)
I got the idea from this video, which explained the same concept in 2D world generation. Jump to about 6:20.
I really like this! Would be cool to try to write procedural terrain generator with Roblox terrain using this.
Could end up looking pretty good.
I remember something like that from KonekoKitten’s channel when he showed someone ported the entire code of Minecraft to Roblox, perlin noise included. Sadly after the video the game was put under review because of copyright infringement.
i know this is a dumb question but how can i calculate the grass position and the grass should be like the positon like in minecraft in order to make grass but only like 70 grasses each grass biome