- Home /
Procedural 2D Tilemap Terrain - Mesh or Unity Tilemaps?
So I've been playing around with procedural 2d terrain generation using the perlin noise generator and found 2 different ways to do it:
Create a plane mesh with vertices and triangles and painting the texture based on the generated noise map
Use Unity's tilemap system and spawn the tiles textures based on the noise map
I'm using chunks to load the world around the player, so for first method I spawn a bunch of plane objects and activate/deactivate them based on on player location, while for the second I use the SetTiles() method to create the chunks. I have them both working with reasonably similar results, but my main question at this point is which of the two would result in higher efficiency?
I haven't implemented threading yet mainly because I'd like to solidify which method I'm going for first. The end goal is a top-down 2d world much like how Factorio looks:
Would I still be able to get the "connected texture" feel with a mesh? I'd assume so with some additional code/checks, but I'm not entirely sure. Been mulling over this for the past couple days so I figured it was time to get some outside perspective.
Thanks!