Sign in with
Sign up | Sign in

Mozilla Ports Full FPS Engine to WebGL; Playable Demo

By - Source: Mozilla | B 14 comments

Here's a full game engine written in C++ ported over to HTML5, WebGL.

Firefox developer Mozilla updated its blog with news of BananaBread, a first-person shooter that runs within a browser without the need to install plugins. To make the demo happen, the team said it ported a complete C++ game engine -- the open-source Cube 2: Sauerbraten -- to JavaScript and WebGL using Emscripten. The project required very few code modifications to the original game, the team said, which demonstrates that porting games to the Web does not have to be difficult.

"The project has several goals," reads the BananaBread blog. "First, to serve as a testcase for running a demanding 3D game in browsers: Having a working testcase lets us try out new browser features and to profile performance in order to make browsers faster. Another goal is to prove that games of this nature can run in JavaScript and WebGL, which many people are skeptical about. Finally, all the code in this project is open (and practically all the art assets), so others can learn from this effort and use this code to create their own browser games."

Here are all the technologies that Mozilla's Firefox 15 is now using to bring top-notch games to browsers:

* Game focused performance improvements to JavaScript, many inspired by games and demos that we saw on the Web or that developers sent to us for testing
* Wide range of WebGL performance improvements
* High precision timing
* Compressed texture support on desktop
* Smoother JavaScript execution on large code bases
* Hardware acceleration of 2D canvas on desktop
* FullScreen API
* PointerLock API (special thanks to David Humphrey and students at Seneca College)
* OrientationLock

"One of the main goals of the Mozilla Community working on games is to not only drive game development on Firefox but across all browsers," Mozilla said. "Any browser that has implemented the necessary modern Web standards used by the BananaBread demo can run it. These efforts help us stay in touch with how HTML5 is coming together and see opportunities where we can make developers’ lives easier. Hearing directly from the HTML5 game developer community is a key part of how we learn what needs to be done."

Mozilla's new BananaBread demo offers three playable maps against bots: Arena, Two Towers and Lava Chamber (Quake fans, are we?). If the demo isn't loading even though Firefox 15 has WebGL enabled, then the browser might have your GPU blacklisted anyway. Mozilla will blacklist a specific GPU based on its driver version:

Nvidia: requires driver numbered 8.17.12.5721 or greater
AMD: requires driver numbered 8.741.0.0 or greater
Intel: requires driver number 6.14.11 on XP, 7.15.10 on Vista, and 8.15.10 on Windows 7

OF course, this becomes a problem when hardware vendors and OEMS stop producing drivers for legacy products (older cards, laptops, etc.). There's a workaround/blacklist bypass in Firefox, but proceed at your own risk -- we don't take responsibility for any flaming GPUs. Simply click on the address bar in Firefox and type about:config. After that , make the following three changes:

* To enable WebGL, set webgl.force-enabled to true
* To enable Layers Acceleration, set layers.acceleration.force-enabled to true
*
To enable Direct2D in Windows Vista/7, set gfx.direct2d.force-enabled to true

If the demo performs like you're moving against a nasty rip current (below 20fps), then there's probably a good reason why Mozilla blacklisted your GPU.

 

Contact Us for News Tips, Corrections and Feedback

Display 14 Comments.
This thread is closed for comments
  • 8 Hide
    CaedenV , August 29, 2012 2:15 PM
    Very cool.
  • -8 Hide
    tomsreader , August 29, 2012 2:38 PM
    where's the link to download the game?
  • 3 Hide
    amk09 , August 29, 2012 2:53 PM
    Was waiting for something like this. It runs good, I was playing it on an i3-2120 with HD2000 graphics. The developers did it well and I like where this could go.
  • 0 Hide
    mayankleoboy1 , August 29, 2012 3:03 PM
    Quote:
    Nvidia: requires driver numbered 8.17.12.5721 or greater
    AMD: requires driver numbered 8.741.0.0 or greater
    Intel: requires driver number 6.14.11 on XP, 7.15.10 on Vista, and 8.15.10 on Windows 7


    nice copy paste.
    What driver package versions do these numbers match to ?
  • 5 Hide
    greghome , August 29, 2012 3:04 PM
    now.......this is gonna be a browser based game worth playing.....
  • 4 Hide
    SirTrollsALot , August 29, 2012 3:20 PM
    Donate to Mozilla or maybe they should create something on Kickstarter just for kicks to see how much they raise... I'd bet multimillions! Cause this would be cross platforms compatible!
  • 2 Hide
    nukemaster , August 29, 2012 4:09 PM
    greghomenow.......this is gonna be a browser based game worth playing.....

    Nvidia
    257.21
    AMD
    10.6

    https://wiki.mozilla.org/Blocklisting/Blocked_Graphics_Drivers

    Interesting little game.
  • 0 Hide
    sojrner , August 29, 2012 4:10 PM
    running core i7 laptop, Nv quadro FX 880M w/ driver version 8.16.11.8974

    I was not blacklisted, everything ran fine.
  • 0 Hide
    sojrner , August 29, 2012 4:12 PM
    mayankleoboy1nice copy paste. What driver package versions do these numbers match to ?


    In windows, run dxdiag to get your actual driver version number, not the main package number.
  • 0 Hide
    mitch074 , August 29, 2012 7:03 PM
    Then I guess we can put it down once and for all: in all, yes, if ported it could run Crysis.
    ===>[]
  • 0 Hide
    A Bad Day , August 29, 2012 9:15 PM
    I pity those who have computers which only have one or no GPU driver updates.
  • 0 Hide
    badhomaks , August 30, 2012 2:12 AM
    mitch074Then I guess we can put it down once and for all: in all, yes, if ported it could run Crysis.===>[]

    I don't even want to think the amount of textures needed to be downloaded and the bandwidth that it will waste every time you play it.
  • 0 Hide
    groveborn , August 30, 2012 4:55 AM
    Works well, except for the auto search. If you have it enabled, it'll try to find whatever you type (such as w) on the page. It eventually crashes due to that.
  • 1 Hide
    blazorthon , August 30, 2012 4:23 PM
    badhomaksI don't even want to think the amount of textures needed to be downloaded and the bandwidth that it will waste every time you play it.


    Compression and such can probably go a long way. Also, think about the implications with home servers and for how very high-speed internet that we're working towards could help too.