Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity WebGL is actually a good platform for web games - maybe no need Core Runtime?

Discussion in 'General Discussion' started by grimunk, Mar 2, 2019.

  1. grimunk

    grimunk

    Joined:
    Oct 3, 2014
    Posts:
    274
    Unity's webGL implementation is rather good, at least in our experience with simple games. It is making me wonder if Unity's Core Runtime will bring much to the table once it's fully realized.

    We have been working with Unity for some time. Back when io games started to become significant, we decided to use the web as testbed for a multiplayer/cloud processing system we developed. We built a game, ported it to Unity, and used Unity's webGL output to build a web version. It worked without a hitch, even though we had to some work on our toolset to ensure web was properly supported. We posted the game around in early 2017 to see how it would do. We had a fair bit of fun playing, after all.

    We used Unity's new webassembly support, which was experimental at the time, but it worked fine for us. Most of the logic for the game ran on our system online, even physics, so the client just had to handle inputs, decode the network stream, render, and perform smoothing and prediction. Once we added assets, the total download size came to about 8 MB, which is large, however it ended up not being as much of a barrier as we thought. With a little finagling we managed to get our bounce rates down into the low-20s and session duration was around 5 minutes. The game made more money than it cost make and run, despite all the larger download size, though it only peaked at about 150k monthly users. The retention numbers weren't great, but that wasn't the goal. The game is http://kazap.io.

    We currently working on another game with a different studio. They wanted to make a sequel to their game, and liked some of the things we did on kazap. They were new to Unity, but we helped them along. This time, the game is 3D, uses full PhysX (from the server, not Unity), and our cloud physics/multiplayer system to drive the game logic. Thanks to the assets, the download size is now 17MB. Despite the download size it still loads and runs fast, even on low powered devices like entry level Chromebooks. It will perform even better once the assets are redone and optimized (at the moment the game uses some free asset packs). The game is http://braains2.io.

    Unity is working on their Core Runtime. It is certainly interesting, however I'm starting to doubt the necessity. All hardware, including mobile, is still getting more powerful year over year, and bandwidth is getting cheaper. Some platforms had or have restrictions on what web APIs can be used (FB messenger games, for example), but those restrictions are typically tied to overall hardware limitations, which improve over time. I get a feeling that by the time Core Runtime is a core feature, it would be unnecessary, as Unity WebGL will be more than good enough. We've been happy with the results ourselves, so far.
     
    Meltdown likes this.
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,081
    Even in its most recent state, I still have yet to have a single Unity WebGL experience that was as smooth as the webplayer. I understand the move away from that sort of plugin, but it was kind of a pretty big blow to page embedded games.
     
    Ryiah likes this.
  3. grimunk

    grimunk

    Joined:
    Oct 3, 2014
    Posts:
    274
    We've had a lot of luck with WebGL. For us, it has performed as well as desktop builds, at least on the two games we've made on it. The web player would certainly be smooth but would limit the audience, and I would prioritize reach personally.
     
  4. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,081
    I can't really prioritize reach when my experience with WebGL as somebody trying to play the games is something that has less than a 75% success rate
     
  5. grimunk

    grimunk

    Joined:
    Oct 3, 2014
    Posts:
    274
    Are you often encountering problems just loading the games or is it something else? I think I can understand that. There is a bit of configuration involved, and most people likely don't set it up properly. We'll be doing a blog post about what we did soon. We learned a lot when we did kazap.io.

    One thing I think Unity can do better is handle mobile with WebGL. It does work right now, it's just prone to issue such as running out of memory on lower-RAM devices. I think the approach to mitigate that is to submit mobile versions to the app and play stores, and if a mobile browser is detected, redirect to those store pages.