TriTerrain - LowPoly Terrain Generator

TriTerrain

WARNING: DO NOT USE THIS TERRAIN SYSTEM FOR ANY REAL GAMES
Because The terrain is made out of WedgeParts it is not performant and should not be used for any real games.


How To Use

Either get the system from the src folder on the github repo or grab it from roblox here. Then put in in ReplicatedStorage or ServerStorage (for example).


API

-- Inits The Part Pool For Storing The WedgeParts. YOU MUST DO THIS BEFORE GENERATING TERRAIN.
TriTerrain.init()

-- Creates Data For A New Chunk At The Specified Coords.
TriTerrain.new(x,y,z) -> Chunk
-- Generates The Chunk.
Chunk:gen()

Example Script

local TriTerrainFolder = game:GetService("ReplicatedStorage").TriTerrain
local TriTerrain = require(TriTerrainFolder.Generator)
local Swait = require(TriTerrainFolder.Swait)

local WIDTH, DEPTH, HEIGHT = 2,2,1

-- Inits The Part Pool.
TriTerrain.init(13000*WIDTH*DEPTH*HEIGHT)

print("Starting")
local start = tick()


-- Generates The Chunks.
for x = 0,(WIDTH-1) do
    for z = 0,(DEPTH-1) do
	for y = -HEIGHT,0 do
	    TriTerrain.new(x,y,z):gen()
	end
    end
    Swait()
end

-- Prints The Amount Of Time It Took To Generate.
print(tick()-start)


7 Likes

You can use .obj MeshParts for this to increase performance instead of downgrading it.

This would be a good change and suggestion.

2 Likes

great resource!

would love to see this improve!

2 Likes

This will be super useful if you improve it more, awesome creation!

2 Likes

I just thought id let anyone know what updates I have planned for this system:

  • 2d surface biomes which are bi-linearly interpolated.
  • 3d cave biomes which are tri-linearly interpolated.
  • terrain modifation system (like in astroneer)
  • a more aware poisson disc sampling algorithm (the algorithm currently isnt aware of the chunks around it, this update should fix this problem)
  • different styles of generation (floating islands, surface terrain only, caves only)
2 Likes

In order to properly get the terrain system to work you need to create 2 Collision Groups.


1 Like

Bruh.

1 Like

combining the words “tri” and “terrain” is not a revolutionary idea. We both coincidentially chose the same name for our projects.

1 Like

Kinda sus tho.

They wanted more words