Gamasutra: The Art & Business of Making Gamesspacer
Will HTML5 Change the Way Games are Made?
View All     RSS
September 1, 2014
arrowPress Releases
September 1, 2014
PR Newswire
View All





If you enjoy reading this site, you might also want to check out these UBM Tech sites:


 
Will HTML5 Change the Way Games are Made?

August 29, 2012 Article Start Page 1 of 3 Next
 

Will Eastcott is a video game technologist that has worked for EA, Sony, and Activision on triple-A titles and is co-founder of PlayCanvas, a technology company that provides a cloud-hosted development and publishing platform for HTML5 games. In this article, he shares his opinions on how the emerging technology will really affect game developers and makes a case for the language as a great next step in game development.

You have probably seen the headlines. "Consoles are dead!" "HTML5 is the future!"

The talk around HTML5 is often quite sensationalized and, dare I say, biased. Let's put all of that aside and introduce a little calm objectivity. Here is my measured proposition: HTML5 will fundamentally change the way we make video games. Before I explain why, let me summarize the state of play with HTML5 today.

Over the last 30 years, we have witnessed a general trend of increasingly powerful hardware platforms coupled with ever better strategies for exploiting that hardware through an evolving ecosystem of tools and languages. The drive towards hyperreal gaming environments has been relentless, with console manufacturers delivering ever more powerful technology into the hands of developers.

However, with the rise of mobile gaming, we have witnessed a new phenomenon. Gamers have responded exceptionally well to playing simpler games in any location, on any device, with any of their friends. These are the key demands of the user now. Technology is still important, and beautifully crafted pixels still matter, but what matters more is that a game is accessible and connected. What is more accessible and connected than a web browser?

So what are the options for building such a game? You could write it from scratch, but targeting more than one platform can be a tall order for a small dev team. There's Flash, although with every passing month Flash seems less appealing. A retreat from the mobile space and confusing messages about Stage3D licensing costs have generated considerable negative feeling amongst developers.

There are engines like Havok Vision Engine and Unity, for example. These engines generally target the desktop browser via proprietary plugins and mobile devices via a native build. And then there's HTML5. Before you finally plump for HTML5, it is vital to understand its strengths and know how to mitigate its weaknesses. Let's take a closer look.

An Evolving Standard

HTML5 is not done. It is still being developed by the standards groups W3C and WHATWG, so browser vendors are tracking a moving target. Therefore, the level of support for HTML5 is different across every browser. This is illustrated in painstaking detail by the site caniuse.com.

An oft-cited example of cross browser inconsistency is audio. There are currently three distinct APIs: Mozilla's Audio Data API, Google's Web Audio API, and the Audio element JavaScript API. In recent days, Mozilla has announced that it has deprecated its own API and will soon begin work on implementing Web Audio. So it is clear that browser vendors are working hard to simultaneously innovate and converge the HTML5 platform to make life easier for the developer.

There has been a concerted drive from browser vendors to deliver new HTML5 APIs specifically for game developers. The three main examples are the GamePad API (which can read input from all natively supported pad devices), the Pointer Lock API (which hides the mouse cursor and reads raw mouse movement), and the Fullscreen API (which can make any HTML element go fullscreen).

These APIs have all been specced and implemented into multiple browsers in a consistent fashion in a short space of time. With their arrival, games like first person shooters are suddenly far easier to implement in HTML5.

JavaScript

Coders harbor remarkably strong sentiments about programming languages. Those coming from a console background are likely to view JavaScript with suspicion. It is yet another new language to learn, JavaScript will be slower than the equivalent C++ code, and optimization strategies such as vectorization are not possible with JS. Plus there's the fact that a game's code is available for all to see in the browser's developer tools.

I think it is important to reference Douglas Crockford's assertion that JS is the "The World's Most Misunderstood Programming Language". For C++ programmers, JavaScript is actually a breeze to learn. It is syntactically closely related to C++, although concepts such as closures and the "this" keyword can take some getting used to.

