Live data from Hacker News

Why Canvas is not an obvious choice for web games

paulbakaus.com

1–10 of 25 posts

Re: Why Canvas is not an obvious choice for web games

#3
post #2

This depends on the type of the game, but a fellow developer is beta-testing a canvas based game http://esdao.com . It's works quite well, with the exception of Mobile Safari to my recollection which is supposed to perform better with the next iOS update.

no discredit to your developer friend, but the level of visual complexity that the OP refers to is far in advance the game you linked.

Here's a video of the Aves engine in action:

http://www.youtube.com/watch?v=Ol3qQ4CEUTo

As someone building an HTML/javascript-based animated game myself[1], I'm somewhat aware of the challenges involved and am frankly amazed that the OP has this level of performance coming from HTML/js on so many different game objects.

[1] http://littlecosm.com - a massively multiplayer twitter client!

Re: Why Canvas is not an obvious choice for web games

#5
I have found that the performance you get with canvas as opposed to using a DOM based rendering varies greatly with the device and rendering engine that your code runs on (shouldnt be a suprise really).

For my game I have encapsulated redering to use webkitTransform and translate3d if hardware acceleration is present. Otherwise use canvas, or in the worst case (IE6-8), use DOM with left and top css attributes.

If your game, like mine, can use a form of dirty-rectangle, invalidation strategy to rendering, its possible to do 60fps rendering with low CPU usage on iOS and desktop browsers.

Re: Why Canvas is not an obvious choice for web games

#6
post #4

WebGL should fix this problem.

And don't worry about market penetration or adoption; one single hit game will drive the masses to the nightly builds and about:config.

Also, I wouldn't overlook Flash + PaperVision and its other 3D libraries. Alternative just showcased some glorious eye-candy at Adobe's Max 2010 convention:

http://blog.alternativaplatform.com/en/2010/10/26/adobe-demo...

Hard to believe that runs in a browser :-)

Re: Why Canvas is not an obvious choice for web games

#8
post #6
post #4

WebGL should fix this problem.

And don't worry about market penetration or adoption; one single hit game will drive the masses to the nightly builds and about:config. Also, I wouldn't overlook Flash + PaperVision and its other 3D libraries. Alternative just showcased some glorious eye-candy at Adobe's Max 2010 convention: http://blog.alternativaplatform.com/en/2010/10/26/adobe-demo... Hard to believe that runs in a browser :-)

It doesn't. It runs in a plugin.

Re: Why Canvas is not an obvious choice for web games

#9
post #8
post #6

Earlier quoted context omitted.

And don't worry about market penetration or adoption; one single hit game will drive the masses to the nightly builds and about:config. Also, I wouldn't overlook Flash + PaperVision and its other 3D libraries. Alternative just showcased some glorious eye-candy at Adobe's Max 2010 convention: http://blog.alternativaplatform.com/en/2010/10/26/adobe-demo... Hard to believe that runs in a browser :-)

It doesn't. It runs in a plugin.

But a plugin with higher adoption than HTML5

Re: Why Canvas is not an obvious choice for web games

#10
I'm with this guy. Canvas is great, but it's an element to include in your scene to render vector graphics, not a container for you to render your scene inside. Often you'll have dozens of them layered about the place, happily doing their thing and unaware of each other.

Use it right and it's a great tool. Try to use it as a panacea Flash replacement and you're in for a bunch of headache.

Post reply on HN