W3C Games Workshop — Report

François Daoust — W3C

Copyright © 2019 W3C ® (MIT, ERCIM, Keio, Beihang)

Games Workshop
outcomes

François Daoust
fd@w3.org / @tidoust

Workshop

Thanks Microsoft for hosting, and Facebook gaming for sponsoring!

Web games

New technologies
A lot of progress since 2011!
HTML5, Workers, WebAssembly, WebRTC, Gamepad, Pointer lock, WebGL, WebXR
New paradigms
No install
WebAssembly
Cloud gaming
New hosted environments
E.g. Facebook Instant Games, Baidu Smart Games, Tencent's WeChat Mini games
New problems
Discoverability, monetization, user engagement
Asset loading, I/O latency, efficient threading

Threading

Problem
  • Lots of processing of the scene graph need to happen on the CPU (e.g. frustum culling)
  • Parallelization of these operations is possible...
  • but workers can only share messages or unstructured shared memory buffers
Ideas
  • Add a mechanism to share structured memory across threads
  • Also revisit starting point of workers so that they can take a function (instead of a file)

WebAssembly

Problems
  • Web APIs calls from WebAssembly code are inefficient, which affects Web APIs integration in game engines that take C++ et al. as input.
  • Debugging C++ code compiled to WebAssembly is hard
Ideas

3D rendering

Problems
  • Various GPU native texture formats to support (PVRTC, ASTC, etc.)
  • 3D rendering on the Web not on a par with native 3D rendering
Ideas
  • Compressed Texture Transmission Format (CTTF) in glTF (Khronos Group)
  • WebGPU to expose a common abstraction on top of different hardware. On its way, but shading language still under discussion.
  • Create a 3D scene element for the Web? See Native glTF discussion in Immersive Web CG
  • Consider metadata definitions for glTF to expose semantics of 3D scenes, notably for accessibility purpose
  • Establish a liaison with Khronos Group to discuss previous points

Assets loading & storage

Problems
  • 20% of potential players disappear before the game starts for a 10MB download
  • Quota and bucket restrictions make it hard to store data permanently
Ideas
  • Educate game developers on Web specificities (no install)
  • Multiple buckets per origin to distinguish between permanent resources and resources for cache (in Background Fetch)

Accessibility

Problems
  • Games are meant to be challenging. The way to make games accessible varies from game to game
  • How to provide semantic information to assistive technologies when there is no DOM?
  • How to provide semantic information when underlying code is written in C++?
Ideas

Audio

Problem
  • Tons of audio-processing code and libraries written in C/C+, and used in games
  • Hard to port to the Web dues to lack of low-level audio I/O API
Ideas
  • Better threading support on the Web
  • Audio Device Client (ADC) to provide atruly low-level audio I/O

Gamepad support

Problems
  • Gamepad API stalled for years
  • Practical limitation of the API as controller buttons may be exposed differently to applications
  • No support for modern controller features: touch surfaces, light indicators, haptics, accelerometer, etc.
Idea
  • Finalize first level of Gamepad API
  • Start work on second level to support modern gamepad features, starting with touchpad support and light indicators

Inputs

Problems
  • Browsers align input events with requestAnimationFrame. Makes sense for local rendering, not for cloud gaming
  • All input events have to go through the main thread
  • Mouse events are accelerated, which makes it hard to use them in FPS
Ideas
  • The Input for Workers and Worklets proposal to allow input events to reach workers directly
  • Expose new raw events, triggered immediately (noting that, by definition, this affects performance)
  • Add support for unaccelerated mouse events in Pointer Lock

Low-latency streaming

Problems
  • Cloud gaming requires ultra-low latency streaming mechanisms
  • No way to fine-tune encoding/decoding parameters for cloud gaming with a WebRTC solution
  • No good control over the amount of frames buffered before playback in MSE
Ideas
  • WebTransport: based on QUIC, closest mechanism to a UDP version of WebSockets, pluggable congestion control. Under incubation in the WICG.
  • Webcodecs: an API to expose media encoding/decoding capabilities of the browser. Proposed to WICG but needs support to move on.

Web games in hosted apps

Problems
  • WebView not always on a par with the Web environment
  • Some APIs not available in WebView (for good reasons)
  • Some APIs only available in hosted environments but could be useful in a broader context
Idea
Explore how hosted environments and the Web at large may converge longer term

Discoverability & Monetization

Problems
  • Easy for games to disappear among other types of content
  • Hard to monetize content on the Web
Ideas
  • Extend metadata formas, notably schema.org to describe games capabilities (category, input controllers, offline support, monetization scheme)
  • Discuss monetization for games on the Web, including the Web Monetization proposal and support for rewarded video ads

A game activity at W3C?

Volunteers needed in any case!

Planned at TPAC

Breakout sessions
Group meetings
  • Audio Working Group
  • WebApps Working Group (Gamepad, Pointer Lock)