For those of us who don't like the rigidity and verbosity of a language like C++, JavaScript is a fantastic, dynamic language. Powerful features like first-class functions will drastically reduce the amount of code you have to write and the time it takes to write it. It's likely that a lot of people who convert to JavaScript won't be going back.

Performance is better than you might think. Firstly, the Web Workers API enables multi-threaded programming in JavaScript. Secondly, and more importantly, JavaScript engines have come a long way in the last few years. To illustrate, there is already a JS port of the open source physics engine Bullet, and although performance is not stellar, it demonstrates you can run some very CPU intensive algorithms at acceptable speeds using JS.

Let's face it -- cloning exists on all platforms, but when it comes to HTML5 games, it is important to keep a couple of things in mind. Tools such as Google's Closure Compiler do an impressive job of optimizing the source, and poring over the obfuscated source code is not the same as access to the original code. As a codebase increases in size, the more impractical it becomes to attempt to reverse engineer it. Secondly, if a game is to have an online component, much of the code can be run on the server, and the client is really just a thin visualizer. Much of the "value" resides hidden on the server.

2D vs. 3D

One of the most fundamental choices when designing a game is whether the graphics are to be 2D or 3D. 2D HTML5 games generally use a 2D context queried from a canvas element on the page. Every major browser now has good support for the 2D canvas context, so if your game is sprite based, there are no worries.

Things are more involved if you are looking to develop a 3D game. The only way to get high quality, hardware accelerated 3D graphics in an HTML5 game is to use WebGL, a JavaScript interface almost identical to OpenGL ES 2.0. Support for WebGL on the desktop is strong in Chrome and Firefox, and only Internet Explorer is holding out. Fortunately, Google Chrome Frame provides an elegant mitigation for Microsoft's resistance to WebGL, and although Apple has yet to enable WebGL in Safari by default, it is available to developers now.

WebGL has come a long way since the 1.0 spec was announced in March 2011. With OpenGL ES 3.0 freshly unveiled at SIGGRAPH, you can bet it won't be long until the corresponding spec for WebGL 2.0 is released. Exciting times for 3D browser gaming, to be sure.


Article Start Page 1 of 3 Next

Related Jobs

Cloud Imperium Games
Cloud Imperium Games — Santa Monica, California, United States
[09.01.14]

Technical Animator
Blizzard Entertainment
Blizzard Entertainment — Irvine, California, United States
[09.01.14]

Heroes of the Storm - User Interface Artist
Playtika Santa Monica
Playtika Santa Monica — Santa Monica, California, United States
[09.01.14]

BI Analyst
Playtika Santa Monica
Playtika Santa Monica — Santa Monica, California, United States
[09.01.14]

Sr. BI Developer






Comments


Samer Abbas
profile image
"There's Flash, although with every passing month Flash seems less appealing. A retreat from the mobile space and confusing messages about Stage3D licensing costs have generated considerable negative feeling amongst developers."

I understand that this article is about HTML5, but considering you mentioned biase and objectivity, it would have been more considerate if you did not insult our intelligence by just brush off Flash in such a simplistic -not to mention inaccurate- way. I was excited to read the feature, what a turn off.

James Hofmann
profile image
Indeed. Flash can't be dismissed, not when there's a whole sector of the industry still content to use the platform - and a much larger technical frontier to work from, with Stage3D reaching stability and another generation of compiler and VM tech on the horizon. Web games today have ample ability to make a fluid, HD-res experience, even if the performance is still far beneath well-tuned C++.

It would also be remiss not to mention Haxe, which is seeing increasing uptake for a combination of language features(static types, macros, etc.) and its ability to hedge platform decisions.

Cartrell Hampton
profile image
Hey.

I also agree with the cheap shot to Flash, and should've known there would be one in this article.

- Ziro out.

Daniel Jimenez
profile image
I would agree with you since I am currently learning Flash, but the fact that even Adobe said that they would stop supporting flash for mobile development actually reinforces the author's statement.

