Jump to content

Terrain loader isn't loading at the build.


Ugur Tuna

Recommended Posts

  Hi, I use gaia terrain scenes (streaming) if I load my game scene with the play button in unity; terrain loading system works very well but if I build the game it just doesn't load terrain scenes.  Also if I load my game scene from main menu scene at unity play time it doesn't load the terrains either. I tried building with tand without the main menu; terrain loading system doesn't work at both. So terrain loading system only works if I press the play button in unity from the game scene. Here is my build settings: Build.thumb.png.b5e4368ca20545d7fb9cab50a8fe7844.png

Here is the build view: Terrain.png.305d7fbb88a23319212da1aa75627c3a.png

  Thank you.

Link to comment
Share on other sites

Hi @Ugur Tuna the screenshots look good in so far that you have the terrains in the build settings. I will double check from my side to see if I can reproduce the issue.
What you could try in the meantime is: 
- Could you please try to make a development build? If you are lucky there is some kind of error when Gaia / Unity tries to load the terrain scenes, and you would see that error immediately in the Developer console then.
- The houses look like they are placed on the terrain - are those houses part of the terrain scenes that are being loaded in, or are they independent of the terrains? If they are in the terrain scenes, I could imagine that this is rather an issue of the terrains not being displayed (potential issue of shader not being included in the build) rather than the loading not working. Another indicator of the terrains being "there" but not displayed would be that the npcs and the player seem to stand on something and not falling, but I'm not sure if gravity / physics is involved in the setup.

Link to comment
Share on other sites

8 minutes ago, Peter said:

Hi @Ugur Tuna the screenshots look good in so far that you have the terrains in the build settings. I will double check from my side to see if I can reproduce the issue.
What you could try in the meantime is: 
- Could you please try to make a development build? If you are lucky there is some kind of error when Gaia / Unity tries to load the terrain scenes, and you would see that error immediately in the Developer console then.
- The houses look like they are placed on the terrain - are those houses part of the terrain scenes that are being loaded in, or are they independent of the terrains? If they are in the terrain scenes, I could imagine that this is rather an issue of the terrains not being displayed (potential issue of shader not being included in the build) rather than the loading not working. Another indicator of the terrains being "there" but not displayed would be that the npcs and the player seem to stand on something and not falling, but I'm not sure if gravity / physics is involved in the setup.

  @Peter First of all, thank you for your response. 

  - I made a dev build but it didn't throw any errors.

  - Houses aren't part of the terrain scenese, they are part of the game scene. I put a picture from my hierarchy so I can explain better. NPC's stands on the baked navmesh, I don't use physics for movement. And I checked, terrains are still there even if they doesn't seen it just loads the wrong terrain I saw a terrain is loaded but it isn't the right terrain.

  - I realized a strange thing which might related to the issue. If I load the game scene again and change start position from script I recieve a heavy lag (like fps downs from 70 to 15 ) and it doesn't go away so I checked the profiler and I saw the flora kills the performance and if I change scene loader center view loading to world origin it just doesn't happen but it doesn't load any terrain this time  : Profiler.thumb.png.7e939ea2702c5422e40b55d7f342e293.png

 

Here is my hierarchy: 

  Hierarchy.png.5929d17813da7e1c4f67f7bdb90fd404.png

Link to comment
Share on other sites

@Peter Look at these please, details are dissapearing when moving just a bit. I switched to terrain streaming because of the memory issues I thought having a huge terrain causes that but I realise, the flore creates a heavy lag and causes my game to crash. I removed whole procedural world folder and data sessions; reimported gaia but it just still the same and i didn't do anything. I want to release my game in 1 -2 weeks and i was working at that game like for 14 - 15 months but I can't release the game like that. At least is there a way to prevent gaia from handling the terrain details - terrains scenes and make by code at the play time? Please help me I am trying to solve these issues for 18 - 20 hours and I don't know what to do.Flora.thumb.png.71771cc6a020ad4400f8ae71df79bfdf.png

Link to comment
Share on other sites

@Ugur Tuna I tested this in an empty project in the meantime with a 4x4 terrain grid, and did not run in the issue, so this seems not to be a general bug in Gaia. The issue you originally reported was 
 

4 hours ago, Ugur Tuna said:

it just doesn't load terrain scenes.  Also if I load my game scene from main menu scene at unity play time it doesn't load the terrains either

Then you mention later on:
 

2 hours ago, Ugur Tuna said:

And I checked, terrains are still there even if they doesn't seen it just loads the wrong terrain I saw a terrain is loaded but it isn't the right terrain.

So the terrains DO load, it rather seems that they are loading in the wrong spot, or they are the wrong terrains. You mention that the terrains load correctly when you are starting the scene in the editor without going via the main menu scene - you would need to find out what the difference between the two scenarios is then.
When you go via the main menu and the wrong terrains are loaded then - which terrain loader is loading those terrains? You should be able to see this in the terrain loader manager object and checking what is the object that has a reference to those terrains. For example here I can see that the Gaia FlyCam has loaded this terrain:
image.png

