Search Unity

First contact

Discussion in 'Web' started by ShabihDesperado, Mar 4, 2015.

  1. ShabihDesperado

    ShabihDesperado

    Joined:
    Oct 27, 2013
    Posts:
    41
    Hi!
    I open this thread because I'm playing for first time with WebGL in unity 5. First thing I saw is that there is not any streamed option like in webplayer. What do you think about WebGL? It works well for you? Any idea to powered our games?
     
    Last edited: Mar 4, 2015
  2. ShabihDesperado

    ShabihDesperado

    Joined:
    Oct 27, 2013
    Posts:
    41
    Another point: Weight. The weight of my project is about 23 Mb for the web player. If I try to compile the same project (with no optimizations) in webgl the weight is increased until 338Mb. It's crazy, someone try to optimize the project? What did you get?
     
  3. lami

    lami

    Joined:
    Jun 17, 2013
    Posts:
    17
    Hi!

    Have a look in the folder of your build. There you should find a folder named "Compressed". Unity uses Gzip compression to reduce the sizes. So if you configure your webserver to serve gzip compressed content, this will be the size that will actually be sent over the network.
    To further reduce the size you should do an optimized build and enable the bytecode stripping in the player settings.
    Also have a look if you can further compress your assets (e.g. sprites,...). My game still looks quite nice and size was reduced by another few MB.
    Finally keep in mind that your webgl build also contains the UnityEngine. As far as I know Unity should strip code which is not used. E.g. if you don't you use Physics3D make sure it is not referenced somewhere in your code so it can be stripped outt. But I'm not sure how far this is implemented in Unity right now!

    My project which has a Webplayer size of approximately 10MB is down to roughly 28MB (size of complete Compressed folder) but I haven't enabled SpriteAtlas compression in the WebGL version right now. So there might be a reduction of a few MB still possible.

    Regards,
    Stefan
     
  4. ShabihDesperado

    ShabihDesperado

    Joined:
    Oct 27, 2013
    Posts:
    41
    I didn't find that folder. I'm gonna try again, maybe it's an option that I should active before to build. Anyway are great news. I'm really thinking to use this technology for my commercial games as soon as possible.
     
  5. ShabihDesperado

    ShabihDesperado

    Joined:
    Oct 27, 2013
    Posts:
    41
  6. lami

    lami

    Joined:
    Jun 17, 2013
    Posts:
    17
    As far as I know AssetBundles are supposed to work! But haven't tried it right now.
     
  7. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    Dustin-Horne and Onsterion like this.
  8. ShabihDesperado

    ShabihDesperado

    Joined:
    Oct 27, 2013
    Posts:
    41
    Thank you! I'll try it (or maybe not, I was thinking to do it myself :p)