- Home /
reducing WebGL startup time
Hello. It seems i have a very long startup times in the WebGL version of my game. I'm collecting analytics in the following manner: As soon as the JS wrappers starts, i save the timestamp, and as soon as the Unity engine starts running, i notify my JS code, and send the timestamp delta to the analytics engine. i get unplayable times of 80 sec and more, and i need to reduce it. I think the download itself is fast, because i'm using a CDN most of the time goes to unpacking the game in the memory. My question is what can effect this time period the most? My textures are in higher resolution then needed, but i don't have that many of them, and i know that reducing the compression type is not really reducing the total weight. What else can i do? Thanks If you wanna take a look at the game and tell me your loading experience, you can do it here: rummikub.com.
I tried your link and had too long loading time, I actually gave up... I have tried to work with WebGL for demos of my assets on the asset store and I find that they too take too long to load. I'd be very much interested in knowing what to do to reduce load times as well. I do not think the bulk of the time is actually downloading data but some other processing as it seems to me even on a very good connection the loading times are horrible. But I can't say for sure.
Answer by CirseiHyuga · Dec 01, 2017 at 12:18 PM
Hello ! I'm not very learned about webgl, but I'm working on it those days. So maybe I could help a little.
First of all, you need to enable code stripping engine et disable all kind of error exception in the player settings. Of course, this only for your final build, but it will accelerate a lot your startup time.
Also, I compared those days the brotli compression versus the gzip compression. It seems that, on firefox, my startup time was faster with gzip, even if brotli is a better compression.
I don't know if you take into account the unity splash screen, but it seems it takes about 2s to display. So, with a pro version, your startup may be shorten.
And, last but not least, you must load your assets with assets bundle. Indeed, you will be able to make a light and animated load scene to make the user wait, while your heavier assets will be load after the startup of your player. (I post an answer about issues with asset bundles and code stripping earlier : here)
I think assets bundles is the solution you need.
I hope I was able to help and my english was understandable ;)
Even with all that, there is a very long initialization period between "loaded" and when the first logo displays.
I'm following this thread in hopes of a secret to speeding this up too!
Your answer
Follow this Question
Related Questions
Is it possible to get a smooth WebGL Progress Bar? 0 Answers
AudioClips not playing in WebGL when downloaded with AssetBundles 0 Answers
What are 'Uncaught abort(x)' errors on WebGL. 1 Answer
Persistent data between different games - local save for WebGL 1 Answer
How to connect to server with a WebGL Build using Unity's Multiplayer Service, Unity 1 Answer