News for hackers. Stuff that matters.
Re:Sprite.js: HTML5 framework for creating efficient animati... by olalonde on Thursday December 09, 2010 @09:13AM (#1987459)
I was a bit curious what exactly this "system load" was. Turns out it's a ratio between the time the browser takes to draw the particles and the frequency at which it is supposed which to draw.

    this.tick_duration = 25;
    
    ....

    this.now = new Date().getTime();

    // Drawing...

    this.time_to_paint = (new Date().getTime()) - this.now;
    this.load = Math.round((this.time_to_paint / this.tick_duration) * 100);
Re:Sprite.js: HTML5 framework for creating efficient animati... by coderdude on Thursday December 09, 2010 @09:34AM (#1987539)
This should shed some light on the technique: http://gamedev.stackexchange.com/questions/1589/fixed-time-s...
Re:Sprite.js: HTML5 framework for creating efficient animati... by necolas on Thursday December 09, 2010 @09:19AM (#1987490)
Demo: http://batiste.dosimple.ch/sprite.js/test_input.html

I like how he can fall off the ledge into an infinite drop.

Re:Sprite.js: HTML5 framework for creating efficient animati... by wlievens on Thursday December 09, 2010 @09:33AM (#1987528)
Causing the scrollbar to appear :-)
Re:Sprite.js: HTML5 framework for creating efficient animati... by morphir on Thursday December 09, 2010 @09:35AM (#1987541)
anyone of you reached the floor yet?
Re:Sprite.js: HTML5 framework for creating efficient animati... by flog on Thursday December 09, 2010 @09:49AM (#1987598)
At some point down it was all turtles.
Re:Sprite.js: HTML5 framework for creating efficient animati... by Cushman on Thursday December 09, 2010 @10:42AM (#1987817)
Unless his head gets stuck in the ground :)
Re:Sprite.js: HTML5 framework for creating efficient animati... by rudd on Thursday December 09, 2010 @09:54AM (#1987615)
Curious that Canvas rendering is so much slower / causes more load than the HTML backend, at least for me. Anyone know why?
Re:Sprite.js: HTML5 framework for creating efficient animati... by al_james on Thursday December 09, 2010 @10:36AM (#1987788)
Because using Canvas requires you to manage redrawing the entire scene each frame in javascript. When using DOM based sprites, the browser takes care of the redrawing whenever you move an element (e.g. a spite).
Re:Sprite.js: HTML5 framework for creating efficient animati... by chipsy on Thursday December 09, 2010 @02:17PM (#1988710)
It's also a display model problem. A big bitmap that you draw on arbitrarily is just harder to optimize than a decomposable scenegraph.

This downside of Canvas also means it may become a dead-end for high-performance 2D, unless we discover some way of making all manipulations go completely on-GPU. Canvas is presently best suited for creation of individual textures and sprites, while other methods(CSS, SVG, WebGL) are better to render and transform them.

Re:Sprite.js: HTML5 framework for creating efficient animati... by csytan on Thursday December 09, 2010 @07:15PM (#1989914)
I don't think this is the whole story, because DOM manipulations are also very slow.
Re:Sprite.js: HTML5 framework for creating efficient animati... by csytan on Thursday December 09, 2010 @07:13PM (#1989907)
On the about page it says:

    Performance

   The HTML backend has received a particular attention to be as efficient as possible.
Re:Sprite.js: HTML5 framework for creating efficient animati... by weixiyen on Thursday December 09, 2010 @06:44PM (#1989806)
Always wanted to make an RPG game using sprites. Anyone ever tried?

I made a prototype a while ago just to demo some sprite movement while messing around with Node.js (it's concurrent multi-user): http://rpg.sleeperbot.com/

Re:Sprite.js: HTML5 framework for creating efficient animati... by nathanwdavis on Thursday December 09, 2010 @05:05PM (#1989404)
I'm curious how the Ticker object provides more accurate tick timing than setTimeout considering it just uses setTimeout.