Hello Guest

Author Topic: bug on low fps and play from frame?  (Read 4440 times)

drkucho

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 72
  • Retro Arcade Freak
    • View Profile
    • Dr. Kucho!
bug on low fps and play from frame?
« on: January 22, 2015, 03:23:46 am »
i think i found a bug , i have a plant growing animation of 16 frames which goes very slow , i use PlayFromFrame with a random frame to start each plant on a different frame , but weird things happen when the clip fps starts to get smaller than 1 second

i have several instances of the same sprite with this code (startFrame is random each time, calculated before)

   anim.PlayFromFrame(startFrame);
   print ("START FRAME =" + startFrame + " ANIM FRAME =" + anim.CurrentFrame + " FPS=" + anim.ClipFps);

these are the results for different values of clip FPS assigned in the SpriteAnimator editor each time, i have marked the weird ones with <— ???!!! , as you can see, the issue seems to go crazier the more we go down on FPS, there is like a "threshold" that makes the animation to go the last frame instead of the right one.

START FRAME =4 ANIM FRAME =4 FPS=0.8
START FRAME =2 ANIM FRAME =2 FPS=0.8
START FRAME =1 ANIM FRAME =1 FPS=0.8
START FRAME =7 ANIM FRAME =7 FPS=0.8
START FRAME =0 ANIM FRAME =0 FPS=0.8
START FRAME =8 ANIM FRAME =8 FPS=0.8
START FRAME =2 ANIM FRAME =2 FPS=0.8
START FRAME =14 ANIM FRAME =15 FPS=0.8 <— ???!!!
START FRAME =6 ANIM FRAME =6 FPS=0.8
START FRAME =0 ANIM FRAME =0 FPS=0.8
START FRAME =9 ANIM FRAME =9 FPS=0.8
START FRAME =9 ANIM FRAME =9 FPS=0.8

START FRAME =6 ANIM FRAME =6 FPS=0.7
START FRAME =3 ANIM FRAME =3 FPS=0.7
START FRAME =4 ANIM FRAME =4 FPS=0.7
START FRAME =7 ANIM FRAME =7 FPS=0.7
START FRAME =14 ANIM FRAME =15 FPS=0.7 <— ???!!!
START FRAME =0 ANIM FRAME =0 FPS=0.7
START FRAME =12 ANIM FRAME =15 FPS=0.7 <— ???!!!
START FRAME =0 ANIM FRAME =0 FPS=0.7
START FRAME =4 ANIM FRAME =4 FPS=0.7
START FRAME =15 ANIM FRAME =15 FPS=0.7
START FRAME =8 ANIM FRAME =8 FPS=0.7
START FRAME =0 ANIM FRAME =0 FPS=0.7

START FRAME =6 ANIM FRAME =6 FPS=0.6
START FRAME =15 ANIM FRAME =15 FPS=0.6
START FRAME =3 ANIM FRAME =3 FPS=0.6
START FRAME =8 ANIM FRAME =8 FPS=0.6
START FRAME =8 ANIM FRAME =8 FPS=0.6
START FRAME =1 ANIM FRAME =1 FPS=0.6
START FRAME =5 ANIM FRAME =5 FPS=0.6
START FRAME =11 ANIM FRAME =15 FPS=0.6  <— ???!!!
START FRAME =13 ANIM FRAME =15 FPS=0.6  <— ???!!!
START FRAME =15 ANIM FRAME =15 FPS=0.6
START FRAME =3 ANIM FRAME =3 FPS=0.6
START FRAME =1 ANIM FRAME =1 FPS=0.6

START FRAME =9 ANIM FRAME =15 FPS=0.5  <— ???!!!
START FRAME =8 ANIM FRAME =15 FPS=0.5  <— ???!!!
START FRAME =1 ANIM FRAME =1 FPS=0.5
START FRAME =10 ANIM FRAME =15 FPS=0.5  <— ???!!!
START FRAME =13 ANIM FRAME =15 FPS=0.5  <— ???!!!
START FRAME =14 ANIM FRAME =15 FPS=0.5  <— ???!!!
START FRAME =0 ANIM FRAME =0 FPS=0.5
START FRAME =6 ANIM FRAME =6 FPS=0.5
START FRAME =12 ANIM FRAME =15 FPS=0.5  <— ???!!!
START FRAME =0 ANIM FRAME =0 FPS=0.5

START FRAME =5 ANIM FRAME =5 FPS=0.4
START FRAME =13 ANIM FRAME =15 FPS=0.4  <— ???!!!
START FRAME =12 ANIM FRAME =15 FPS=0.4  <— ???!!!
START FRAME =10 ANIM FRAME =15 FPS=0.4  <— ???!!!
START FRAME =12 ANIM FRAME =15 FPS=0.4  <— ???!!!
START FRAME =6 ANIM FRAME =6 FPS=0.4  <— ???!!!
START FRAME =10 ANIM FRAME =15 FPS=0.4  <— ???!!!
START FRAME =5 ANIM FRAME =5 FPS=0.4
START FRAME =13 ANIM FRAME =15 FPS=0.4  <— ???!!!
START FRAME =1 ANIM FRAME =1 FPS=0.4
START FRAME =8 ANIM FRAME =15 FPS=0.4  <— ???!!!

START FRAME =3 ANIM FRAME =3 FPS=0.3
START FRAME =3 ANIM FRAME =3 FPS=0.3
START FRAME =11 ANIM FRAME =15 FPS=0.3 <— ???!!!
START FRAME =13 ANIM FRAME =15 FPS=0.3 <— ???!!!
START FRAME =14 ANIM FRAME =15 FPS=0.3 <— ???!!!
START FRAME =10 ANIM FRAME =15 FPS=0.3 <— ???!!!
START FRAME =11 ANIM FRAME =15 FPS=0.3 <— ???!!!
START FRAME =1 ANIM FRAME =1 FPS=0.3
START FRAME =7 ANIM FRAME =15 FPS=0.3 <— ???!!!
START FRAME =12 ANIM FRAME =15 FPS=0.3 <— ???!!!
START FRAME =9 ANIM FRAME =15 FPS=0.3 <— ???!!!
START FRAME =5 ANIM FRAME =15 FPS=0.3 <— ???!!!

greets

unikronsoftware

  • Administrator
  • Hero Member
  • *****
  • Posts: 9709
    • View Profile
Re: bug on low fps and play from frame?
« Reply #1 on: January 23, 2015, 05:08:37 pm »
The code suggests it should work fine, can you post a repro in private support or email? It should be obvious what is goign on when debugging this.

drkucho

  • 2D Toolkit
  • Jr. Member
  • *
  • Posts: 72
  • Retro Arcade Freak
    • View Profile
    • Dr. Kucho!
Re: bug on low fps and play from frame?
« Reply #2 on: January 23, 2015, 07:58:10 pm »
ok , ill try to repro it in a simple scene and will send