Follow by Email

Friday, 28 August 2015

Unity 5 WebGL vs Web Player. 12 Pros and Cons.


Unity Web Player is up to this date still the most popular way of making your game arrive to your audience. Very often you will want to put your game Online on your Landing Page even if your game is for mobile or desktop. The Web Player is then one of your options, but not the only one. WebGL new builds are the new alternative for publishing your games in your browser. I have to admit it's very impressive and promising... But is it really superior? I tried both and I can tell you my insights... hope it will help :)

If you think one of both is absolutely better than the other, then you are absolutely wrong :)

Web Player

The good old Web Player has been with us for many years. It started fighting flash for it's piece of cake... they said flash was dead (the same with the Web Player) but it is still quite commonly used despite the fact that many platforms stop to support it (the same with the Web Player).

A bad penny always turns up... This will not be the end of the Web Player :)

PROS:
  • The veteran: been out for longer... if you run into an issue, you will have more chances of finding the fix.
  • Stable: you will run in much less bugs than in any new version of unity.
  • Super light: you may have never though about it, but since much of the logic of the game is already installed in the computer of your players, game are ridiculously small (the smaller from all the possible Unity builds)

CONS:
  • Required Plugin!: Unfortunately, in order to play your game the user has to go through the most complicated task in the universe ... install a plugin ;)
  • Expire date: one day browsers will stop to support and it will die (Chrome already did it, but you can still enable it). Update: Since September 2015 Chrome doesn't allow for manual activation of the Plugin anymore... however you can still use GameLoad (Credits to Vladimír).
  • File limitations: Unity WebPlayer has some limitations. An example is that for security reasons you cannot have local databases or any other Streaming Assets.


WebGL

The new and wonderful WebGL has come to stay. The truth is that the new compilation system for unity (ILCPP) is amazing and offers a new world of opportunities... but is it gold all that glitters? :)

When I first saw this picture, I couldn't believe it... One click for online build! :)

PROS:
  • No Plugin!: you heard right! Screw flash and screw everyone else! No more plugins for your games. :D
  • The new thing: it's no doubt that WebGL has come to expecifically replace the old Web Player. It is something that will happen sooner or later.
  • Bright future: with the presence of Google and Mozilla in the mobile market, it would not be a surprise to see WebGL working in smartphones in a few years.

CONS:
  • Slow: I am sorry to say this but it's true. At this point performance is lower than WebPlayer.
  • Super heavy: build sizes for WebGL are ridicously huge, you can reduce them a little bit and the cache helps, but still incredibly high.
  • Unrealiable:you will run into unexpected issues, bugs and runtime crashes that you will not find any solution on the Internet because they are only for this platform.


My veredict? It depends what kind of project you are doing... if it's a personal project and just want to share it quickly with few of your friends... use WebPlayer. If you are trying to show some new features of your mobile game via browser to your computer-dummy client , use WebGL. If you are trying to make a living out of this game, use both. For example, Kongregate allows you to serve the proper build of the game depending on the browser of the player. If you want to reach as many people as possible, that's the way to go :)

On the meantime I will still stick to Web Player in this blog (sorry Chrome users... :P) because even if the player needs to install the plugin is more reliable than WebGL (and far, far, far more optimized :) ) In the end, I am always old fashoned :)

Do you have any insights about what I just said? Do you disagree with me? Do you think I talk like an insane person? In any way looking forward for your comments :D

12 comments:

  1. Perfect, remove only the part about enabling unity Web player plugin in Google Chrome. It's possible, but already a bit differently . A player can use extension called GameLoad, anyway, systems block its installation for safety reasons. Of course, a player can allow the installation, if he wants.

    ReplyDelete
    Replies
    1. Thank you Vladimir!
      Already updated ;D

      Delete
  2. Interesting read indeed, thanks for taking the time to write this Juan. Also thanks to Vladimir for an alternative for the Windows/Chrome combination.

    Juan: I think is sounds a bit nicer "updated accordingly", but don't mind me that much lol - I still understood you are crediting him on the comment :)

    Quick question since I haven't really tested out yet by myself, any approximate numbers around as to how much is the difference in size say like in a percentage relation of WebGL against the good old plugin ?

    I got discouraged on the WebGL usage from the very first time I read at the forums it was meant to be a version were you be charged a separate licensing fee from Unity Technologies. I found it to be unfair, given the fact that the current plugin extension is to be obsolete at some point. I'd always feel it should be a replacement for it then in a good fashion without charging for it.

    Anyhow will try both then and see how buggy or not it can be for our game in development since I want it to be free for web browser build if possible.

    ReplyDelete
    Replies
    1. Hello CodeAssembler!

      I can give you an example of the latest gave I updated here: http://unitydojo.blogspot.com/2015/09/rombo-games-update-3-publish-or-perish.html
      Quite simple game but some textures and music that use some space:
      WebPlayer: 6MB
      WebGL: 60MB (It's important to note that the build comes with 2 folders. One has the compressed files and anothe the umcompressed. If your served has the option to serve the heavily compressed files it's 9MB. It also includes some nice cache)

      Downloading the WebGL for the first time can be 2 or 3 times slower and use 10 times more space in your server. After the first time webgl can be even faster :)

      At this time, no special lincense is needed for WebGL :)

      Delete
  3. Thank you very much I was confronted with this dilemma a short time a go and didn't know what to do. Your article helped me a lot. Big thanks :)

    ReplyDelete
  4. An interesting insight is that the latest update of Unity (5.2) reaaalllly improves WebGL performances.

    ReplyDelete
    Replies
    1. That's true! I heard from an Unity developer that 5.3 WebGL will not be preview anymore and they will soon drop support for WebPlayer!

      Delete
  5. Nice! Really cool stuff and very inspiring. Thanks for sharing this post!

    ReplyDelete
  6. Thanks for sharing your perspective.

    At Egowall.com, we are nearing the conclusion of a lengthy and challenging conversion to Unity 5 and WebGL. We've observed many of the same things you talk about here.

    We are sharing our migration story in a series of blog posts beginning at http://blog.egowall.com/blog/2016/2/19/egowall-and-webgl-part-one.

    Hope you can stop by and check it out.

    ReplyDelete
    Replies
    1. Sure thing David! Thanks for the comment :)

      Delete