Writing my own terrain generation vs fratscape/other

Hi!

So, I’m creating a game which will require random terrains to be generated and I’m just researching my options. I have looked through these forums and it seems a lot of people recommend Fratscape for generating this stuff though I’m not 100% sure this will work with what I need.

The terrains need to be generated ‘on the fly’ i.e. after the user starts a new game, the world will take a minute or two to generate - I want each new game to be a completely new world.
The other thing is, once the terrain is generated I will need to programatically edit some sections of it in order to add various meshes (think flattening in area to place buildings etc).

So the flow would be: User selects new game, game generates random terrain, game edits sections of terrain, game places meshes, user added to game world.

My initial thoughts were to generate my own heightmap in memory with these edited sections already added then import that heightmap to generate my game world.

Will Fratscape make this process easier? Is this even possible using Fratscape or have I got a lot of code to write? :wink:

That’s not possible with Fractscape, which is a stand-alone app designed to create terrains that you import into Unity, rather than being code that you run in Unity. Looks like you’d want the terrain toolkit for that.

–Eric

Awesome, thanks for the info Eric.

Ok, the Terrain Toolkit looks useful as it will generate a random terrain onto my pre-existing Terrain object. So far, so good. However, looking through the Terrain Documentation I can’t see how I can access the raw heightmap data from within a script? Is it even possible?

My issue is that once the terrain has been generated I need to programatically edit it. Using the Unity Editor I could easily flatten out parts of the generated terrain therefore I assume there are API functions I can call from my script to achieve the same thing - am I wrong?

TerrainData.GetHeights and SetHeights.

–Eric

Thanks again Eric… a bit embarrased I missed that! :o