Terrain data connection question

Apologies if this is covered somewhere - have searched! :slight_smile:

Anyway, I fail to grasp how terrain data is stored. Basically, I need to create a number of different terrains for different levels. I assumed that all of the terrain data was stored in the (logically named) terrain data objects. However, it seems to be impossible to “reconnect” these. Ie. if I substitute one terrain data object for another in the Terrain Data field of a terrain object, the terrain just disappears.

So, what I need to know is:

  • exactly where is the terrain data stored?
  • is it possible to swap terrain data objects?

This is important from a practical point of view as I would sometimes like to reuse terrain settings (textures, trees, etc.) and by the look of things, I can’t?

TIA!

Anyone? Surely this must be an easy question for people on the beta team or devs…? Come on! :wink:

If I understand your question right, you want to create a new terrain for each level, but use some of the same assets on these terrains.

That’s very easy to do – just create a new terrain object in the Project, add it to the scene, and then sculpt the terrain or import a heightmap, add trees and splats and paint them on. You can use the same models and textures on as many terrains as you want. Only one copy of each asset will be included in the project.

If you want to use all of the same assets in multiple terrains, one shortcut would be to duplicate the terrain object in the project, and then add each one to a separate scene. Then select the terrain object in the scene and import or sculpt the heightmap, and also erase and repaint your textures and veg. That saves you having to add back the textures and veg to each new terrain.

A terrain object is like a prefab in that it points to the assets it uses (textures and models) in the project. It is not like a prefab in the sense that if you put a terrain object in a scene and modify it such as change height or paint textures on it, the parent terrain object is changed, and so if that same one is in another scene, it will be changed too. The LOD settings (tree draw distance, etc.) ARE local to the instance in the scene.

Yes and no.
Basically - I want to know what is stored in the terrain data objects created when a new terrain is generated.

The name (and some of the docs IIRC) seem to imply that the terrain data object is what it sounds to be - ie. a container for all the data, but that doesn’t appear to be the case.

What exactly is stored in it, and how can a terrain object be moved to another scene without copying the scene? Can it?

I’ve also wondered this. I have a lot of levels with the exact same setup but different terrain. The terrain data I drag into the terrain data field in the inspector doesn’t have any bearing on the terrain in the game at all. In fact, if I set the terrain data to ‘none’ that still doesn’t change anything in the game.

From experimentation it seems the heightmap and alpha data are stored in the game object which has the terrain script on. This seems to make the terrain data object completely pointless.

You can move terrain data between scenes by copying that game object or making it a prefab, though that’s not really how it seems it should work.

It does make me wonder why they have terrain data object at all if they have no effect on anything