WebOS Gaming: Could WebGL Be The Answer? 15
Gaming has always been a sensitive topic with the WebOS. HTML/CSS/Javascript leads to quick app development, but unfortunately limits game development. Palm has attempted to help, giving a Mojo animator to help with 2D animation in javascript, and setting up a game development forum section. But let's be honest, fast-paced 3D games with the current WebOS is likely to be a non-starter.
Previously we discussed Flash as possibly being solution. However, to many, Flash just isn't good enough and people kept crying out "We want OpenGL". Since Palm seems set on sticking it with html/css/js applications, that could be difficult. Or maybe not. Early last August, Khronos Group, the guys behind OpenGL, made the big announcement that they were now working on WebGL, which will bring OpenGL to the browser via javascript binds, with support from Google, Mozilla, and Opera:
First announced at the Game Developers Conference in March of 2009, the WebGL working group includes many industry leaders such as AMD, Ericsson, Google, Mozilla, NVIDIA and Opera. The WebGL working group is defining a JavaScript binding to OpenGL® ES 2.0 to enable rich 3D graphics within a browser on any platform supporting the OpenGL or OpenGL ES graphics standards.
The working group is developing the specification to provide content portability across diverse browsers and platforms, including the capability of portable, secure shader programs. WebGL will be a royalty-free standard developed under the proven Khronos development process, with the target of a first public release in first half of 2010.
Considering the WebOS is based off Linux, it certainly seems like OpenGL wouldn't be especially difficult to port to it. Then developers could use WebGL to integrate 3D graphics into their WebOS application. A surprisingly elegant solution, albeit something we'll have to wait until 2010 for.
Not too long ago we saw a Palm job posting for a Game Frameworks Engineer. We can only hope the people who work on the Mojo gaming framework plan on implementing WebGL as it becomes available. Not only would it save development time from making their own 3D graphics API, but it looks as though WebGL has the potential to be an industry standard. The WebOS has shown Palm is on the cutting edge of web-based technology, here's hoping they continue that by adopting WebGL wholeheartedly.




























15 Comments
I gotta say the simplest games are the games I find myself enjoying the most.
Though I guess this is just another thing to trout over an iPhone user.
I just love how open the Pre is. The possibilities seam endless.
I plan on sticking to WebOS for a very long time.
Let's just hope that Palm/WebOS will stick with us for a very long time too...
This is important for 2d games as well. I keep fighting with clean animations and elegance vs. performance on Word Whirl. Not a problem with having the graphics capabilities to make the simple games look good.
While this may be a way of getting 3D graphics into WebOS, I can't imagine it would be a very good solution for bringing advanced games to the Pre. It's still javascript running on top of a browser which is much more resource intensive just by itself than a natively compiled application. I just don't see the Pre being capable of handling that type of intensive processing (considering how angry it can get doing things like playing Pandora streams.)
I love WebOS, and for the interface and simple apps web-based application design was genius, but to develop anything more complex/resource intensive a lower level API really needs to be made available, with some ports of OpenGL for the underlying linux OS. I'm half expecting the homebrew folks to figure it out before palm... :)
You /can/ use scripting engines for games... But natively compile apps are always faster. More bang for your buck.
Javascript just isn't going to be as fast or efficient as something like compiled C++. (Unless they come up with a way of compiling web apps on the Pre... Which could happen. You never know.)
Not to mention, the WebOS is a lot less likely to get ported games from other devices if devs have to rewrite the thing using javascript based logic.
And there's still the problem of it having to load all the 'overhead' (webkit) to actually interpret javascript and then run the game.
All of that said, I'm perfectly happy with simple 2D games (the screen just isn't big enough to make me care...). But the device being a portable game console like the iPhone is slowly turning into is a pretty awesome feature.
I'm not saying a scripting language isn't capable of doing awesome things... I'm just saying using it for a full game will be slower than poop on the Pre. A scripted language is just not efficient enough for a complex game on very limited hardware. WebGL would help with the rendering engine, but not with any other processing. Your car will be rendered beautifully as it slowly crashes into the brick wall :).
Your examples of embedded languages are used to manipulate game functions not actually doing the heavy processing. WoW for example was mostly written in C++.
Javascript is (as far as I know?) parsed within Webkit which runs everything else GUI on the Pre, so it's the 'browser' in my previous comment. It has to be loaded for the game to run, and the game will be limited by its limitations.
Flash probably has more in common with Java than JavaScript. The flash client acts like a virtual machine, and the Action Script language is heavily based on Java. The whole thing also runs like poop on slow hardware like my poor old laptop.
Personally 3D gaming is not something that I require of the Pre. While I am a prett big gamer, the only time I tend to game on my phone is when I'm waiting in line for something or sitting on the bus, at which time I'm much happier playing something like Sudoku (omg I wish the Sudoku in app catalog wasn't so laggy... I may have to make my own...).
With that said, I recognize that 3D gaming as well as other 3D features (plenty of non-gaming apps could make great use of 3D features) are vital to the longevity and future strength of the WebOS platform as everyone wants their device to be the sexiest out there and lets face it, bright flashy things on a tiny screen in the palm of your hand is pretty damn sexy. Palm is no dummy and there is no doubt in my mind that they're working on implementing something like this.
There are a number of ways they could go about doing this. They could add OpenGL and associated APIs. These could be accessed through something like an applet in Mojo apps. Perhaps controls would still be done through normal Mojo controls and passed through to the applet via service calls. They could also improve the performance of the Canvas element in the browser. This may not allow for 3D gaming but it would certainly allow for advanced animations. And of course they could just allow native apps to run with a secondary API. This would allow for quick app development in Mojo and then more in depth development in the second SDK. I find this last option unlikely simply because maintaining 2 SDKs would be no fun at all.
The point is that it's coming. It has to in order for WebOS to survive as a platform which I'm pretty sure we all hope it does because, quite frankly, it's really cool! :)
I agree with socca1157... In a way I almost hope that advanced 3D is never possible on the Pre as I think it will make game devs think more about fun than impressing us with technology, which is an all too common failing these days.
However, it's worth noting that some intrepid developer has already ported a 3D FPS engine to JavaScript using canvas (http://www.benjoffe.com/code/demos/canvascape). Ok, so it's technically minus the "S" part :) The point is, there's some possibilities there even now.
I've done some webOS game development myself... one game, which uses canvas and is what I'd call a semi-arcade game, is part of by forthcoming webOS book (although my hope is to release the game to the homebrew community in the next few weeks, a few months ahead of the book). This experience, to me, shows that there's plenty we can do with webOS, even without WebGL or anything else. The game runs quite good, and wasn't at all difficult.
The one thing I'd LOVE for Palm to do is to provide a native threading capability in JavaScript... I just did a quick test and it looks like HTML5'w Web Workers aren't supported. THEY SHOULD BE! I think this would open up a few avenues all by itself. Especially since Palm could optimize the hell out of it under the covers, i.e., make sure each worker is truly its own thread perhaps, then we'd automatically have a significantly improved game development environment.
Define "real". Thanks.
While gaming is an important topic. The Pre's current rendering engine as it is right now is sluggish. Some developers have brought this up in the forums. Palm needs to get some kind of OpenGL or WebGL on the device in general to just improve the device's sluggish performance. While I'm not trying to put down the Pre but the some of the graphic calculations need to be offloaded from the CPU.