Skip to content

Improving gaming on the web #786

Closed
Closed

Description

@nondebug

Description

MDN: Gamepad API, Pointer Lock API, Screen Orientation API

Specifications: Gamepad API, Pointer Lock API, Screen Orientation API

Games need reliable input APIs. Gamepad API and Pointer Lock API support are critically important for gaming on the web, especially for cloud gaming. Screen Orientation API, especially orientation locking, is important for gaming on mobile devices where orientation changes can disrupt gameplay.

Tasks:

Specification

Gamepad API, Pointer Lock API, Screen Orientation API are all Working Draft stage standards-track specifications in WebApps WG

Additional Signals

This proposal is primarily driven by feedback from web platform developers regarding a use case (gaming) which is currently too niche to rank highly on surveys. Cloud gaming operators are heavily impacted by breakage in these APIs and have highlighted the need for better testing and interoperability.

The scope for this proposal is limited to fixing the existing failing tests, but is intended as as first step toward addressing the larger issue of poor test coverage. Automated testing is limited as testing most of the API surface would require implementing new test APIs to simulate connected peripherals (gamepads) or system capabilities (pointer locking, screen orientation locking). These test automation APIs should be implemented and new tests should be written in order to continue making progress on this focus area in future Interop iterations. Specifying new test APIs requires standards work and is out of scope for Interop, but can be pursued in parallel with this proposal.

Activity

  1. rejhgadellaa commented on Oct 7, 2024

    @rejhgadellaa

    I think it's worth mentioning the Fullscreen API here. With regards to support on iOS Safari, MDN reports:

    Only available on iPad, not on iPhone. Shows an overlay button which can not be disabled. Swiping down exits fullscreen mode, making it unsuitable for some use cases like games.
    MDN: Fullscreen API

    Also see: https://webventures.rejh.nl/blog/2024/history-of-safari-show-stoppers/#anchor--2020-add-fullscreen-api-to-ios-display-fullscreen

    Update: There is a separate Interop proposal for the FS API

  2. evanjacover commented on Oct 7, 2024

    @evanjacover

    As we explore cloud gaming at Jackbox Games, these features do become more critical. We are currently taking the approach of limiting the browsers we support based on some of these features, especially screen orientation.

  3. AshleyScirra commented on Oct 7, 2024

    @AshleyScirra

    Many of the mentioned features are useful for web games made in Construct so we generally support this, but especially gamepad. In particular it would be useful to have good support for button and axis events (see w3c/gamepad#152)

  4. shalanah commented on Oct 7, 2024

    @shalanah
  5. xingri commented on Oct 8, 2024

    @xingri

    We, NVIDIA Geforce Now cloud gaming, strongly agree with the current proposal and wish to participate in activities that improve the compatibility and interoperability of APIs for cloud gaming on the web.

    As an example of cloud gaming's reliance on the Pointer Lock API, all cloud gaming providers experienced a surge in crash issues last July, as shown in this Reddit post. This tracking issue explains the root cause.

    Beyond unexpected crashes described above, the Pointer Lock API also suffers from compatibility issues across different browsers, as described in this bug report.

    We also advocate for better coverage and cross-browser compatibility for Gamepad APIs, as outlined in the issue.

    These examples highlight the very real challenges faced by developers and users due to inconsistencies and shortcomings in key web gaming APIs. Addressing these issues within Interop 2025 is crucial for the continued growth and success of web gaming.

  6. marcoscaceres commented on Oct 8, 2024

    @marcoscaceres

    Not sure if it's a stretch, but adding Screen Wake Lock into the mix might be good too. Agree that Fullscreen is pretty fundamental to all these, but could be handled by #732.

  7. AshleyScirra commented on Oct 9, 2024

    @AshleyScirra

    Also note following Chromium bugs involving Pointer Lock:

  8. gsnedders commented on Dec 5, 2024

    @gsnedders
    Member
    • Update test environments for Chromium, Firefox, and Safari to enable Screen Orientation API locking tests to pass on wpt.fyi. Currently these tests fail when run on hosts that do not support screen orientation locking.

    At least in the case of macOS, I'm pretty sure there is no concept of any orientation lock, for example, thus there's not really any way to update the test environment to achieve that. I don't know what the status quo for GNOME/Wayland or Windows is? (And changing to iOS doesn't seem like "updating" the test environment — that's a totally different test environment.)

  9. wpt-interop commented on Feb 13, 2025

    @wpt-interop
    Collaborator

    Thank you for proposing Improving gaming on the web for inclusion in Interop 2025.

    We are pleased to let you know that this proposal was accepted as part of the Gaming investigation area. You can follow the progress of this investigation area on the Interop 2025 dashboard.

    For an overview of our process, see proposal selection. Thank you for contributing to Interop 2025!

    Posted on behalf of the Interop team.

  10. AshleyScirra commented on Feb 14, 2025

    @AshleyScirra

    It looks like the investigation area is for the "Gamepad API testing" only. This proposal was a bit broader including Pointer Lock and Screen Orientation.

  11. added
    accepted
    investigation-effort-proposal
    and removed
    focus-area-proposal
    on Feb 17, 2025
  12. foolip commented on Feb 17, 2025

    @foolip
    Member

    Updated labels to reflect that this was accepted as an investigation area.

    @AshleyScirra I think you're correct that it's not the whole scope suggested, the Gamepad API is the part that we had enough support for.

    The next step here will be to create a repo for the investigation and define a roadmap.

  13. foolip commented on Feb 20, 2025

    @foolip
    Member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedinvestigation-effort-proposal

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions