So I was building a web player build of a demo I was making and the file size came to around 80Mb. I was thinking to myself “Sheesh… an 80Mb download every time you open up this page? Who the hell is going to want to download 80Mb every single time they want to play the game?”
So then I built the demo using WebGL as I was curious about it. I always loved the web player so I never really bothered with WebGL since they said it was currently only supported in one browser…I mean… seriously? I have to make another copy of my game JUST for one browser? C’mon, get real. Use a different browser or don’t play my game…
But I was curious so I built my demo for WebGL and found the demo to be 500Mb. Now who in their right minds are gonna download a 500Mb file each time they want to play a game?
Does WebGL games get stored upon download? Do they stream by default? Do you just have to sit and wait for it to download? What? What’s the deal here?
Unity just announced that the web player is being marked as deprecated and soon WebGL will be our only option for web based games. Does this mean that we are limited to making PacMan, Angry Birds and other simple 1 Scene 2D games to keep the games under 100Mb or am I missing something? How can anyone justify publishing a 500Mb WebGL game when the web player build was already huge at 80Mb…
Before you say it, yes I know that the plugin installs a portion of unity and that is why the web players are smaller so by extension the WebGL versions needs to include all the code but bloody hell… from 80 to 500 is a huge leap… No way the plugin is 420Mb in size
Using the web player as a basis the WebGL builds seem super, mega, ultra huge inflated… so what am I missing? How should I be using WebGL to make it feasible to use (as 500Mb games are not) ? Is WebGL an option or does this literally mean: Make Flappy Bird clones or don’t publish for the web… ?
Nobody said it was supported in one browser…Chrome, Firefox, Safari, Edge, that’s more than one, and for the most part covers any browser that anyone would use, now that IE is defunct. Anyway, to start with you don’t use the development build, which is much larger, you use the slowest build, and you use the compressed version. (Publishing produces both uncompressed and compressed, which tends to be around 1/4 the size in my experience). Also you break things up so you don’t have to download the entire thing up-front, and stream data in as needed, which is also what you should do with the web player.
Back when I looked at WebGL it was only supported by Chrome and so I immediately lost interest as I only ever used Safari and Firefox. Never really cared for Chrome. Never looked at it again since… well, till recently. And according to Unity’s post it seems it is/will be supported by everything so guess I have to take an interest in it now… and the depreciation plays a bit of a factor also
I am a tad confused by the main part of your message, though… i never build with the development build option (unless that day I didn’t look) but am i to understand what you are saying is that if i tick the development build option on or off, that will compress the game by up to 75%? Really? Well THAT is bloody amazing! If it’s that simple then i think you have just answered my question. Thanks for that.
I released another demo a while ago (actually made it public, not just for my own testing purposes) ad had the streaming option on. So the first level loads, it plays the background music and shows people the menu options and when they click play, nothing happens because scene 2 (which has all the content in it) was still busy loading. So many emails about “Your demo is broken. Nothing happens” followed by “Please continue to click. The scene will load once it’s finished streaming in. Just wait a minute or two” responses… suddenly I lost my love for the streaming option…
Again, thanks for that tip. I’ll make SURE next time I build that scene to check of developer build is disabled.
Nope. The development build is one thing (don’t use it for distribution, since it’s larger), the compressed/non-compressed is a separate thing. As I said, it builds both; there is a release folder and a compressed folder. Note that using the compressed build requires some server setup.
When streaming, give some indication as to progress; don’t just have it hanging there loading.
Seems I got some learning to do still… i know about using the LoadAsync thing but I had no idea that if I set the webplayer to stream in the build settings that I can actually see the loading/streaming progress once it started playing the first scene…
The idea of showing level 1 and saying in the top left corner “Rest of the game is still downloading and at 15%”… I didn’t think I could do that. Not that that really helps me in determining when scene 2 is downloaded and ready to start, though… guess I need to go do some more learning about this.
I seriously didn’t know I can see the download status of the game… I always see the loading bar and when it gets to 100% then scene 1 shows. From there I thought it was up to me to load the other scenes and show the loading progress while I do… I had no idea there was an option to show (in game) how far the rest of the game download has progressed… I don’t suppose you could point me in the right direction in the docs,can you? Just look under Application or… ?
Edit:
Application.GetStreamProgressForLevel(string levelName) … nice…
Application.CanStreamedLevelBeLoaded(int id) …very nice…!
Application.streamedBytes… interesting…
Now all that is needed is Appplication.totalSize
Thanks Eric. I’m glad I made this post tonight. Actually learned something. Like a friend recently said: “RTFM”