How to fix blocky terrain

thes script is used for makeing a spherical planet with perlin noise but when i use it the terrain is blocky is there a way i can finx this? this is the script

local RunService = game:GetService("RunService")
local CollectionService = game:GetService("CollectionService")

--// Settings
local diameter = 5000
local radius = diameter * 0.5
local centerHeight = 0
local blockSize = Vector3.new(5, 5, 2.5)
local material = Enum.Material.Ground
local blocksPerBatch = 10000

--// Noise settings
local noiseScale = 1.0
local noiseAmplitude = 200
local octaves = 6
local persistence = 0.5
local lacunarity = 2.0
local seedOffset = math.random()

--// Angular step helper
local function getAngularStep(blockLength, radius)
	return math.deg(blockLength / radius)
end

local layerStep = getAngularStep(blockSize.Y, radius)
local stepStep = getAngularStep(blockSize.X, radius)

--// Fractal Brownian Motion noise
local function fbm(x, y, z, seed)
	local value, amp, freq, maxAmp = 0, 1, 1, 0
	for i = 1, octaves do
		value += amp * math.noise(x * freq, y * freq, seed + i * 10)
		maxAmp += amp
		amp *= persistence
		freq *= lacunarity
	end
	return value / maxAmp
end

--// Core planet part (for gravity reference)
local planetBall = Instance.new("Part")
planetBall.Size = Vector3.new(2000, 2000, 2000)
planetBall.Position = Vector3.new(0, centerHeight, 0)
planetBall.Anchored = true
planetBall.Material = Enum.Material.SmoothPlastic
planetBall.Shape = Enum.PartType.Ball
planetBall.Name = "PlanetBall"
planetBall.Parent = workspace
planetBall:SetAttribute("Diameter", diameter)
CollectionService:AddTag(planetBall, "Planet")

--// Simple spawn point
local spawnLocation = Instance.new("SpawnLocation")
spawnLocation.Size = Vector3.new(20, 1, 20)
spawnLocation.Position = Vector3.new(0, centerHeight + radius + 10, 0)
spawnLocation.Anchored = true
spawnLocation.CanCollide = true
spawnLocation.Transparency = 0.5
spawnLocation.BrickColor = BrickColor.new("Bright green")
spawnLocation.Name = "PlanetSpawn"
spawnLocation.Parent = workspace

--// Terrain generation coroutine
task.spawn(function()
	local totalCount = 0
	for layer = 0, 180, layerStep do
		local layerAngle = math.rad(layer - 90)
		for step = 0, 360, stepStep do
			local stepAngle = math.rad(step)
			local rot = CFrame.Angles(layerAngle, stepAngle, 0)
			local dir = rot.LookVector
			local nx, ny, nz = dir.X * noiseScale, dir.Y * noiseScale, dir.Z * noiseScale
			local n = fbm(nx, ny, nz, seedOffset)
			local displacedRadius = radius + n * noiseAmplitude
			local position = CFrame.new(0, centerHeight, 0) * rot * CFrame.new(0, 0, displacedRadius)
			workspace.Terrain:FillBlock(position, blockSize, material)
			totalCount += 1
			if totalCount % blocksPerBatch == 0 then
				RunService.Heartbeat:Wait()
			end
		end
	end
	print("✅ Noisy sphere terrain generation complete!")
end)

this is the video :Watch Screen Recording 2025-10-17 063958 | Streamable

Hey! I took a look at your script and I think I know why the terrain looks so weird and uneven. Basically, there are a few things happening at the same time:

Noise is applied directly on the sphere’s direction vector.
You’re using dir.X * noiseScale etc. for the noise, which works okay for small areas, but on a big sphere it makes the poles super bumpy and the middle smoother. That’s why some areas look stretched or weird.

Angle steps are constant.
You’re using the same angular step for all layers, which is fine near the equator but near the poles there are very few blocks. That creates gaps or spikes at the top and bottom.

Block size is too big for the sphere.
When the blocks are big compared to the radius, it looks patchy and not smooth.

Example:
Imagine wrapping a net around a ball. If you use the same spacing for all lines, the net will be really tight around the middle but barely cover the poles. Add some random bumps on top, and the poles will look super jagged. That’s exactly what’s happening in your script.

Solution ideas:

Spread the blocks more evenly over the sphere instead of using fixed angle steps.

Apply noise in a way that is smooth over the whole surface.

Maybe make blocks smaller or increase their number to cover the surface better.

Hope that helps! I can also make a version of your script with a smoother sphere if you want.

1 Like

First, try using Terrain:FillBall() instead of fill block, which of course causes blocky terrain

If you use AI (you very likely do), just ask it atp instead of filling devforum with AI slop

1 Like

I already rried fill ball it doesnt work and adds tiny gaps to the between the balls 8nstead of over lapping and ts is not ai

Plus, uskng full ball will just make the game heavier which is not what im trying to do.

You need to use something other than fill block.
Something where each voxel can be partially filled.

You might need to restructure your code to use WriteVoxelChannels

1 Like

oh, i haven’t thought of that i might have to experiment with that because I’ve never used it before.