Mozilla is showing off its Emscripten, asm.js and OdinMonkey technologies

Mar 27, 2013 17:44 GMT  ·  By

We've been hearing about browser gaming for a few years now, that is, games built with standard web tech. But, even with WebGL, Canvas, Web Audio API, Gamepad API and huge advances in JavaScript speeds, HTML5 gaming is still not quite here.

But Mozilla is working on it and it's bringing in the big guns, literally and figuratively. Mozilla teamed up with Epic to port the Unreal Engine 3 to WebGL and JavaScript.

Epic had already ported the engine to Flash and there have been a few other attempts at building or porting a 3D game engine to JavaScript, but nothing approaching the size and scope of Unreal Engine.

There's a reason for that, porting or writing a complex piece of code like a game engine is not for the faint of heart. Likewise, running such complex code is not trivial for JavaScript engines.

But Mozilla had a trick up its sleeve, Epic's port is based on a very new piece of technology, asm.js and the OdinMonkey JavaScript engine module for Firefox. We've written about both of them earlier this week.

In essence, asm.js enables code that's been automatically ported to JavaScript from C/C++ to run almost as fast as the same code compiled as a native app. OdinMonkey adds support for asm.js, which is a subset of the JavaScript spec, to Firefox.

Obviously, a game engine is the perfect app for that. On the one hand, it's an incredibly complex app, which means it will push the JavaScript engine to the limits. On the other, game engines, Unreal Engine in particular, are designed to be ported to various platforms.

Still, the project is impressive to say the least, it took Mozilla and Epic just four days to port the code. This is in large part thanks to Emscripten, a tool for converting C/C++ code into JavaScript. The tricky part is getting this JavaScript code to run smoothly, which is where asm.js and OdinMonkey come in.

The game demo isn't ready for the public yet, but should go live in a few weeks. All in all, the project is a big boon to Mozilla's technology, it clearly demonstrates that it's a serious competitor to Google's Native Client, while using standard and open source technology.