wrld3d / unity-api

Issue tracking for the WRLD Unity SDK
28 stars 8 forks source link

Long map initialisation #110

Closed PrisedRabbit closed 3 years ago

PrisedRabbit commented 3 years ago

Description

Long WRLD map initialisation. I faced with long WRLD map initialisation. No matter which OS and platform. Often I have to wait for 1 minute It Looks like server's issue.

Steps to Reproduce

Create empty project. Import WRLD SDK. Run UnityWorldSpace scene. Stop. Run again.

Expected behavior: map should load after run the app

Actual behavior: map loads after 1 minute

Reproduces how often: 80%

Additional Information

Any platform, any Unity version, any WRLD SDK version.

ArslanJafri commented 3 years ago

The time it takes to load map for any area is very much dependent on the internet speed as we have to stream resources in before they can be displayed. It is possible to cache resources so it loads much faster once the resources are downloaded. You can find an example of precaching here: https://www.wrld3d.com/unity/latest/docs/examples/precaching-map-data/

PrisedRabbit commented 3 years ago

I have 250 MBit/s internet connection, also tested on LTE. The problem occurred 3 week ago. Sometimes the map appears in a moment after start, but sometime in a minute. Precaching map data doesn't help.

ArslanJafri commented 3 years ago

Can you provide us the following details so we can further investigate this issue?

I have shared the details with our engineering team so we can investigate and resolve the problem.

PrisedRabbit commented 3 years ago

Yes, the problem still occurring about 3 weeks. I'm testing my app on New York. The start location is on Empire State Building. But the problem also in SDK's default locations, even on empty project.

I've been working with WRLD SDK from April 2020, without any issues.

PrisedRabbit commented 3 years ago

Right now I made 5 runs: 3 times - instantly, 2 - up to 1 minute idle.

ArslanJafri commented 3 years ago

We are having trouble reproducing this issue. We have tested with Unity 2020 and Unity 2019 LTS with WRLD Unity SDK v0.8.17. I understand that you have mentioned that you are seeing this issue on all platforms but just to try and narrow down the problem, can you provide us with the following information?

Which city and country you reside in? In case this is an issue with our CDN's cache for your region resulting in delayed load time for map resources. OS information (e.g. Mac OS 10.15.7). Unity version (e.g. 2020.1.0f1). WRLD SDK Version (e.g. v0.8.17). Selected platform in Unity Editor(Android, iOS etc)

It would also be very helpful to us if you can provide a minimal repro project in which the issue occurs or a video showing the problem.

Another thing that I would suggest trying is clicking inside the Game View in Unity after pressing play in Unity Editor. WRLD Maps do not stream if the game view is out of focus so it could appear the stay idle until game view comes back in focus.

PrisedRabbit commented 3 years ago

My location is Russia, Izhevsk.

Mac OS Big Sur 11.0.1, Unity 2018.4.30, 2019.4.15, 2020.1.15 Mobile devices with iOS 14.2, Android 10. Wifi and LTE. WRLD SDK Versions 8.0.14, 8.0.17, 8.0.37

Empty project with SDK only.

May be I can sniff the network packages and found some informations? What network address to check?

Video: https://monosnap.com/file/aE8wlb1jaT5MByAmo24GF6j6c0hgZ5

PrisedRabbit commented 3 years ago

It is really looks like CDN issue. Just tried with VPN connection from other country - no issue! Pls check Russian CDN

ArslanJafri commented 3 years ago

From the video it looks like you are clicking on other windows immediately after pressing play. The map loads fine when the game window is in focus. But whenever you click a GameObject in the hierarchy for example, the game windows is no longer in focus and the map does not update until you click back on the Game window bringing it back in focus.

Whenever you just press play and wait the map loads immediately as seen in the video. I understand that this is an esoteric behavior but as I mentioned in my previous response, WRLD Map stops streaming if the Game windows is out of focus.

This is only relevant in Unity Editor and will not be present in any Builds you make with WRLD Unity SDK. I will suggest our engineering team to look at improving this behavior or perhaps make it more prominent in our docs to avoid any confusions.

PrisedRabbit commented 3 years ago

I know. I keep GameVIew in focus. Anyway, I found that there are no issues with VPN. Pls check your CDN.

ghost commented 3 years ago

As far as we can see, once the map starts loading (black/blue grid appears) all of the resources arrive very quickly, so it's likely not an issue with the CDN. The first thing the app does before the map starts is authenticate itself with WRLD.

Can you try running the following command in the terminal and see if there is a delay returning a result?

curl -v https://apikey.wrld3d.com/validate/?token=YOUR_API_KEY_HERE

Some other things you could investigate:

PrisedRabbit commented 3 years ago

The issue is still here.

I caught this:

image

This response appears after map is loaded. If map loading has delay, the response has too.

ghost commented 3 years ago

Hi, that DNS request looks normal. Did you try any of the debugging steps I suggested earlier?

PrisedRabbit commented 3 years ago

I found the issue:

server-13-33-243-111.hel50.r.cloudfront.net is unreachable from my place.

image

image

When map loading has a delay I see "server-13-33-243-111.hel50.r.cloudfront.net:https (SYN_SENT)"

UPD: 13.33.243.111 it's not pingable, but with VPN it's pingable

UPD2: So, this ip is blocked in Russia by the tribunal's decision in 2013 :(