Jump to content

Heightmap Data fails to transfer to new project


Bill Pomidor

Recommended Posts

Not sure if this is a bug or just an error on my part; either way, any guidance would be appreciated!

I'm following the instructions posted at this page from your site: https://canopy.procedural-worlds.com/library/tools/gaia-pro-2021/written-articles/advanced/moving-projects-moving-gaia-r117/

I've created/exported a Gaia "Scripts Only" package first, then imported it into a new/empty project (U2023.1), and also gathered/exported/imported the Session file and folder plus the terrain resources (terrain textures, trees, details).  I had also backed up the heightmap before exporting the Session file/folder.

When restoring the terrain inside a new project (also U2023.1), the ScriptsOnly package, Session file/folder, and terrain resources import with no errors.  The Session operations include a "RaiseHeight" step which didn't work -- no surprise, since the Stamp I had used didn't export/import along with the other assets.

That was no problem, though, because I had created a Heightmap Backup for the session before I exported it.

Unfortunately, when I tried to Restore Manual Backup, the operation fails and it triggers the following errors.  I've screen-shot both the Console plus the Session Manager windows.  Thankfully, this isn't a huge problem because I exported RAW heightmaps for all 8 terrain tiles; I can import them to each corresponding terrain tile and then Stitch to close any gaps. But it would be a lot more convenient if I could use the session's Heightmap Backup as designed.

Thanks!!

image.thumb.png.9bd262f66436548c43129bec95094fb5.png

Link to comment
Share on other sites

HI @Bill Pomidor,

the heightmap data for the actual or "current" terrains is being kept inside the session directory in the folder "Terrain Data". The backup data created by the session manager and by spawners that use heightmap changes is being kept in the folder "Terrain Heightmap Backup":


image.png

If you export the terrain data folder from your source project into the target project, the terrains should have the correct height already. If you also export the Terrain Heightmap Backup folder, you should be able to use the backup feature in the session manager again and restore an earlier state.

Link to comment
Share on other sites

Thanks for the clarification.  When I've replayed the session, I only get the 4x2 terrain with the proper dimensions (8K x 4k), but the terrain is completely flat -- regardless of whether the manual backup is included/used or not.

I worked around the problem by using the exported heightmaps from the individual terrain tiles (using Unity's terrain toolbox to batch-save all 8), then importing heightmaps individually.  

I have two questions which might help straighten me out:

1.  Does it matter if we export/import the actual Unity scene (not terrain scenes, but the actual main scene)?  (I'm not using terrain scenes, btw, just my preference)  I've been following the Gaia-transfer instructions in the topic I linked to previously, but I don't think it mentioned whether you need to transfer the actual scene.  Instead, I've just opened the session manager from the Gaia manager's advanced tools, loaded the session, and played it (in an empty scene).

2.  Is there a way to capture/record heightmap changes that aren't done through Gaia? The main reason this is an issue for me is because I need to be able to record terrain changes that are done via Gena or by manual edits. Since they aren't happening via Gaia itself, those steps/changes aren't added to the heightmap record. That's why I had hoped I could do it using the manual heightmap-backup method from the session manager. Once I have the exact, most recent heightmaps, I can reconstruct the other stuff using spawners and biomes.

If that use-case isn't available in Gaia, perhaps someone can write (or has written) a script that simply captures/reloads the heightmap tile heights/images at the current moment, regardless of how the changes were done.  If you know of a tool that already does that (i.e., captures an array of Unity tile heightmaps, then reloads them to similarly-named tiles in another project or scene/world), please let me know!

Thanks!

Link to comment
Share on other sites

Hi @Bill Pomidor, regarding your questions: 

1- Yes, this would matter, depending on what you want to achieve. The unity scene file contains the structure of the hierarchy and most surface data of the objects, e.g. the position, scale, and things like that. The position of your terrains would be stored in the scene file for example. (If you are curious you can open the scene file with a text editor to see how & what data is stored, it is somewhat human-readable.)
For heavier objects though, such as materials, models and terrains the data is not all stored in the scene file but instead somewhere else in the project hierarchy. Gaia stores the terrain data for the terrains in a folder called "Terrain Data" in the session folder. You can see which terrain data object is associated with a terrain by looking at the terrain collider, it has a reference to the data object.

image.png
If you export both the scene and the Terrain Data folder into your target project, I would expect the heightmap data to be there, and the terrains should not be flat. The scene should hold the positions for the terrains, and the terrain data should have the height information.
Likewise if you export the "Terrain Layer" folder into the target project, the texturing should be copied over (assuming you have the actual textures, the grass texture, sand texture and so on, in the target project as wel).
So I would dare to say you would not need to replay the session or use backups at all in the target project if you export the scene, the terrain data and the terrain layer folder over into the target.

2. The heightmap changes made outside of Gaia would also be stored in the Terrain Data object. If you made a heightmap backup with the session manager after the "outside" changes have been made, it would capture those as well. 
Gaia does not track those outside edits as it would be difficult for us to do so - we can get notifications from unity when the heightmap changes, but we would not know what exactly changed, so we would need to take a backup of the heightmap on every edit on the terrain, which would accumulate a lot of data quickly.

Link to comment
Share on other sites

Thank you for the detailed answers!!!

1.  I'm on another milestone/deadline, but once that's finished I will definitely try exporting/importing the actual scene files along with the Gaia packages/snapshots that you've described in the Export tutorial.  It may seem like a no-brainer, but I've been packaging/transferring the rest of the scene (objects, etc) separately because -- even in a package -- the scene's non-terrain elements add up to ~700 MB.  I've realized, though, that I can transfer the entire scene along with the terrain as long as I (temporarily) delete the cities/towns/resorts/etc. 

It's a complex game with a lot of systems, so for now I'm creating the different components using separate projects (e.g., an "indoor" project, an "outdoor" roads/driving project, an outdoor NPC/interaction/traffic project).  I'm a creaky old Unity veteran from the v2 and v3 days when projects were far more prone to crashing irretrievably; old habits die hard.  🤪

2. That is phenomenally great news!!!  If I can get Gaia's terrain-backup/transfer system to include manual heightmap data, life will be vastly simpler and easier. More importantly, I'll be able to build large-scale (e.g. 16+ tiles) terrains; they would be a nightmare if I had to manually export/import the heightmaps individually like I'm doing now. 

Once again, many thanks!  I'll post here with an update next week, hopefully reporting that your detailed instructions solved my heightmap problems.  😎

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Tell a friend

    Love Canopy - Procedural Worlds? Tell a friend!
  • Need help?

    We work with some of the biggest brands in global gaming, automotive, technology, and government to create environments, games, simulations, and product launches for desktop, mobile, and VR.

    Our unique expertise and technology enable us to deliver solutions that look and run better at a fraction of the time and cost of a typical project.

    Check out some of our non-NDA work in the Gallery, and then Contact Us to accelerate your next project!

×
×
  • Create New...