CesiumGS / cesium-unity

Bringing the 3D geospatial ecosystem to Unity
https://cesium.com/platform/cesium-for-unity/
Apache License 2.0
358 stars 84 forks source link

Tiles loading and unloading based on amount of requests #519

Open electrum-bowie opened 4 weeks ago

electrum-bowie commented 4 weeks ago

It seems like when a tile is requested multiple times by multiple clients it can start disappearing and reappearing for everyone at that location

https://github.com/user-attachments/assets/10e5a0f6-5d63-4832-9076-9eb03e04eedc

If it's not fixable, can I at least know why this is happening ?

kring commented 2 weeks ago

That's not a problem I've seen, and I don't know what would cause it. Can you help us reproduce it ourselves? The first thing, of course, is to see if there are any messages in the log that might offer a hint.

electrum-bowie commented 2 weeks ago

Can you help us reproduce it ourselves?

I can't provide anything useful in terms of source files, and I don't have the time to do debugging unfortunately.

However, based on my experiences with the issue, I'm 80% confident it's some kind of Tiles API overload that confuses Cesium and hides a tile, similar to the issue where tiles slowly disappear after returning to a unity player that has been in standby for a longer time ( 1+ hours or so ), so that's why I'm pretty confident it's a random / meaningless error that could be skipped if handled correctly.

It never happens on regular usage, as you may already know, it only occurs when 2 or more clients rapidly requests tiles at a same place, so if my theory is correct, you may easily be able to reproduce this with a simple multiplayer scene with a minimum of 2 clients ( the more clients the more likely the issue will occur ) or other, simpler ways to imitate the same behavior.

kring commented 1 week ago

I'm 80% confident it's some kind of Tiles API overload that confuses Cesium and hides a tile, similar to the issue where tiles slowly disappear after returning to a unity player that has been in standby for a longer time ( 1+ hours or so ), so that's why I'm pretty confident it's a random / meaningless error that could be skipped if handled correctly.

I'm not sure if this is what you're referring to, but it is true that the Google Photorealistic 3D Tiles token times out after a certain amount of time, and we don't currently have a way to refresh it. That issue is documented here: https://github.com/CesiumGS/cesium-native/issues/749

It's also true that tile load failures will manifest as missing tiles. I don't know why tiles would be failing to load for you, though. If you are using Google Photorealistic 3D Tiles (I don't think you've said, but it looks like you might be), certainly Google's server should be reliable even with multiple clients hitting it simultaneously.

There should be a message in the log when tiles fail to load.

you may easily be able to reproduce this with a simple multiplayer scene with a minimum of 2 clients ( the more clients the more likely the issue will occur ) or other, simpler ways to imitate the same behavior.

That may be, but if we took the time to build elaborate scenarios to try to reproduce every bug report we got from users, we wouldn't have any time left to actually improve Cesium for Unity. If you'd like our help to fix this, I'm afraid you'll have to help us reproduce it. If it's not currently important enough to you to be worth the time investment, that's fine, too.

electrum-bowie commented 1 week ago

Thank you, yeah please leave this case open so I may leave potential useful info in the future.