Jump to content

Terrain not being loaded in Mobile


OrdemDevOps
Go to solution Solved by Peter,

Recommended Posts

pc.thumb.PNG.f63fcaed45af08335aff11327596cd33.PNG

[Top] Works fine in Editor

[Bottom] Does not Load Terrains in Target Mobile Hardware

mobile.thumb.jpg.b6cee105c3e67c1a8d15222b06b8c0ef.jpg

 

Hi,

 

So, my target platform is

"Mobile And VR",
and I use:
- Create Terrain Scenes
- Unload Terrain Scenes
- Floating Point Fix

 

For this experiment, I started with:
- 2 Gaia stamps in 3 terrain blocks
- one in the middle empty
- each terrain block is 1,024^{2} m^2 (Medium).

 

This works fine both in the editor and in my Android mobile hardware.

 

Then I scaled up the world.
- 3 Gaia stamps in 5 terrain blocks
- two interleaving terrain blocks empty
- each terrain block is 1,024^{2} (Medium).

 

This works fine in my editor,
but it does not work in my mobile.

 

Only the Gaia Runtime appears but no terrains is visible. My observation is that, even the Gaia Player does not fall down. It would imply that there are something missing before basic physics starts working. Just as a remark, Gaia Player is positioned only slightly above the terrain, so there is no large gap, and it is less probable not to load the terrain stamp somehow.

 

Could you give me an advice how to resolve this problem?

 

Link to comment
Share on other sites

Can you please tell me if you are using the Gaia custom player? 
Then assigning your player and camera to it for mobile? 
If its working on the smaller world for mobile and not on the larger one that would mean its hardware specs (more than likely).

For it not working at all in vr for the build is interesting if its working in editor. 

We are looking into the Terrain Loader just in case! 

 

  • Like 1
Link to comment
Share on other sites

In addition to what Bryan asked, could you also please try to do a development build? If there are any errors during the terrain loading process they would show in a console window on the device 

  • Like 1
Link to comment
Share on other sites

* Brief Summary: Gaia Dynamic Scene Loading on Mobile *

Dynamic scene loading works fine in the Unity editor, but often fails on a mobile with the dynamic scene loading.

 

* Note: I will split this report into three replies. *

 

[A] Build Environment

 Let me start with the build environment. As @Peter suggested, I proceed with the development build in what follows. As a specific comment, the build uses the scripting backend of IL2CPP and the target architectures of both ARMv7 and ARM64 because this is the requirement on Google Play. It may not relate to the current issue though, I guess.

1062808805_AGaiaDynamicSceneLoadingonMobile.thumb.png.7c404354c7e3cbf33705062ec51deaf0.png

Link to comment
Share on other sites

[B] World Generation using Gaia

 

Let us try with:

- 128 square meters for each terrain block and have

- 3 x 3 of them for the dynamic scene loading.

 

I also generate a Gaia Player and biome over the terrains as the experimental setting, with no more additional objects at the moment.

 

I am confused with the hardware spec that @Bryan mentioned. So, here is my initial idea:

 60 kilometers square in total but with dynamic scene loading from many small pieces of the terrain blocks. With the dynamic scene loading, the total size of the world would not be an issue as only a small fraction is being loaded into the memory. For instance, one piece of the terrain block with the size of 128 square meters, and just 9 blocks at most at a time means only 384 square meters for the dynamic scene loading. In such a case, does a hardware spec still matter?

 

Remark. @Bryan mentioned a Gaia Custom Player, but I don't know what that precisely means: please teach me on that as I am interested. I am currently using just the basic Third Person that comes with Gaia and the procedural world sky feature from Gaia pro. When I generate this Gaia Player, I just noticed that there is an error message in the Unity editor console: "DeInitialize had a issue Object reference not set to an instance of an object. This came from at Gaia.ProceduralWorldsGlobalWeather.DeInitialize()". You can also see this message in the figure.

 

[B1] Gaia Dynamic Scene Loading on Mobile.png

[B2] Gaia Dynamic Scene Loading on Mobile.png

Link to comment
Share on other sites

[C] The Problem Reproduced, Error Log Collected

 

 As @Bryan mentioned, I also think that the hardware limitations in a mobile can be a reason, but then, it is unclear how to make the dynamic scene loading useful. I wrote in the previous section [B] that I wanted to make use of the dynamic scene loading to describe larger worlds also in the mobile set up. Is my idea broken? There are mobile MMORPGs that would have tens of square kilometers making use of dynamic scene loading anyway, no?

 

 So, the problem is easily reproduced at my side. This relatively small world still does not work on a mobile [second image], while it works fine in the editor [first image]. This time, I believe that I collected potentially useful information from Android Logcat in Unity for what's happening at the scene loading stage with the mobile target [third image]. I also write the repetitive part in the log below:

 

