Cesium lags and messes up AI

Hi, I have a part of a city and Cesium as a background in Unreal Engine 4.27, using the latest Cesium update.
I am moving in a bird-perspective view and when I’m moving or rotating too fast the game freezes for a second (as Cesium is loading tiles) After that freeze makes all my AI freak out and shifts to a random location, flying up in the air and starts driving to their previous locations. (all Cesium collisions are turned off and I’ve tuned every quality setting, but nothing stops this freeze)
I know it is Cesium causing this as it works perfectly fine when disabled.
The Car AI is spline based so it doesn’t need a NavMesh, so it has nothing to do with rebuilding NavMeshs in runtime.

Can someone please help me with this issue?

Here’s a video of the events;

Maybe there’s a way I can just pre-load just the area I need? So it doesn’t need to spend resources streaming in unnecessary data?

Hi @HermanJarl,

Those pauses are very surprising. Is there anything in the Output Log that might give a hint about what’s happening during the pauses? Is the Cesium data just Cesium World Terrain plus Bing or something similar?

We used to see pauses like that in older versions with big photogrammetry meshes, caused by the Unreal Engine garbage collector, but recent versions of Cesium put a lot less pressure on it. Maybe just make certain you’re running the latest version of Cesium for Unreal. It should be v1.10.1.

Also, if you’ve tweaked tileset and overlay settings, I might suggest starting over by adding a clean Cesium World Terrain using the Cesium UI. A lot of the settings can cause bad performance in unintuitive ways if tweaked in a direction that “seems” like it should make things faster.

Kevin

Hello @HermanJarl ,

Just to confirm, the only 3D Tileset you are using is Cesium World Terrain? If so, test this without the Cesium World Terrain to see if you still have issues (this will let you narrow down whether it’s the city or the world terrain that’s causing issues). I would be slightly surprised if it was the terrain, we have not seen the “texture streaming pool budget exceeded” warning in quite a while after some improvements we made a few months back.

Some questions to help narrow down the issue:

  • Is the Cesium World Terrain the only 3D Tileset in the scene? Or is the city a 3D Tileset as well?
  • Do the issues persist when the Cesium World Terrain actor is removed from the scene? Check for the texture streaming warning, the gc pauses, and of course the flying cars.
  • Double check that CreatePhysicsMeshes is disabled on the Cesium World Terrain actor.

Other notes / suggestions:

  • I would not recommend using off-screen physics directly on 3D Tilesets. For your case I would double check that CreatePhysicsMeshes for all 3D Tilesets are disabled. Sometimes there are single frames where two LODs for a tile exist at once (while the LOD transition is happening). I have seen this cause strange physics issues where objects get clamped between the two LODs and catapult into the sky when the lower LOD finally disappears.
  • Another thing you can try is disabling Keep World Origin Near Camera on the CesiumGeoreference actor, although I doubt this is the cause.
  • You may also want to review the Tick logic handling large DeltaTime steps in the car movement. This can sometimes cause drastic physics issues when there is a long main thread pause since the DeltaTime will be artificially huge.

Let us know if none of these ideas lead to a solution for your case.

-Nithin Pranesh

Hi, sorry for the late reply.
The problem still persists, I’ve tried reinstalling the plugin and removing / readding the world terrain ect…
Background is the only 3D tileset, the main city is just a regular level.
It runs fine with no issues when theres no cesium in the game, but as soon as the Cesium level is loaded it starts to freeze and teleports my traffic around.
There’s no physics meshes.