If you compare the scene where it is working and where it is not working, you should be able to find a difference there, there must be a wrong object loading the terrains then.

 

1 hour ago, Ugur Tuna said:

At least is there a way to prevent gaia from handling the terrain details - terrains scenes and make by code at the play time?

Yes, you can disable Flora entirely by selecting a grass spawn rule, then doing the following:

image.png

image.png

This should go over all terrains, even the currently not loaded ones, and remove all flora settings from there.

Link to comment
Share on other sites

35 minutes ago, Peter said:

@Ugur Tuna I tested this in an empty project in the meantime with a 4x4 terrain grid, and did not run in the issue, so this seems not to be a general bug in Gaia. The issue you originally reported was 
 

Then you mention later on:
 

So the terrains DO load, it rather seems that they are loading in the wrong spot, or they are the wrong terrains. You mention that the terrains load correctly when you are starting the scene in the editor without going via the main menu scene - you would need to find out what the difference between the two scenarios is then.
When you go via the main menu and the wrong terrains are loaded then - which terrain loader is loading those terrains? You should be able to see this in the terrain loader manager object and checking what is the object that has a reference to those terrains. For example here I can see that the Gaia FlyCam has loaded this terrain:
image.png

If you compare the scene where it is working and where it is not working, you should be able to find a difference there, there must be a wrong object loading the terrains then.

 

Yes, you can disable Flora entirely by selecting a grass spawn rule, then doing the following:

image.png

image.png

This should go over all terrains, even the currently not loaded ones, and remove all flora settings from there.

  Well, a second camera is being activated from one of my scripts and gaia chooses the right camera if I press the play button; at the other scenerios it chooses the other one and the memory issue too is related that because when I fix that code, memory issue solved. I was tired and my judgement was wrong. Thank you.

Link to comment
Share on other sites

45 minutes ago, Ugur Tuna said:

  Well, a second camera is being activated from one of my scripts and gaia chooses the right camera if I press the play button; at the other scenerios it chooses the other one

Ok I assume that in the non-working scenario the final camera might be missing the Terrain Loader component then, or it is not set to "Runtime Always". I would recommend at the moment where you make the switch to set the load mode of the old camera to "Disabled" and set it to "Runtime Always" on the new camera so it starts loading in the terrains.

image.png

Link to comment
Share on other sites

5 minutes ago, Peter said:

Ok I assume that in the non-working scenario the final camera might be missing the Terrain Loader component then, or it is not set to "Runtime Always". I would recommend at the moment where you make the switch to set the load mode of the old camera to "Disabled" and set it to "Runtime Always" on the new camera so it starts loading in the terrains.

image.png

  Yes, Terrain Loader Component was missing it is perfectly working now 🙂

Link to comment
Share on other sites

@Peter Terrain loading works well for most of the game but when I move to a certain point; terrains are just dissapears. I checked the hierarchy; those terrain scenes are active but terrain's gameObjects becomes deactive as you can see. I don't know if it is about the problem because I paused the game, set their gameObject active from hierarchy several times;  some times it still didn't show (I checked the terrain location and it was far away from where it was at the beginning ) and sometimes terrain starts to show but it's detail distance and detail density has set the zero so I was unable to see the details.Terrain.thumb.png.cef3c00668668ae97bd25f5912cb1b7e.png

Link to comment
Share on other sites

@Peter I deleted all terrain scenes - objects from the hierarchy and build settings. Regenerated the world, still the same. I have only one active camera, only one Terrain Loader with always runtime, and there is no error. But it just doesn't work at certain points. Here, I found  an example spotSpot.png.48b93490454fa122c1a60db9988a8bdc.png I use that method to see if any other camera exists but when I press U; player goes to there and the same thing happens. Here is my terrain loaders and my loader settings: Loaders.png.6e65ff555d811df280b447bdfc13226e.png LoaderSet.png.12fded0fbc3272f10d03bc3250b7f8de.png

Edit: I think it is about the floating point fix even it is deactive. I gave up from using the terrrain streaming so I deleted all terrain scenes, disabled all terrain loaders. I didn't activate the floating point fix but I got errors from that line at the floating point fix script: 

TerrainLoaderManager.Instance.SetOrigin(currentPosition + TerrainLoaderManager.Instance.GetOrigin()); 

image.thumb.png.389c981c22e1e1b310fbc1b972ef6cc4.png

Link to comment
Share on other sites

@Ugur Tuna If you are getting errors from this line of code, you most likely still have a floating point fix script somewhere in your scene, most likely on the player or camera object. If you are not sure where it could be, you can search for the type "FloatingPointFix" in the scene hierarchy like this:

image.png

Link to comment
Share on other sites

  • 2 weeks later...

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...