Svein-Gunnar Johansen
profile image
I think the promise of HTML5 is great, but as you point out, it is currently not quite ready. And the promise of greatness, also as you point out, sounds very much like Sun's 'Write once, run anywhere' mantra for Java from the late 90s... Which I totally bought by the way. I had such great faith in it, that I asked my Object Oriented Design Professor at the time to let me use Java for University assignments instead of the mandated SmallTalk language. But Java's promise remained just that, a promise that sometime in the future everything would be awesome.

I wouldn't at all mind if HTML5 revolutionized how games are made, but I rather choose to only be cautiously optimistic about it. As a best case scenario, I suspect it might just revolutionize how promising designers get their first foothold in the industry.

Will Eastcott
profile image
Hi! Yes, I studied Java at Uni around 1995 and at the time, I was so sure it would supplant languages such as C++ (I guess I was being a bit naive). I even wrote Java bindings for Criterion's RenderWare in 1998 which I suppose was a really early experiment with 3D browser gaming. It really did seem to have so much promise, but hey, I believe Mojang and Jagex still use it so obviously, some people still rate it. Sun definitely kick started an important concept though, and pretty much all middleware today is built on the premise of 'write once', 'save time', 'save money'. Even if Sun never quite delivered on the promise with Java, it's not to say that Apple, Google, Mozilla et al won't succeed with HTML5. Time will tell! :)

Eric Preisz
profile image
I'm working on a Canvas/WebGL bench-marking tool with a goal of learning the pitfalls of graphics performance across the different browser implementation.

Learning Javascript beyond the level of tinkering with web pages has been annoying to me as a C++ programmer and it's clear that the optimizations that I'm accustomed to with a compiled language just don't exist in the browser. It seems logical that an interpreted language won't have the same kind of optimizations as a compiled language without using a tool like Google's Closure Compiler...thanks for pointing me at that.

I think their a lot to be said for cross-platform support for content, logic, and framework and I'm personally very interested in browser driven games (for certain types of games). It's true that there are already systems that provide cross-platform support for content, logic, and framework, but in those cases, the tool vendor is responsible for maintaining support...with HTML5, it's the browser vendor that is responsible for the the support. Seems like a more realistic way to support 100s of platforms.

ian stansbury
profile image
There is one big question I have, Is IE's support ever going to catch up? I don't use it, no one I know uses but like 40-50% of people still use it. Thus you have to make sure your game is support on it, which is a must if your doing anything casual, which also means you will never be able to use the newest additions to the language.

Plus I think if win8 catches on (it probably wont) MS will intentionally block out some things to try and force developers into their more closed and apple like app store. Personally I'll go all linux first.

Will Eastcott
profile image
Only Microsoft knows that for now. I suspect that their lack of WebGL support is just another contributing factor for their ongoing decline in terms of browser usage share. Although IE has ~40% usage share in the US, Worldwide it's now down to about 32% (according to http://gs.statcounter.com/), and the trend seems reasonably clear. But yes, 32% is still very significant and I don't think it's sensible to ignore it. With PlayCanvas, we built in support for the Chrome Frame installer if IE is detected. Chrome Frame is great since it will allow Chrome compatible content to run in versions of IE all the way back to 6.0, so just for that reason, it's a useful piece of technology. But best case scenario would certainly be that Microsoft implements WebGL - I think it will benefit IE's usage share and the dev community. The talk about WebGL being a security threat is a red herring, IMO.

Matt Robb
profile image
"Gamers have responded exceptionally well to playing simpler games in any location, on any device, with any of their friends."

He lost me here. Granted, "Gamers" is the easiest term for people who are playing games, but based on context, he's referring to people who play games as a primary activity, most of whom still greatly prefer their PCs, consoles, and things you see on Tabletop.

Will Eastcott
profile image
Hi Matt. I just meant that there's a trend away from the PC and console towards mobile devices. For example, 5 years ago, I would spend ~90% of my gaming time on PC/console and ~10% on mobile (NDS). Now it's more like 80% on mobile (iOS mainly) and 20% console. I'm not saying I'm the typical gamer, but generally, people are spending more time playing more casual, online affairs on smartphones and tablets.

