

Why Canvas is not an obvious choice for web games - binomial
http://paulbakaus.com/2010/07/19/why-canvas-is-not-an-obvious-choice-for-web-games/

======
jasonkester
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.

~~~
jasonkester
Apologies for going Meta, but the above downvote is the strangest one I've yet
seen here.

I can't come up with a way to read my comment as inflamatory or "me too". The
only thing I can guess is that it's a downvote for disagreement, but without
any commentary I can't imagine why the downvoter would do so. It seems like
the kind of thing one could easily refute with evidence, if one had evidence
that it was incorrect.

~~~
ZeroGravitas
It wasn't me this time, but I've unfortunately downvoted plenty of good
comments when using an iPhone (or similar touch based device). The two arrows
are simply too close together for people using capacitive touchscreens and/or
with fine motor control issues. If it's only one downvote I'd always bear in
mind the possibility that it's due to fat-fingers, not your comment.

~~~
RyanMcGreal
I still don't understand why HN doesn't allow users the opportunity to change
a vote on reflection.

------
voidpointer
I think he is comparing apples to oranges here. Using HTMl as the "rendering
device" works on a different (higher) level of abstraction. The additional
layer of abstraction in HTML has already solved the complexity of doing
efficient partial redraws based on changes to a subset of a scene graph. This
isn't something that the canvas API was meant to handle. If one were to use a
scene graph (or display list) abstraction on top of canvas, it would shield
the application developer from this complexity just as well as the HTML does
now. However, the HTML abstraction, although more general, is implemented in
native code while a canvas based scene-graph would need to go through java-
script, so it is at a disadvantage as to how far it can be optimized.
Basically, what he needs is SVG. :-)

~~~
metageek
> _Basically, what he needs is SVG. :-)_

Yes. It's incredibly frustrating that we can't rely on embedding SVG in HTML.
(Last I looked--about 2.5 years ago, admittedly--only Firefox could do it, and
only with XHTML.)

~~~
weavejester
Once IE 9 comes out, the majority of browsers will support inline SVG. Only
Opera is currently an unknown:

[http://caniuse.com/#cats=SVG,Summary&statuses=rec,pr,cr,...](http://caniuse.com/#cats=SVG,Summary&statuses=rec,pr,cr,wd,ietf)

~~~
metageek
Thanks!

------
kuahyeow
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.

~~~
fookyong
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!

------
jluxenberg
For anyone wondering what happened to Dextrose (the company Bakaus founded to
make the Aves HTML5 game engine), it was bought by Zynga back in May. He is
now the CTO of Zynga Germany.

------
steve19
WebGL should fix this problem.

~~~
mahmud
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...](http://blog.alternativaplatform.com/en/2010/10/26/adobe-demonstrated-
future-of-flash-through-showcase-by-alternativaplatform/)

Hard to believe that runs in a browser :-)

~~~
TheCoreh
It doesn't. It runs in a plugin.

~~~
ThomPete
But a plugin with higher adoption than HTML5

~~~
TheCoreh
True.

------
bni
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.

------
Tyrant505
So is UO or a good, top down perspective rpg coming to canvas soon? Which have
been announced?

