1

I need to create a 3D large terrain (say 2000x2000) where I need to track properties of the terrain surface at 1x1 resolution. For example, I want to keep track of how much grass or stones is in 1x1 area, which may change as game progresses depending on resource consumption. Based on that I want change visual appearance of that 1x1 area. What are my options?

While I have created a 1x1 tile that tracks above properties, I have read it may not scale for the size of my terrain. Also, aligning each title with varying terrain heights (I expect terrain to have smooth height changes but it may not exceed a few 10s of units) using projection is not easy. I see placing a grid over terrain as another option to place objects. But not sure how to track properties at each grid cell or update 1x1 terrain area at that point.

  • I recommend looking up marching cubes/squares (for 2d). Marching cubes/squares can help you with this type of thing. I recommend catlikecoding’s marching squares [tutorials](https://catlikecoding.com/unity/tutorials/marching-squares). Marching squares lets you generate terrain with each vertex having values (you will see in the tutorial) such as materials. A warning: marching squares may take a while to implement. The player can add to this terrain (if you figure out how), and take away from the terrain. Another [tutorial](https://paulbourke.net/geometry/polygonise) for just marching cubes. – gbe May 10 '21 at 15:24
  • Welcome new user. Have you already familiarized yourself with the `Terrain` system built-in to Unity? You can indeed "paint" on it (change the grass etc) at runtime. My guess is this would do everything you need. – Fattie May 10 '21 at 17:20
  • I have looked into many Terrain videos and have an idea about how to programmatically update the terrain. But my concern is how to track 1x1 surface area on that terrain with properties like the amount of grass/stones in that 1x1 surface. Probably a terrain plus grid would do. But not sure how to combine the 2. – Dilum Bandara May 10 '21 at 20:12

0 Answers0