Terrain editor fill should include other shapes and orientation

Problem

As a Roblox developer, it is currently too hard to mange terrain creation using the basic built in tools. The API support the filling of a number of shapes with various orientations using CFrames. But all we have in the terrain editor under fill is a block. This is stifling creativity and slowing artists down because the API itself has the following methods:

I suspect that the terrain editor is using Terrain:FillRegion() for the fill tool. Currently the only way that we can utilize these is to use the command line, then there’s a lot of trial and error to get it just right which also wastes time.

Use Cases

The following use cases are presented.

Use Case 1

In making a particular map, I needed to hollow out a very large area using FillBall(). However, due to the radius limitation of 812 (exceeded 8MB memory size), I had to make a script that used the formula of a sphere (provided below) and slice it into cylinders of 1 stud thick to get around that limitation. Since the terrain editor is severely limited in this regard, I had to resort to the command line to key in the coordinates to make this happen.

Use Case 2

As previously mentioned, the issue with the terrain editor fill command is that you can only fill blocks which are oriented on angles <0, 0, 0>. This is a severe limitation that should not exist given the facilities of the above mentioned APIs. What if I wanted to create a long water channel at a diagonal angle? Since that’s not possible with the fill tool, I would have to do it manually using the other tools.

Use Case 3

In the above image, to make a plunge pool for a waterfall, I have to use either the fill tool, carve out the terrain manually using the other tools, or use the command line to utilize one of the other terrain fill functions.

The commands that I used in the command line are as follows:

game.Workspace.Terrain:FillCylinder(CFrame.new(224, 128,-468), 32, 36, Enum.Material.Air)
game.Workspace.Terrain:FillCylinder(CFrame.new(224, 126,-468), 28, 36, Enum.Material.Water)

This used a fair amount of trial and error and using the coordinates and size from the fill tool of the terrain editor to get it right which should not be the case. This is the result:


Additional Information

I realize that the engine places memory size limits on these methods, but the engine also provides pcall to handle this. So if a size too big is selected (like what I encountered with FillBall(), the user can be notified with the resulting error message to indicate this.

For those of you who are wondering about the script that I used to circumvent the FillBall() radius limitation of 812, here it is below:

local function generateTerrainSphere(center, radius, material)
	local terrain = game.Workspace.Terrain
	if radius > 812 then
		for y = 0, radius, 1 do
			local x = math.sqrt((radius * radius) - (y * y))
			local vp = Vector3.new(center.X, center.Y + y, center.Z)
			local vm = Vector3.new(center.X, center.Y - y, center.Z)
			if x > 0 then
				terrain:FillCylinder(CFrame.new(vp), 1, x, material)
				terrain:FillCylinder(CFrame.new(vm), 1, x, material)
			end
		end
	else
		terrain:FillBall(center, radius, material)
	end
end

It was published from this bug report: Terrain:FillBall() has an arbitrary radius limit of 812

Conclusion

If Roblox is able to address this issue, it would improve my development experience because then it would be easier to create various terrain shapes without having to manually add/subtract the terrain materials to get the desired shapes. This would also add some much needed flexibility to the fill tool so that a game map can be quickly roughed out without requiring too much effort to do so. Furthermore, artists who are way better than me using the terrain editor can utilize the added functionality more efficiently and effectively than I can.

6 Likes

I’m not sure if you already mentioned this, but directional terrain painting would be nice for roads and other specific directional PBR materials.

As a temporary solution you could check out the Part to Terrain plugin, I’ve found it quite useful.

I have that, and I tried it once before with sub-optimal results.