The Next Generation of Web Gaming

Over the last few years, Mozilla has worked closely with other browsers and the industry to advance the state of games on the Web. Together, we have enabled developers to deploy native code on the web, first via asm.js, and then with its successor WebAssembly. Now available in Firefox and Chrome, and also soon in Edge and WebKit, WebAssembly enables near-native performance of code in the browser, which is great for game development, and has also shown benefits for WebVR applications. WebAssembly code is able to deliver more predictable performance due to JIT compilation and garbage collection being avoided. Its wide support across all major browser engines opens up paths to near-native speed, making it possible to build high-performing plugin-free games on the web.

“In 2017 Kongregate saw a shift away from Flash with nearly 60% of new titles using HTML5,” said Emily Greer, co-founder and CEO of Kongregate.  “Developers were able to take advantage of improvements in HTML5 technologies and tools while consumers were able to enjoy games without the need for 3rd-party plugins.  As HTML5 continues to evolve it will enable developers to create even more advanced games that will benefit the millions of gamers on Kongregate.com and the greater, still thriving, web gaming industry.”

Kongregate’s data shows that on average, about 55% of uploaded games are HTML5 games.

And we can also see that these are high-quality games, with over 60% of HTML5 titles receiving a “great” score (better than a 4.0 out of 5 rating).

In spite of this positive trend, opportunities for improvement exist. The web is an ever-evolving platform, and developers are always looking for better performance. One major request we have often heard is for multithreading support on the web. SharedArrayBuffer is a required building block for multithreading, which enables concurrently sharing memory between multiple web workers. The specification is finished, and Firefox intends to ship SharedArrayBuffer support in Firefox 55.

Another common request is for SIMD support. SIMD is short for Single Instruction, Multiple Data. It’s a way for a CPU to parallelize math instructions, offering significant performance improvements for math-heavy requirements such 3D rendering and physics.

The WebAssembly Community Group is now focused on enabling hardware parallelism with SIMD and multithreading as the next major evolutionary steps for WebAssembly. Building on the momentum of shipping the first version of WebAssembly and continued collaboration, both of these new features should be stable and ready to ship in Firefox in early 2018.

Much work has gone into optimizing runtime performance over the last few years, and with that we learned many lessons. We have collected many of these learnings in a practical blog post about porting games from native to web, and look forward to your input on other areas for improvement. As multithreading support lands in 2018, expect to see opportunities to further invest in improving memory usage.

We again wish to extend our gratitude to the game developers, publishers, engine providers, and other browsers’ engine teams who have collaborated with us over the years. We could not have done it without your help — thank you!

About Andre Vrignaud

Andre Vrignaud works as Mozilla's VR, AR, and Games Platform Strategist, with a focus on empowering web developers, publishers, and tool creators by enabling high-end, plugin-free games and WebVR experiences on and across billions of connected devices. With a side of net neutrality and privacy advocacy.

More articles by Andre Vrignaud…


3 comments

  1. Andrew Wooldridge

    As a thought leader in the world of web gaming, I hope that you all are reaching out to the folks who build web game engines like Unity, Construct2, PhaserJS, and Gamemaker to make sure that they are making the best use of the latest technologies to make the games they generate the fastest, most performant that they can. It would be great if there was a baseline game that Mozilla created the specs for, that each engine maker could implement in their own engines to compare and identify performance issues.

    July 20th, 2017 at 11:59

    1. Andre Vrignaud

      Andrew, we have indeed been working with folks all across the industry, including many of the web game engines you mention. They’ve been great partners, and you can see the results in their support for the web. We’re web developers and not game developers, so we prefer to work with game developers and engine providers to make their real-world products work well (versus optimizing around whatever strange gamelike thing we might come up with). But rest assured we are deeply engaged with the industry!

      July 20th, 2017 at 16:06

  2. WebGL user

    Hi,

    When is plan plan to move to OpenGLES 3.1, that would bring Compute Shaders.

    July 29th, 2017 at 08:20

Comments are closed for this article.