[not a bug] Problem with frame looping

1MrPaul1

  • *
  • Posts: 1285
Frames looping even if ''looping?'' box is unchecked. Animation goes to last frame and stop.
I make example game http://www.stencyl.com/game/play/11367


« Last Edit: March 01, 2012, 11:37:48 am by 1MrPaul1 »

captaincomic

  • *
  • Posts: 6108
Animation goes to last frame and stop.
That's what it is supposed to do.
If you check "looping", it will start with the first frame after it played the last frame.
If you uncheck it, it will stop after the last frame.

Did you expect it to show only the first frame, and not switch to the next frames at all?

1MrPaul1

  • *
  • Posts: 1285
Yes, i thought "looping" it's when animation playing and not looping it's when we switch frames manually by means of behavior.
If thats I showed it's normal, so, sorry. But other question, how to stop it? I make for rpg type game 5 parts with 100 in each part. I switching to necessery frame on start, also, place switching block in always. But it seems that switching block in always may decrease performance. Is it possible to stop playing animation more easy?

captaincomic

  • *
  • Posts: 6108
Well, I also don't know how to stop it. But at least I think switching frames does not have a very big impact on performace.

Look here what sunflower wrote: ;)
http://community.stencyl.com/index.php/topic,7892.msg49765.html#msg49765
Though now that I've checked, things aren't that bad now that I've checked it. As long as there's a way to use switching frames instead of switching animations, that is. I did a little test using my newly made behavior (teehee :P) and that's what I found.
On my machine when I did a check for about 200 animations switches (repeating 100 times switching between one animation and another), it took about 56 milliseconds for it to be performed. That's quite a lot and it makes about 3-4 animation switches per millisecond, which seems pretty slow. And it was when I used "as animation [text1]". When I used actual animation attributes, which I naively thought that should be more effective, it varied from 60-something to 70-something.

However! When I did a check for switching frames instead of switching animations, it took about 21 milliseconds to perform astounding 6000 frame switches (at most 22; sometimes, I don't know why, it happened to be 15 or 16 O.o). In other words, on my computer I could have almost 300 frame switches per millisecond, which is way more than possible 40 or 60, which you would do during frame-switching rather than animation switching. As long as your computer isn't 5 times worse than mine, it shouldn't take more than 1 millisecond (out of 16, if you want to keep it at 60 fps).

So yes, I hope that such information helps. ^^'

1MrPaul1

  • *
  • Posts: 1285
This is usefull information. Thank you! It's great that now we have events. This is more easy now to manage hard tasks with large number of elements