- Home /
Stratum (layered) terrain generation
Hi all, I've played "running with rifles" which gave me some ideas for a game of my own. One thing I really loved about it was that they display isolines on the terrain, which is both a great use of the military theme, and a strong visual feedback about terrain slopes.
Now I'd like to do something similar for one of my games, but instead of using isolines, I'd like to generate my terrain (based on a heightmap) by stratum.
a little bit like this: 
I'm hoping that perhaps I'm not the first person in the world who wanted to do this, and maybe there's an asset or perhaps a general guideline to do this. But my searches didn't get me anywhere so there ;-)
You can just use a solid brush on the terrain tool with opacity set to 100 when painting incrementally higher heights to create this kind of terrain. Or do similar in your art program when creating a heightmap.
like @Cherno said, the standard terrain won't do here. You can't have vertical edges with the terrain tool.
Answer by Cherno · Mar 25, 2015 at 10:49 AM
I think the standard terrain that comes with Unity won't work for that kind of style, but generating your own terrain mesh is not that hard, take a look at the API for the Mesh class for a simple example on how to generate a mesh on the fly furing runtime. Add Perlin noise implementation and you will have your own isoline terrain in less than a day :)
yeah I figured as much. I guess I'll have to have a look at the $$anonymous$$esh api, but I was hoping to find an asset that would do exactly this for me ;-)
What I need to figure out too is how to isolate the iso lines from my heightmap in order to generate the mesh, but perhaps there's a way to do this with photoshop
Ok, you need to have a few values set up to make your heightmap into a isoline map, chiefly the number of isolines that will appear in your map, meaning how much detailed the slopes will be (less lines = more/highher height level differences). Then you just divide the height value of the heightmap at a certain position by the number of lines and you get your isoline height level at that position. After that, it's just finding out if there's a difference between a position and the neightboring positions in regards to the heigth level, and then place your vertices accordingly. Take a look at voxel generation scripts as they are basically the same.
Answer by HeywoodFloyd · Oct 23, 2015 at 01:59 PM
As mentioned in the comments by @nymisu, you can't get truly vertical edges in terrain, but they can be pretty steep.
You may want to draw out the terrain you want in an image and import it as a height map: http://docs.unity3d.com/Manual/terrain-Height.html
Your answer
Follow this Question
Related Questions
Invisible trees? 1 Answer
Unity Voxel Terrain and structures 0 Answers
2D Procedural Terrain Generation 1 Answer
Make a high poly count plane with code 0 Answers
How to procedural generation 0 Answers