Implementing built-in terrian generation with a script

Hello!
I’m trying to make procedural terrain generation with a script. I already like Roblox’s built in terrain generation in the terrain editor especially because of all the parameters/biomes/etc…, is there any way to call it from a script?
I have tried converting my old voxel (part) terrain to roblox terrain, but it’s not very efficient, especially when procedural.

I’ve looked for solutions here, but most are just how to fill a block of terrain, or link to theory.

Is there any way to use Roblox’s built in terrain generation in a script rather than just in studio?

That is a major subject. A lot to know before you can even start. That generator in Roblox is making it look easy, It so isn’t. That all works off Perlin noise and chunk algorithms. Let me see if I can find you a good link here.

How to Make an Automatic Terrain Generator (Procedural Generation) - Roblox Studio Tutorial
Ultimate Perlin Noise and How To Make Procedural Terrain Guide

That looks like a good start.. see you in 6 months. :astonished_face:

Assuming you are a beginner, this is the best advice you will get:

But, if you do have some experience then it shouldn’t be too difficult.

My recommended steps would be:

  1. Learn how to use simplex noise (recently unpatented, better than classic perlin noise)
  2. Read off of simplex noise map
  3. Fill region using Terrain:FillRegion()

[spoiler]For even more “fun” you could use another simplex noise map for biomes![/spoiler]


Some possibly useful links:


You should also note that it is very improbable that you can do this in real time, if you were trying to do that.

Looks like I answered the wrong question here.. the answer you’re looking for is; NO there isn’t.
But you can build your own. Them links can help that.

Here is a simple start:

local Terrain = workspace.Terrain
local size = 4
local width, depth, height = 64, 64, 20

local function noise(x, z)
	return math.noise(x / 10, z / 10) * height
end

for x = 0, width - 1 do
	for z = 0, depth - 1 do
		local y = math.max(noise(x, z), 1)
		Terrain:FillBlock(CFrame.new(x * size, y / 2, z * size), Vector3.new(size, y, size), Enum.Material.Grass)
	end
end

One grass layer.

A while back I wrote a plugin that builds terrain with a few options, you can check it here if you want to test out the approach:

More useful for you, I also published the code here:

The rbxmx can be dropped into (you may have to do something like load plugin) your experience’s plugins folder to allow you to look at the code. As run time is not a big factor for plugins you may find it too slow or cpu heavy as is, but it might give you some ideas.

As others have said, it can be quite a steep learning curve. Good luck!

Thanks a lot for the Java one, it’s a familiar language to me and it’s already helpful so far.
I’ll be sure to check out other materials in the replies as well!

I highly recommend you check out this plugin.

This plugin incorporates a client script that allows terrain to load and unload as the character moves around, along with handling terrain modifications in studio.

It also provides, as the name says, infinite terrain possibilities. It has unlimited customization options that should fit your needs.