Bart Stewart
profile image
Will, this is slightly off-topic from your helpful overview of HTML5 directions, but... what evidence is there to support the belief that increase in mobile gaming comes mostly at the expense of PC and/or console gaming?

In other words, are there good numbers showing that gaming platforms have become a zero-sum system? Or has the increase in mobile gaming come mostly from expanding gaming into free time that was previously going untapped?

I can imagine some decline in console playing time related to the end-of-generation thing. But is there good evidence that PC gaming (in the era of increasing digital distribution) is being cannibalized by mobile?

Regarding the actual article, I'd have liked to know more about reasons why someone might not want to use HTML5. There's a 2D game trying to get out of me, and I'd really like to maximize platform accessibility with minimum rework, so HTML5 is attractive. But I'd be surprised if there weren't some biz/tech pitfalls waiting to ensnare the new HTML5 developer.

Will Eastcott
profile image
Hi Bart. I don't think it's the case that the world's gamer population has topped out and people are simply moving from one platform to another. Facebook gaming, mobile gaming and the like are certainly broadening the demographics and growing the audience. But there does seem to be evidence that a certain amount of cannibalisation is occurring. This seems to be more evident with mobile devices like PS Vita and N3DS, where the sales numbers do seem to be telling a story. For example: http://www.lenovo.com/articles/us/en/news/mobile-cannibalizing-ha
ndheld-gaming.html That article does go on to mention what's going on with console sales as well, but the evidence is less clear. I guess I'm also partially going on empirical evidence - my own experiences and those of people I know.

Mobile platforms are increasing in performance faster than console platforms. I would expect to see mobile platforms more aggressively challenge consoles in the next few years with high quality, AirPlay-style gaming on the TV. As for the PC, there has been a lot of talk recently about how PC sales are suffering at the hands of the tablet (e.g. check out Dell's share price for the last 6 months, although PC manufacturers are facing other problems too).

As for the reasons a developer might not want to use HTML5, I did try to be quite balanced on that. The fact is that you can make great cross-platform 2D games with Flash, HTML5, and the various commercial engines on offer. They all have their strengths and weaknesses. I wasn't really setting out to do a comparative analysis of the options. The overview of HTML5 was really a lead-in to the discussion on what HTML5 means for the future of development itself. But all I would say is that you need to do a bit of due diligence before you finally settle on a technology. Figure out what the technical requirements for your game are and check that the tech you want to use can reach the required platforms and give you the features and performance that you need. Figure out where/how you want to sell your game and ensure you can get there. I mentioned targeting apps stores with HTML5 in the article for example. I'll plug a company that is doing really fun stuff with 2D HTML5 games: Lost Decade Games. They're great at showing how to get products onto all sorts of platforms and blog relentlessly about their experiences. Check out their web site.

Nathaniel Meyer
profile image
I think there's a lot of potential for HTML5 in the casual market. Having developed both a 2D canvas and 3D WebGL engine for it, the technology is generally in an acceptable working state. There are still a few issues that need to be addressed and APIs to be improved on (particularly in the audio department). The mobile front is a bit weak in comparison to the PC and I would consider it "developer beware" at this point. GPU performance generally is not on par with native variants such as OpenGL and there are some audio playback issues and limitations. I still prefer C++ for mobile development and cross platform support is not that big of a deal. With Windows Phone 8 to support C++, it just adds one more platform C++ devs can target.

I've seen and benchmarked various 3D physics engines for JavaScript and personally I would not consider them viable at this point. For some simple scenarios you might get away with acceptable performance on a decent machine, but downgrade your test machine to a netbook or low end desktop and suddenly you have yourself a slide show. I would personally lean more towards 2D games and physics engines, such as Box2D. I think that is a much better combination for today's HTML gaming market. Think angry birds and you'll be flying to success.. or hurdling to your impending doom ;)

Trent Tait
profile image
Javascript is such an awesome language, far superior to C#. I can't wait to dump crap tools like Unity for HTML5 / Javascript.

Timothy Barton
profile image
It is amazing that we can have such a diversity of opinions. I have exactly the opposite viewpoint. Any attempts I have made to make my Javascript scalable, modular and generalized while still enforcing constraints/contracts to aid debugging have been fruitless. It's entirely possible that I am just not good at Javascript, after working with both for a few years (doing Silverlight development right now), I shudder going back to Javascript. And not just for performance reasons; mainly just I feel I can express my architectures and designs far easier in C#. But to each their own...

Patrick Chasco
profile image
@Timothy: It's not that you're not good at Javascript. That's the biggest issue with Javascript development. Before I say this, I just want to disclose that I am a big fan of Javascript and dynamic languages in general. That being said, developing anything large and complex with dynamic languages becomes very difficult. The lack of compile-time checks which are intrinsic to compiled languages like C# means you are debugging type mismatches, argument order, typos, etc. at runtime. Refactoring a program with a dynamic language can be hell.

Trent Tait
profile image
@Timothy

Sorry, my post was dripping in sarcasm. I thought it would be more obvious than that.

Chris Melby
profile image
I hit like, because you made me laugh out loud. :D

Toby Grierson
profile image
My first thought was "that has to be sarcasm", but then I reminded myself that there is always somebody that stupid. lol

Jeffery Wilson
profile image
I would "LOVE" to write the code for game and have it "RUN" every where, but Javascript isnt the language of the future, LOL. Really? Just how old is Java script anyway? 17 years, or is is 20 years old? And you still cann't find a definitive example on how to display images on a web page.

If you make simplistic games you can use something like HTML 5, but will HTML 5 ever reach 2048 X 1680 rez 32 bit color FPS running at 60 frames per second? Not in the next 10 years (or longer).
This performance mark is easily reached by C++ engines.
Ricard Garriott once told me "You can never realase a game on a given platform, that doesnt look better and run better that the exsisting generation of games". Switch to a technology that lets you produce games that look like they where developed in 1992, doesnt work on PC's, it might work on a cell phone.
But I think Unity and Flash have that segment covered pretty well.

Will Eastcott
profile image
Hi Jeffery. Hey, don't knock a language because it's old. ;) C++ is 12 years older than JS. Maybe you're more of a Dart man!

