Jump to content

Spriter AS3


Abel

Recommended Posts

  • 5 months later...
  • 2 weeks later...
  • 2 weeks later...
  • 2 weeks later...

Hi!

Thanks for your work on the AS3 impl as it relates to Starling.

I tried your test code, but I'm getting very slow performance. Even in "standard" packaging mode, I'm getting only 4 fps with your two demo characters (walk and idle_healthy)

I tried with Blitting and without.

Interestingly enough, when I turn off the auto-play, I get 36fps, down from 60. So at least half the slowdown seems to be in just drawing the two hero clips.

Any idea why it might be running so slowly on device?

Thanks!

Link to comment
Share on other sites

Hello again,

Looking into this I learned the following:

1) on a fast PC, no slowdowns can be observed until you add 10-20 heros on stage.

2) If I remove the animation update code and just draw the hero once (so he shows up), I can get 60fps on device (This is with Standard packaging. Fast packaging is at 34 fps for this test). The animation update routine seems to be the problem.

3) Adobe Scout (fka Monocle) indicated that Starling / Stage3D was doing a lot of texture swapping, which accounted for most of the frame time while animating. Even though you're caching the textures in memory (nice), it APPEARS at this point that swapping 19 textures 30/60 times a second is very costly on device, whether you're blitting or not.

4) I changed the onCharacterChangeFrame() function to only update the position of objects, rather than remove all of them and start fresh. This causes some issues when playing back an animation where the image set changes, but that in theory could be worked around if this speeds things up.

With this technique, in standard packaging, I get 47 fps. All of those "getObjectByName" calls are taking a toll.... it seems.

However, if I remove the container.unflatten and flatten calls, I'm now up to 57fps on device in standard packaging.

Nice, but this is still too slow -- we shouldn't see a dent in performance with stage3D a character of this complexity. But at least this proves that with some rejiggering of the algorithm faster performance on device is possible. Note: with 3 characters (the idle and walk) FPS goes down to 21 on device with standard packaging. There's still just too much overhead in the update tick.

Not sure if it's worth it to improve the renderer though -- found a few other animation solutions that I want to try first:

1) "StarlingConverter"

http://forum.starling-framework.org/top ... -hierarchy

2) "Extract Swf"

http://renderhjs.net/shoebox/extractSWF.htm

Would be interested in hearing other's thoughts on this!

Link to comment
Share on other sites

  • 8 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...