Saturday, March 17, 2012

HTML5 vs. Adobe Air 3.2


I know HTML5 backwards and forwards, and so I get to talk about it pretty often. I’m not really an HTML5 partisan like some, it’s just a convenient way to create some forms of content, and games can fall into that bin. The promises of HTML5 are somewhat predicated upon the decline of Flash, which has been a given in Jobs’ iOS era. (Speaking of those promises, they tend to be “write-once, run everywhere”; ironic as that was Java’s brand marketing, and probably C’s at some point) But as Flash falls out of popular opinion and HTML5, Dart, NaCl come onto the stage, it’s important to ask the question, is Flash no longer viable from a game development platform standpoint?

The factor behind Flash’s decline has been the rise of mobile and mobile gaming. Flash is not good for resource-constrained devices. It was designed for PCs, it has PC-like memory requirements, and it makes enormous demands on the CPU while virtually ignoring the GPU. This made sense in the desktop world of 199x. Well, actually it didn’t, Flash has never been architected optimally for game development, it has always had these problems. We just didn’t care so much because it worked well enough, and the oh so critical to adoption video codecs gave it an install base that became every online computer in the world. And once it was there, might as well leverage it for the interactive 2d content experience it could provide and the cross platform compatibility ever so lacking in the browsers themselves.

Adobe hasn’t shown much leadership, either. They’ve never prioritized the features, release schedule, or platform commitments necessary to please traditional game developers, much less mobile game developers. Prior to this week’s research, I’d have said that more then anything technical, this lack of communication and vision on Adobe’s part is the reason why I would predict the decline of Flash content online.

But Adobe hasn’t actually surrendered the playing field. They gave up on the mobile player, and that seemed to be an endgame for Flash, but they did allocate resources to the mobile Air client team. Now that group’s efforts are viewable in the form of Adobe Air 3.2 RC1 posted Feb 27th, 2012, and it’s time to discuss the topic of this note, HTML5 versus Adobe Air for game development.

The criteria for comparison is: “which technology is the better choice for mobile, web, and mobile-web development?” Straight away, HTML5 gets a nice lead in the mobile-web category, because Adobe cannot field a Flash contender. They tried on Android only, but that didn’t work, and iOS Safari will forever be barred to them, rest in peace Steve Jobs. But HTML5 doesn’t receive a max score on mobile web by any means. Turns out, HTML5 support on Android browsers is in shambles. The default browser is so bad, the user experience on Android cannot help but be diminished. The good news is that google fixed the problem in the Chrome for Android browser. The bad news is that there’s only one phone that runs it since it requires Android 4, and there’s no upgrade path to 4 for pretty much any existing Android devices. Eventually some will come online, and the channel will ship more 4.0s, but this situation continues to get worse, the Android fragmentation and poor upgradeability hurt the HTML5 platform in terms of crap performance and API compatibility. Advantage: HTML5.

Next up, what about best technology for desktop browser game development? While HTML5 (especially WebGL) is stronger on the desktop browser compared to other browsers, Flash is also particularly good on the desktop. When it comes to browser compatibility, Flash wins hands down. Windows XP machines running IE8 are a big demographic that HTML5 can’t reach, but Flash works fine. Un-updated browsers tend to work with Flash. Older machines are broken for both Flash/stage3d and HTML5/webGL. Windows version 8 with the metro UI does not work with the Flash plugin, but it does work with HTML5 and may have some fallback outside metro for Flash content. Ultimately, IE8 users will outnumber IE10 metro users for the foreseeable future, and the advantage goes to Flash.

The tiebreaker now becomes: which technology is better for mobile / app store? HTML5 requires a packaging tech to execute in this fashion (spaceport.io, appMobi, ludei, or PhoneGap) Adobe Air is an analogous technology. Adobe Air has both 2d and 3d modes (stage3d), and library extensibility with native extensions. Those items are possible in the 3rd party packagers, but the 3rd party stuff primarily focuses on rudimentary 2d operations; Flash offers broader access to the GPU functionality. That’s a significant advantage to me. The downside is the runtime minimum install for Air is a whopping 8+ megabytes. So app store content won’t update as easily as it might have; if you need to redownload 8+ megabytes per content update. (Not necessarily true, but possible) So it’s a tradeoff, and if the packagers had a webGL operating mode I’d call it a push, but since they don’t I go with Adobe Air.

That gives us a conclusion as to the winner between HTML5 and Adobe Air. Air is better because it works on windows XP/IE8 and can enable 3d game development on the mobile devices as well as its traditional strengths in 2d vectors and artist accessibility. HTML5 can only win when your requirements include running under iOS Safari, small downloads starting quickly, or Windows 8 IE10 Metro interface compatibility.

Will this always be true? Probably not. Do Dart and NaCl come into the picture? Kind of unlikely. Is Unity or Unreal better than both? Certainly, but those are non-viable in browser, so it’s not the playing field that matters.






No comments: