游戏邦在:
杂志专栏:
gamerboom.com订阅到鲜果订阅到抓虾google reader订阅到有道订阅到QQ邮箱订阅到帮看

解析HTML5技术的不足及其游戏开发前景

发布时间:2012-09-20 15:49:16 Tags:,

作者:Mike Arcuri

HTML5对于广大游戏开发者的吸引力越发明显了。让我们从用户覆盖面,访问与控制三大过程来看。

1.用户覆盖面

运行于主要的现代游戏平台(包括Anroid,iOS,Facebook,PC和Mac)的游戏具有空前广阔的用户覆盖率。这些游戏的潜在玩家已经多达20亿了(这是截止至5月份对于Flash用户数的估计,这一数量整整是第七代游戏主机销量的10倍)。

2.玩家访问

这些游戏都具有较短的游戏过程,玩家不管是使用公司的电脑还是家用电脑,亦或是便携的触屏智能手机和平板电脑都能够轻松地玩游戏,这种体验将改变游戏产业并能够吸引更多新玩家的加入。

3.控制

基于手机,平板电脑以及PC上所运行的相同的游戏代码,即时的游戏更新,简单的数据追踪,以及网络技术中固有的数据驱动优化,开发者能够面向更广泛的用户轻松地传达最佳游戏体验。更棒的是网络应用的设置权限也更加自由,即当你能够吸引一名用户时,你便能够随时进行更新,按照自己的想法去设置支付方式,并做出对自己有利的合作关系和技术选择。

如果HTML5是帮助开发者覆盖用户,访问以及控制这三大目标的最佳方法,那它就理应受到媒体和权威人士的肯定(在其问世一年多时间以来),但是为何我的老板上周会在网络上说“HTML5游戏只是炒作?”

为何EA创意总监Richard Hilleman在上周有关HTML5的新游戏大会上一直着重强调这一平台所存在的问题?Zynga和EA都未公开表示对于HTML5的支持?Facebook,谷歌,苹果以及微软是否决定为游戏制定新的标准?是否存在吸引人的WebGL样本?Adobe不是已公开承认Flash输掉了浏览器游戏之战,他们将转而支持HTML5并面向手机设备去推动原生应用的发展了吗?关于HTML5这一游戏开发技术的理想与现实是否存在着巨大的差别?

如果是这样,那是否还存在其它可行的跨平台游戏开发选择,还是我们注定只能待在可预见未来的孤立的游戏市场和跨平台移植项目中?

html5(from itsabacus.com)

html5(from itsabacus.com)

调查第一步:找到一款优秀的HTML5游戏

已经有一些人阐述了Facebook上的一些HTML5手机游戏不如Flash游戏,所以我便决定寻找其它正面的例子。《贪婪之手》是面向iOS平台而发行的一次性HTML游戏,但是它却只是对于原生应用体验的一种模拟;不只遗漏了粒子效果等外观元素,同时其它功能,包括声音,倒数计时器,动画以及屏幕转换也都未能有效地呈现出来。甚至连触屏反应和碰撞检测也具有各种缺陷。

我同样也检测了Chrome Web Store中一些最优秀的游戏,但是却发现这些游戏大多都属于Flash游戏(游戏邦注:《愤怒的小鸟》和《植物大战僵尸》便都是Flash游戏)。最后我便不得不询问身边的人是否知道哪些与iPhone或Android游戏一样受欢迎的HTML5游戏。经他人推荐,我找到一款非常出色的游戏,在其中投入了30分钟,并感觉整个过程就像在做梦一样。所以接下来我将尝试着在火狐7.0.1版本浏览器上加载游戏。但是这时候却不再那般顺畅了。呈现在我眼前的只是一个黑色矩形游戏区域。甚至在IE 9中,当我第一次加载游戏时浏览器立马出现崩溃现象,而当我第二次加载游戏时,画布元素则不会再出现了。在iOS或Anroid上也未出现好结果。

很明显,Chrome能够最有效地支持HTML5,但是我找到的第一款真正优秀的HTML5游戏却不能有效地运行于台式机或手机浏览器上。如此它便难以帮助开发者实现用户覆盖面和玩家访问的目标。

调查第二步:驾驭HTML5不同于原生应用的性能

虽然Hilleman(游戏邦注:EA首席创意总监)和Bakaus(Zynga德国工作室CTO)都指出了HTML5的性能和声音支持所存在的问题,但是我希望找到一些更具体的数据。从Chrome的硬件加速以及WebGL支持来看,我认为这是运行HTML5的最佳环境,并且我也开始着手追踪(相对于Chrome上的HTML5)原生应用的渲染和计算性能测试结果。

3周前谷歌在Chrome Web Store上发布了“Flocking Geese”的样本,即“能够同时基于JavaScript和C++(使用Native Client——谷歌在浏览器领域所推出的一个开源技术)而运行一个经典的群集算法,并衡量每一秒的模拟运转数。”谷歌补充道:“这种执行方法非常简单,并且基于两种语言而获得的结果是相同的,”并能够提供两种执行性能比较标准。

在我的机器上所进行的1分钟测试中,样本的源代码版本的运行总是快于HTML5(基于JavaScript),倍数也总是在4.0至9.2之间波动着。

我们当然知道手机设备的运行速度远远快于摩尔定律(揭示了信息技术进步的速度),但是当这类游戏比起基于原生代码而编写的游戏速度慢了9倍时,游戏设计师是否还能指望在手机设备或PC浏览器上吸引用户注意力?

调查第三步:采访那些致力于创造HTML5游戏的人(尽管出现了种种问题)。

尽管出现了种种问题,一些大公司如EA和Zynga也都开始投资于HTML5游戏开发,而对于那些没有钱去使用多种技术的小工作室来说难道就只能眼睁睁地看着别人获胜?我访问了两家初创游戏工作室,以及位于西雅图一家致力于使用技术将想法呈现于平台和其它替代选择上的互动体验机构。

Pixel Lab的Kevin Moore

HTML5游戏案例:面向于微软的IE 9而创造的《Agent 008 Ball》。

Agent 008 Ball(from develop-online)

Agent 008 Ball(from develop-online)

为何选择HTML5?“我们正致力于为用户创造最美好的互动体验,其中便包括一些样本游戏。我最欣赏HTML5的一点便是我们可以通过编写代码去降低游戏在其它浏览器的运行性能。但是如果我们所创造的是消费者游戏,我们便不会愿意忍受游戏性能的降低。”

从性能和音频方面来看:“最新的手机设备,如iPad 2和iPhone 4s的性能都越来越出色了。目前来看谷歌的音频API尤为出色,其它浏览器的性能则还有一定改进空间。”

Massively Fun Flagship的Grant Goodale

HTML5游戏案例:世界上第一款大型多人模式填字游戏《Word2》。

Word2(from develop-online)

Word2(from develop-online)

如何创造这款游戏?“我们是基于JavaScript,并使用WebSockets和DOM去创造这款游戏。同时我们也一直在寻找合适的Canvas端口。”

游戏是否已经进入了手机平台?“还没有,最初我们是致力于原生iOS和Android应用的端口进行开发,而现在我们开始着眼于添加PhoneGap而独立进行HTML5游戏的开发,并想办法解决手机上的Safari浏览器所存在的局限性和安全问题。”

基于HTML5的游戏:“我们是否已经拥有了一款极其成功的应用了?还没有。那么我们是否应该合理使用技术基础而创造出属于自己的成功应用?当然了。”

Hyperbotic Labs的Steve Cellini

制作过程中的HTML5游戏:《CrowdGame Trivially v2》(开发中)

如何创造这款游戏:“第一版本的《Trivially》要求主机玩家必须在iPad上安装Trivia主机应用,而其他玩家则需要在自己的iPhone上安装Trivially Remote应用。而在新版本中我们将只添加一种原生应用,即Trivially Console,并且任何玩家都可以使用自己的手机网络浏览器连接到它所支持的网络服务器上。在我们的测试中,WebSockets能够确保远程遥控与主机间的即时通信。”

HTML5的潜能与问题

大大小小的游戏工作室都都因为HTML5的潜能兴奋不已,并开始投身于HTML5游戏的制作中,尽管如此,Facebook和PC网络上的手机和Flash游戏仍然占据着排行榜单的有利位置,并仍然是众多投资者的最佳投资对象。基于特定的目标平台(游戏邦注:如PC和Mac上的Facebook)以及当前的浏览器版本,我们认为Flash是那些对技术要求不高的游戏的最佳选择。

然而,API的不足,充满安全隐患,带有性能局限性等仍然是阻碍大多数游戏开发者去追求用户覆盖面,访问和控制目标的大问题。所以在HTML5真正能够兑现其承诺前,创造者必须想办法完善浏览器,升级硬件并添加API等。我们很难估算所有内容的发布时间,以及真正渗透到整个市场的时间,但是根据我15年的软件创造经验,我们应该以年为单位进行估算而非月。若不提及替代选择,那么这篇文章就不能算是完整的,以下我将列出3个能够帮助开发者更好地获得用户和访问目标的替代选择:

1.移植

是的,这是一种相对昂贵的方法,这也不是多让人兴奋的开发工作,这让我们很难去利用某一特定平台上突然迸发的人气。尽管如此,完整的游戏移植却是现今游戏开发者最常使用且最容易获得成功的方法,能够帮助他们在保留最初游戏体验的前提下更好地向新平台扩展。

你必须掌握的关键:首先选择在1至2个平台上发行游戏,如果取得了不错的成绩你便可以快速将其移植到其它设备上。这一方法已经帮助许多热门游戏成功地扩展到各大平台上了。遗憾的是这些平台的排行榜上还未出现多少HTML5游戏能够用于进行对照。

2.浏览器上的本地客户端

你必须信任Chrome团队——从对于HTML5的支持以及其它最优的可选择方法,即惊人的浏览器内部设置来:本地客户端来看,Chrome远远领先于其它主要的浏览器。本地客户端允许你使用任何语言进行游戏编写,并且也不会造成多大的性能退化,但是尽管这是一种开源项目,到目前为止它也只能运行于Chrome浏览器上。广大游戏开发者希望可以在所有主要的PC和手机设备浏览器上使用本地客户端去实现获得用户和访问目标,而无需在编程语言,工具或游戏体验上做出让步。

3.中间件和多设备开发平台

这一类别中还存在着多种选择,包括使用Flash去生成原生iOS应用,使用Unity3D,基于Lua脚本(Moai,Corona)或网络技术(PhoneGap,Titanium)使用Frameworks。一些中间件解决方法和开发平台便是针对于游戏而设计的,而其它的则是针对于缺少图像的密集型应用进行设定。有些解决方法只面向手机设备,而有些则能扩展到手机应用,PC和网络上。有些工具属于开源项目,有些则是私人专属内容。我一直致力于Moai中间件,并极力向其它开发者推荐这一方法——因为它属于开放源,能够有效地进行游戏优化,同时支持前后端游戏开发,并适用于6种不同的平台上。

比起HTML5,所有的多设备开发平台都能够用于创造具有良好性能的原生应用,并帮助你覆盖到你想到达的范围而无需在游戏玩法或硬件设备功能上做出较大的让步。

我所期待的多设备游戏的未来——当提到技术,我最拥护的还是稳定的替代选择和开放性市场竞争。我希望HTML5能够在今后两年内兑现它的承诺。我也希望看到本地客户端能够在同一时间段内被应用在更广泛的浏览器上。

除此之外我希望中间件和平台执行能够越来越完善,从而让游戏开发者能够使用它们去创造名列各大设备平台排行榜前列的游戏。如果能够成就这样的未来,我们便可以说针对单一平台移植游戏已经是过去式了,它们只是促成该产业不断成熟的一个过程。

游戏邦注:原文发表于2011年12月22日,所涉事件及数据均以当时为准。(本文为游戏邦/gamerboom.com编译,拒绝任何不保留版权的转载,如需转载请联系:游戏邦

The Future of Multiplatform

by Mike Arcuri

The allure of HTML5 for game developers is as clear as it is strong. It’s about reach, access, and control.

1. Reach

Games that run on all the major modern gaming platforms – Android, iOS, Facebook, PC and Mac – would have unparalleled reach. The number of potential players for these games will easily top two billion (which was the estimated Flash capable audience as of May and 10 times the number of all the seventh generation game consoles sold).

2. Player Access

These games would be available for a quick play session both from work and home computers and on the omnipresent touch screen smartphones and tablets that are transforming the gaming industry and bringing in the majority of the new players.

3. Control

With the same game code running on phones, tablets, and PCs and the instant gameplay updates, easy data tracking, and data-driven optimisation inherent in web technologies, developers would have an easier time delivering their best game experience to the maximum number of players over a game’s lifetime. Even better, there’s no gatekeeper with web apps – if you can attract an audience, you can update when you want, process payment how you want, and make the partnerships and technology choices you want.

So if HTML5 is a terrific new answer to these game developer problems of reach, access, and control, and deserving of the media and pundit love-fest it’s been receiving for more than a year now, why was my boss quoted last week around the internet as saying “HTML5 games are hype?”

Why was EA creative director Richard Hilleman’s keynote at the New Game conference on HTML 5 gaming last week centered on the problems with the platform? Haven’t both Zynga and Electronic Arts both publicly declared support for HTML5? Aren’t Facebook, Google, Apple, and even Microsoft committed to making the emerging standard great for gaming? Aren’t there some impressive WebGL demos? Didn’t Adobe just publicly admit Flash has lost the war for in-browser games and they’ll support HTML5 and native apps for mobile devices going forward? Is there a major disconnect between the promise and the reality of HTML5 as a game development technology?

And if so, is there a viable alternative for multi-device game development, or are we all doomed to siloed game markets and cross-platform porting projects for the foreseeable future???

First line of investigation: Find a great HTML 5 game

Others have already reported on the stripped-down Facebook HTML5 games for mobile and how they’re lacking compared to their Flash counterparts, so I set out to find better examples. Hand of Greed has had a one-off HTML release for iOS for a long time now, but it’s a pale imitation of the native app experience; not just missing eye candy like particle effects, but full features like sound, the countdown timer, animations, and screen transitions. It also has noticeably poorer touch responsiveness and collision detection.

I started examining top games in the Chrome Web Store as well, but found mostly Flash games (Angry Birds and Plants vs. Zombies are both done in Flash). Finally I just started asking around if anyone knew of an HTML5 title that looked as polished and played as well as popular iPhone or Android games. Jackpot – another game developer pointed me to Fieldrunners in the Chrome Web store. It’s true, the HD version of Fieldrunners has good sound, fluid animation, high resolution graphics, and plays hitch-free on my average spec PC laptop inside Chrome (15.0).

I played for 30 minutes and it ran like a dream. So next, I tried to play it in Firefox (7.0.1). Cue frustration. All I could get was a black rectangle for a play area. In IE 9, the browser tab crashed the first time I tried to load the game, and the second time the canvas element didn’t appear. No luck on iOS or Android either.

Clearly, Chrome has the best HTML5 support, but the first really good HTML5 game I can find works on a grand total of one desktop and zero mobile browsers. Clearly, it’s not yet delivering on the player reach and player access promises.

Second line of investigation: Try to get a handle on HTML5
performance differences compared to native app alternatives

The EA and Zynga keynoters at the conference, Hilleman and Bakaus, both pointed out problems with HTML 5 performance and sound support, but I wanted to find more concrete data. Given Chrome’s hardware acceleration and WebGL support, I figured this was the environment to put HTML5 in its best light, and set out to track down some kind of recent performance test results comparing rendering or calc performance in native applications versus HTML5 in Chrome.

I didn’t have to go far – three weeks ago, Google released the Flocking Geese demo to the Chrome Web Store, which ‘implements a classic flocking algorithm in both JavaScript and C++ (using Native Client) and measures the number of simulation ticks per second.’ Google adds: ‘The implementation is very simple, and is exactly the same in both languages,’ and provides a switch and a performance comparison gauge between the two implementations.

During a one-minute test on my machine the native code version of the demo varied between 4.0 and 9.2 times faster than the HTML5 (Javascript) implementation.

Hmm, I know mobile devices are evolving faster than Moore’s law, but can game designers really expect to complete for player attention on mobile devices or in PC browsers if their games run up to nine times slower than other games written in native code?

Third line of investigation: Interview folks who are working on HTML 5 games despite these issues.

Despite these drawbacks, big game companies like EA and Zynga are investing in HTML5 games – but what about small studios that can’t afford to bet on multiple technologies and wait to see which one wins? I interviewed two startup game studios and one interactive experience agency in Seattle who were working with the tech to get their thoughts on the platform and alternatives.

Kevin Moore from Pixel Lab

HTML5 Game example: Agent 008 Ball, created for the launch of Microsoft IE 9.

Why HTML5? “We’re doing beautiful interactive experiences for our clients, and some of these are demo games. What I really love about HTML5 is you can write your code to degrade gracefully on other browsers. But if we were doing consumer games, we might not be willing to live with the gameplay degradation.”

On performance and audio: “On the newest mobile devices like the iPad 2 and iPhone 4s, the performance is getting pretty good. Googles audio API is by far the best. There’s some catch up work to be done by the other browsers.”

Grant Goodale from Massively Fun Flagship

HTML5 Game: Word2, the world’s first massively multiplayer crossword game.

How’s it built? “It’s all built in Javascript, using WebSockets and the DOM. We’re looking into a Canvas port.”

Are you on mobile yet? “Not yet, we originally started to contract out the development of native iOS and Android app ports, but now we’re looking into HTML5 plus PhoneGap as a way to do the development ourselves and work around the limitations and security warnings in mobile Safari.”

On the state of HTML5 for games: “Do we have a killer app yet? No. Are we all working to put the technology underpinnings in place so that killer app can be made? Yes.”

Steve Cellini from Hyperbotic Labs

HTML5 work in progress: CrowdGame Trivially v2 (in development)

How’s it built: “In the first version of Trivially, the host player needed the Trivia console app on an iPad, and the other players needed the Trivially Remote app on their iPhones. It’s a lot to install in order to play the game. Our new version will have just one native app – the Trivially Console, and it will host a web server that everyone else can connect to via their mobile web browsers. In our tests, the WebSockets allow almost instant communication between the remotes and the console.”

The net-net on HTML5

Game studios big and small are excited by the potential of HTML5 and starting to work on some HTML5 games, but native apps for mobile and Flash titles for Facebook and PC web still dominate the charts and the investment. For specific target platforms (like Facebook on PCs and Macs) and specific, current browser versions, it may already be a viable alternative to Flash for less technically demanding games.

However, there are all kinds of missing APIs, security issues, and performance limitations that are vexing the largest game developers and keeping developers from enjoying the benefits of reach, access, and control that they’ve been hoping for. A combination of browser improvements, hardware advances, and API additions are all needed before the HTML5 promise is real. It’s hard to estimate the timeline on all that being released, and then really penetrating the market, but after building software for 15 years, my SWAG is years – not months.The alternatives: An article like this one would seem half finished if it didn’t describe an alternative, and there are three reasonable alternatives for achieving the broad reach and access game developers are looking for, all of them in various states of maturity:

1. Porting

Yes, it’s expensive. Yes, it’s not thrilling development work. Yes, it makes it hard to capitalise on a sudden temporary burst in popularity or surge in a specific platform. Unfortunately, full game ports are still the most common method commercially successful game developers use today to extend their reach to new platforms while maintaining the gameplay experiences that made them successful in the first place.

You know the drill: ship on one or two platforms first, and if the game does well, port it to more devices as quickly as possible. This method has worked for many hit games on all the platforms mentioned in this article. There aren’t any HTML5 games topping the charts for these platforms to serve as a counter point (not yet, anyway).

2. Native Client in the browser

You’ve got to give the Chrome team credit here – they’re leading all the major browsers in terms of HTML 5 support and simultaneously providing the best alternative path for amazing in-browser gaming: Native Client. Native Client supports whatever language you originally wrote your game in, and runs with very little performance degradation, but even though it’s an open-source project, it’s only available in Chrome so far. Game developers would love to see all the major PC and mobile device browsers adopt Native Client as a viable path to greater reach and access without compromising on programming languages, tools, or game play experiences. Do you hear us, Mozilla? Are you listening Microsoft?

3. Middleware and multi-device development platforms

There are several options in this category, from using Flash to generate native iOS apps, to working with Unity3D, to using Frameworks based on Lua script (Moai, Corona) or web technologies (PhoneGap, Titanium). Some of these middleware solutions and development platforms are designed for games, and others for less graphically intensive applications. Some of them only target mobile devices, and others span mobile apps, PCs, and the web. Some of these tools are open source, and others are proprietary. I work on the Moai platform, and promote it to game developers specifically because it’s open source, optimised for games, supports both front and back end game development, and works for 6 platforms with more to come.

But all of the multi-device development platforms can be used to create native applications that have reasonably good performance and give you the reach you’re looking for with fewer compromises on gameplay and device-hardware-based functionality than the HTML5 alternative.

The future of multi-device games that I hope to see When it comes to technology, I’m a fan of solid alternatives and open market competition. I want to see the promise of HTML5 fully realised in the next two years. I want to see Native Client achieve broad browser adoption in the same timeframe.

I also want the middleware and platform implementations to become so good that game developers routinely use them to make games that top the charts on multiple device platforms. With a future like that, we should finally be able to say that single-platform-at-a-time title ports are rarely necessary and merely an interesting historical footnote in the industry’s maturity.(source:develop-online)


上一篇:

下一篇: