Platform/AreWeFunYet

From MozillaWiki
< Platform
Revision as of 18:14, 15 November 2011 by Jbuck (talk | contribs) (API rename)
Jump to navigation Jump to search

The purpose of this page is to track progress of the open Web platform toward being ready for gaming, track browser implementation status, and compare to competing technologies.

The goal is twofold: make sure we keep in mind what game developers need; and inform game developers of the recent and ongoing progress made by the open Web platform.

By 'the Web platform' we mean technology that's implemented in multiple browsers (or will soon be): JavaScript and DOM APIs. The competition is proprietary or single-implementation platforms: proprietary plugins like Flash, Silverlight, JavaFX (?), the Unity3D plug-in, Google-only technology like NaCl, etc.

Desktop and console platforms are outside of the scope of this page. Perhaps it would still be useful to compare to Android / iOS application platforms as phone games are typically good candidates for doing as Web pages.

Each section of this page is about a feature that's required to enable gaming.

Fast code

Web technology: JavaScript

Competition:

  • ActionScript in Flash
  • C# in Silverlight

JavaScript has been speed up by orders of magnitude over the past few years.

Here is a benchmark comparing ActionScript to several JavaScript engines. It shows that as of June 2011, JavaScript is faster than Flash 10.3 in all major browsers.

TODO: Find/generate more benchmarks? At least update that one to include Flash 11 and the latest JS engines (Firefox 9 with TI) ?

  • In order to maintain smoothness, talks at the New Game Conference discussed the need to minimize load on the JS garbage collector.
    • This leads to reusing objects by assigning them to static/global variables.
    • Improving the speed of GC or good incremental GC could solve this.
    • Ability to manually free objects would also work.

Fast/3D Graphics

Web technology: WebGL.

WebGL is enabled by default in Firefox (4+), Chrome (9+), Opera (12+) on all desktop operating systems and Android. It is available but not enabled by default in Safari 5.1, and available for ads on iOS.

Competition:

  • Stage3D in Flash 11
  • XNA 3D in Silverlight 5
  • Unity3D

The first two graphics APIs are very comparable since they stay very close to OpenGL ES 2.0 functionality (or Direct3D equivalent). WebGL has some extra flexibility and advanced features (more general shaders than Flash and Silverlight, bigger textures than Flash, etc). WebGL does not yet have compressed textures, however this is under discussion.

There shouldn't exist any meaningful speed differences between these 3D APIs per se. Speed differences would more likely be caused by language/compiler differences (JS vs AS, etc).

Audio

TODO: fill this section

  • Mozilla has a Audio Data API; WebKit has Web Audio API; provide links; discuss ongoing convergence efforts?
    • Is our own Audio Data API really up to the task? 3D positional sound is a requirement.
  • implementation status in browsers?
  • equivalent in Flash, Silverlight?
  • Talks at New Game Conference pointed to WebKit's Web Audio API as the best of the existing solutions.
    • It has lower latency, and more powerful out-of-the-box.

FullScreen

TODO: fill this section

  • link to the Fullscreen spec, mailing list, any useful resources
  • implementation status in browsers?
  • equivalent in Flash, Silverlight?

MouseLock

TODO: fill this section

  • link to the MouseLock spec, mailing list, any useful resources
  • implementation status in browsers?
  • equivalent in Flash, Silverlight?

Relevant links:

Gamepad

Web technology: GamepadAPI.

The Gamepad API is currently under development in Firefox and Chrome. Firefox builds are available for download here. Chromium builds need to have --enable-gamepad (?) passed on start-up. This API is currently in W3C draft status

Competition:

  • Nothing native. Only apps, like Xpadder that map gamepads to keyboard/mouse events.

Relevant links:

Local file storage

TODO: fill this section

  • Appcache, IndexedDB
  • What do game developers really need?
  • equivalent in Flash, Silverlight?

Device orientation control

Ability to block, define and get informed when the device orientation changes. Basic use case is for a game that has to be played in landscape mode. The game should lock the orientation to landscape mode even if the device is currently in portrait mode.

TODO: fill this section

  • link to a spec for the web
  • equivalent in Flash, Silverlight, iOS, Android?

Game-oriented documentation

TODO: fill this section

  • Tutorials
  • Example games
  • Articles in Gamedev.net, Gamasutra, etc.