2022/07/28 05:51:05.352 10002 10094 Error Unity [./Runtime/SceneManager/SceneManager.cpp line -1608189288]
2022/07/28 05:51:05.352 10002 10094 Error Unity
2022/07/28 05:51:05.358 10002 10094 Error Unity NullReferenceException: Object reference not set to an instance of an object.
2022/07/28 05:51:05.358 10002 10094 Error Unity   at Gaia.TerrainScene.LoadScene (UnityEngine.SceneManagement.Scene scene, System.Boolean& loadRequested, Gaia.LoadState& loadState, System.Boolean isImpostor) [0x00000] in <00000000000000000000000000000000>:0
2022/07/28 05:51:05.358 10002 10094 Error Unity   at Gaia.TerrainScene.UpdateLoadState (System.Collections.Generic.List`1[T] referenceList, Gaia.LoadState& loadState, System.Boolean& loadRequested, System.Boolean& unLoadRequested, System.Boolean isImpostor) [0x00000] in <00000000000000000000000000000000>:0
2022/07/28 05:51:05.358 10002 10094 Error Unity   at Gaia.TerrainLoaderManager.UpdateTerrainLoadState (Gaia.BoundsDouble loadingBoundsRegular, Gaia.BoundsDouble loadingBoundsImpostor, UnityEngine.GameObject requestingObject, System.Single minDistance, System.Single maxDistance, System.Single minThresholdMS, System.Single maxThresholdMS) [0x00000] in <00000000000000000000000000000000>:0
2022/07/28 05:51:05.358 10002 10094 Error Unity   at Gaia.TerrainLoader.UpdateTerrains () [0x00000] in <00000000000000000000000000000000>:0
2022/07/28 05:51:05.358 10002 10094 Error Unity
2022/07/28 05:51:05.369 10002 10321 Error SwappyVk Failed to wait for fence 2
2022/07/28 05:51:05.419 10002 10321 Error SwappyVk Failed to wait for fence 2
2022/07/28 05:51:05.453 10002 10094 Error Unity Scene 'Assets/Gaia User Data/Sessions/GS-20220728 - 052323/Terrain Scenes/Terrain_1_1-20220728 - 052323.unity' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.
2022/07/28 05:51:05.453 10002 10094 Error Unity To add a scene to the build settings use the menu File->Build Settings...
2022/07/28 05:51:05.453 10002 10094 Error Unity UnityEngine.SceneManagement.SceneManagerAPI:LoadSceneAsyncByNameOrIndex(String, Int32, LoadSceneParameters, Boolean)
2022/07/28 05:51:05.453 10002 10094 Error Unity UnityEngine.SceneManagement.SceneManager:LoadSceneAsync(String, LoadSceneMode)
2022/07/28 05:51:05.453 10002 10094 Error Unity Gaia.TerrainScene:LoadScene(Scene, Boolean&, LoadState&, Boolean)
2022/07/28 05:51:05.453 10002 10094 Error Unity Gaia.TerrainScene:UpdateLoadState(List`1, LoadState&, Boolean&, Boolean&, Boolean)
2022/07/28 05:51:05.453 10002 10094 Error Unity Gaia.TerrainLoaderManager:UpdateTerrainLoadState(BoundsDouble, BoundsDouble, GameObject, Single, Single, Single, Single)
2022/07/28 05:51:05.453 10002 10094 Error Unity Gaia.TerrainLoader:UpdateTerrains()

 

Remark. it would probably be negligible but I encounter the following error message also at the editor, just before the Gaia Player falls onto the terrain at the initial scene loading

NullReferenceException: Object reference not set to an instance of an object
UnityStandardAssets.Characters.ThirdPerson.ThirdPersonCharacter.CheckGroundStatus () (at Assets/Procedural Worlds/Gaia/Asset Samples/Standard Assets/Characters/ThirdPersonCharacter/Scripts/ThirdPersonCharacter.cs:221)
UnityStandardAssets.Characters.ThirdPerson.ThirdPersonCharacter.Move (UnityEngine.Vector3 move, System.Boolean crouch, System.Boolean jump) (at Assets/Procedural Worlds/Gaia/Asset Samples/Standard Assets/Characters/ThirdPersonCharacter/Scripts/ThirdPersonCharacter.cs:54)
UnityStandardAssets.Characters.ThirdPerson.ThirdPersonUserControl.FixedUpdate () (at Assets/Procedural Worlds/Gaia/Asset Samples/Standard Assets/Characters/ThirdPersonCharacter/Scripts/ThirdPersonUserControl.cs:71)

 

Finally, my mobile hardware specs.:

Samsung Galaxy A32 5G
Released 2021, January 22
CPU Octa-core (2x2.0 GHz Cortex-A76 & 6x2.0 GHz Cortex-A55)
RAM 4GB
GPU Mali-G57 MC3

[C1] Gaia Dynamic Scene Loading on Mobile.jpg

[C2] Gaia Dynamic Scene Loading on Mobile.png

[C3] Gaia Dynamic Scene Loading on Mobile.png

Link to comment
Share on other sites

Final thoughts.

@Bryan mentioned the hardware limitations. However, I believe there is a glitch with the dynamic scene loading script on mobile. The reason is the following. In the setting [1]:

- 128 x 128 square meters for each terrain block

- 3 x 3 terrain blocks being loaded at runtime.

They only occupy 384 x 384 square meters in total.

 

If I instead use a single scene of the size 512 x 512 square meters,

it works fine in the mobile hardware, too. Therefore, this problem is related to the multi-scene loading.

 

Could you please try with a random mobile platform with exactly the same setting described in the setting [1]? On top of the build environment described in

it is also in the URP set-up.

 

There are mobile MMORPGs in the market with a dynamic scene-loading to describe tens of square kilometers, no? That was my initial reasoning to go ahead with Gaia and GeNa.

Link to comment
Share on other sites

Hi @OrdemDevOps,

thanks for performing the dev build, with those error messages we should be able to crack down on this. First thing that jumps into the eye is this error message:
 

3 hours ago, OrdemDevOps said:

052323/Terrain Scenes/Terrain_1_1-20220728 - 052323.unity' couldn't be loaded because it has not been added to the build settings or the AssetBundle has not been loaded.
2022/07/28 05:51:05.453 10002 10094 Error Unity To add a scene to the build settings use the menu File->Build Settings...

Can you please double check / confirm that this terrain is part of the build settings? It it is not, this would be the cause of the error already. You can use the button on the Terrain Loader Manager to make sure all scenes from that Terrain Loader Manager are entered into the build settings:

image.png

  • Like 1
Link to comment
Share on other sites

Dear @Peter,

 

 the dynamic terrains were not the part of the scenes to build. Now I completely understood that I missed such a simple thing.

 

Also, thanks for teaching me the correct way to start troubleshooting. I see checking the Logcat as what I learned from this case.

 

 There are still a number of problems that I want to overcome.

 

--------------------------------------------------------------------------------

 

1. When I run on a mobile device after including the scenes to the build, there is an error messages in Logcat that I don't understand:

 

2022/07/28 16:24:53.684 17253 17624 Error SwappyVk Failed to wait for fence 2
 

Do you have an idea about this error?

 

--------------------------------------------------------------------------------

 

2. I turn off the development build in Unity, and then I check the performance in my target mobile, which is not super low-end in my opinion. specs.:

 

Samsung Galaxy A32 5G
Released 2021, January 22
CPU Octa-core (2x2.0 GHz Cortex-A76 & 6x2.0 GHz Cortex-A55)
RAM 4GB
GPU Mali-G57 MC3

 

Observation: FPS is too low and it even crashes when I try to move around the looking direction.

 

As I mentioned earlier, my current experiment is on a relatively small setting:

- 128 x 128 square meters for each block,

- 3 x 3 terrain blocks in the entire world,

- I added Alpine Meadow Biome, and

- and the third person Gaia Player.

 

I previously believed that this much would not be burdensome on a mobile device, but it does not seem to be the case.

 

 My aim was to make the entire world in a game as large as tens of square kilometers for mobile platforms exploiting the dynamic scene loading. I can try with even smaller terrain block size. I also can try light-baking as it would reduce the computational budget to the greatest extent, for instance, but would my goal be too ambitious to go ahead with Gaia Pro, somehow?

 

Thanks a lot for giving me advice.

 

 

Link to comment
Share on other sites

  • Solution

Hi @OrdemDevOps
 

Quote

Do you have an idea about this error?

Unfortunately not, this seems to be a generic android error about a component called swappy. I found this here:
https://forum.unity.com/threads/case-1346761-error-swappyvk-failed-to-wait-for-fence-2.1133674/
https://issuetracker.unity3d.com/issues/hybrid-renderer-vulkan-error-swappyvk-failed-to-wait-for-fence-2
 

6 hours ago, OrdemDevOps said:

but would my goal be too ambitious to go ahead with Gaia Pro, somehow?

I would say no, but you will certainly need to put a lot of work into optimization - the default spawner settings were not necessarily made to run 1:1 on a large open world mobile game. All open world games are usually created by large teams that do a lot of work on optimizing the world - finding the best graphics settings, optimizing models to use less polygons, even developing entire new tech for it. When you as solo developer say "I want to compete with that", you are taking on the job of a larger group of people essentially.

  • Like 1
Link to comment
Share on other sites

  • Bryan locked this topic
Guest
This topic is now closed to further replies.
  • 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...