I work with Unity 2018.3. I did all my possible to reduce loading time of my game but it still too long for computers and even worse for mobile phones.
Does the new version of Unity improve really the loading time in WebGl ?
I have to change a lot of things on my current project to make it working with the last version of Unity so I would like to know before losing time on it.
To my knowledge Unity 2019.1 just makes WebAssembly the default. We’ve had the ability to enable it though (at least as far back as Unity 2018.2) and anyone that has should already have been seeing their game load times decreased.
2019.1 also introduces the ability to use streaming instantiation, which while it somewhat improves initial load times (compiles as it downloads), also comes with the benefit of browser vendors taking this a step further and caching the compiled output specifically for this format. On Chrome 76 I’m finding subsequent page visits load within 1 or 2 seconds which is a huge step up from the previous 5 or 6 seconds I’m used to.
Yes, you will have to serve the .wasm file that is produced with the Content-Type: application/wasm header. Also if you’re using compression you’ll have to ensure the correct Content-Encoding header is also set on this file (eg gzip or br) which is not optional for this file, else the streaming instantiation will not succeed.
It’s not a Unity specific feature so there should hopefully be appropriate guides for this for whichever server you happen to use - Nginx, Apache, AWS S3 etc.
Has anyone had any luck with this. I have made the changes to get IIS to respond with the proper content-encoding header, which gets you past the “magic number” error, but then you run into the error “net::ERR_CONTENT_DECODING_FAILED” when it is trying to download the unityweb or wasm files