I guess it depends on the types of games you're building. Clearly, as of today, you can't write CoD in JS+WebGL and have it play/look/perform like the 360 version. I don't think HTML5 is necessarily about replacing that kind of content. As a sometime-indie developer, though, it's great that HTML5 enables me to use tools that are free, open, accessible from any device, with no install. It's also great that I can make games and immediately publish them out for people to enjoy by following a hyperlink. For me, that's really exciting.

As for an FPS running at 2048x1680 @ 60Hz, well, what's the HW spec? ;) Seriously, a small Mozilla team just released BananaBread (https://developer.mozilla.org/en-US/demos/detail/bananabread), a reasonably simple FPS demo that showcases various HTML5 features. If they can do that, you can bet others will come along and build something even better.

Marc Arbesman
profile image
I think what's interesting about this article is the suggestion that the ushering in of HTML5 also means a shift in the tools we use as developers. I tend to disagree in this assertion.

I am leery about publishing a work in progress of a new IP out to the world, unfinished on Github. There is a compelling reason to post your code to the public. But what makes sense to me, is how companies like Id do it. Post the source code only after you have exhausted it's commercial release business model. I also don't like the idea of posting my internal development communications to the twitterverse. Again some instances make sense, like crowdsourcing advice on using a certain design pattern or technique. But discussing features of the game on a public forum doesn't make sense to me.

Perhaps I am just old school in these matters. But I am interested in further debate about these new proposed collaboration methods and why their benefits outweigh the security concerns.

Anatoly Ropotov
profile image
"Will HTML5 Change the Way Games are Made?" - No, it won't.
All these articles about HTML5 ignore one simple fact. There's no difference between coding a game in Flash with Stage 3D or HTML5 and WebGL besides penetration. 99% Flash penetration making it playabale across all devices (especially with the new AIR and 10.4 release) or HTML5, specifically WebGL in case of PlayCanvas, covering barely 40% of desktop PC. That's... Well... 20% of all devices out there as you can't publish it to mobile? Even Unity3D in this case is more preferable .

Nick Liow
profile image
But market penetration is about how games are consumed, not made.

I do agree with you that HTML5 will not change much about how games are consumed. Other technologies have much higher penetration, and the average consumer doesn't care about the tech behind it, anyway.

But HTML5 brings something new to developers.

Suddenly, your code editor, testing environment, real-time collaborative tools, and even publishing platform, can all be in a single website. Without the need to download anything, update software, and just for the hell of it, all backed up on the cloud.

That is powerful stuff.

Will Eastcott
profile image
Hi Anatoly. I think it's important to recall the 'it's not done' portion of the article. As with anything new, it takes time to build penetration and mature. That's only to be expected. I'm not sure where you got the 40%/20% figures from, but caniuse.com has WebGL support at 53.39% across all web-enabled devices. Perhaps blacklisted drivers reduce this number a little for Firefox users, but Mozilla are working hard to resolve that by adding a software renderer (see the following bug: https://bugzilla.mozilla.org/show_bug.cgi?id=731836). I think it's the trend that's important. A year ago, WebGL penetration was maybe half what it is today and it is continuing to rise rapidly. Better mobile support is coming, just give it time.

Nick Liow
profile image
There are so many articles touting HTML5's write-once-deploy-everywhere promise, which Java and Flash already had a turn at. I don't think HTML5 will change much about how games are *consumed.* Other technologies have much higher penetration, and the average consumer doesn't care about the tech behind it, anyway.

That said, I strongly agree HTML5 brings something new to *developers.*

Suddenly, your code editor, testing environment, real-time collaborative tools, and even publishing platform, can all be in a single website. Without the need to download anything, update software, and just for the hell of it, all backed up on the cloud.

That is powerful stuff.

Jason Church
profile image
Very interesting that this article just went up. I'm currently working with another developer that is focused entirely around this idea of open game development on the web, powered by HTML5 (you can check out the demos here if interested http://www.craftyy.com)

While I still think that the tech is early on in its life, I can see a lot more developer migrate over to it in the next few years. I think there's still a lot of potential using javscript and things like the canvas element which people just simply don't understand yet -- and while a little weird to get into, it really does open up a lot more possibilities compared to something heavy like Flash and action script.

Chris Melby
profile image
Jason,

What kind of possibilities are you thinking about?

Jason Church
profile image
From a development standpoint, you're no longer having to download expensive software or find plugins that are tailored to your specific project. It's much easier to have your publishing platform (a website) also be your instantaneous test environment made easy through browsers developing tools.

I think from strictly a gamer's perspective, no, there won't be a change in what can be made, but how it's made? Much better.

Plus native mobile support is always nice too~

Chris Melby
profile image
Hey Jason,

What you stated sounds great and here's hoping for an ideal outcome.

My gripes about HTML development have to do with the DOM and the current version of JavaScript; where it's slated with Harmony, will greatly help, but for now I prefer working in other languages, since by design they are much better at managing and working with complex code.

One last quick ramble, because this can be a book. I have 17 years under my belt on developing web content and much of what you said about the possibilities of HTML5, actually rings true for platforms like Flash -- it of course covers more than just web development, but there are so many crossovers.

FYI, Unity has a free version that cost nothing to target the web plug-in that I'm recalling -- I have it downloaded, I just have not used it much -- and FlashDevelop and Haxe are both open source.

Andrew Sega
profile image
Blah blah HTML5 future blah blah WebGL blah blah.

Meanwhile, every major game company that has tried it (Wooga, Zynga, etc) has realized that the technology is broken and fragmented, and has abandoned it. Not to mention that Javascript is really the last language you want to build a 50,000 line project in. By the time HTML5 is "mature", Stage3D and Unity will have taken so much browser share that there'll basically no point anymore.


none
 
Comment: