# Improving Terrain Generation

Hiya. I have already tried quite a few methods, painstakingly adjusting various different equations. Either way I’ll keep it simple here.

I have a parallel terrain generator which creates terrain with `WriteVoxels`. Each voxel is filled with this subprogram:

``````occupancy[x][y][z] = math.noise((x+chunk.x)*0.02,y*0.02,(z+chunk.z)*0.02)-y*0.1+1.5
material[x][y][z] = Enum.Material.Grass
``````

My terrain generation works brilliantly, but it has these rather undesirable ridge lines when the gradients are small.

Does anybody know how to work with Roblox’s terrain and perlin noise to settle the occupancies and create smooth cliffs? It seems all my efforts using exponential, quadratic, linear and inverse equations are in vain.

Thank you.

2 Likes

A bit disappointed that the solution seems to be multiplying the occupancy by some seemingly random value.

``````occupancy[x][y][z] = (math.noise((x+chunk.x)*0.02,y*0.02,(z+chunk.z)*0.02)-y*0.1+1.5)*10
material[x][y][z] = Enum.Material.Grass
``````

If you can spot the difference, there is now a coefficient on the occupancy expression.

I believe this has something to do with the idea behind antialiasing.

In conclusion, apply math.pow() or a *10 to the noise. I don’t understand why Roblox doesn’t provide us with a concrete demonstration of occupancy in action to tweak our own systems. There goes two weeks of my life…

Hopefully this helps someone else.