How can I increase animation speed?

LuMa GamesLuMa Games USAMember Posts: 129

I am currently making a game with a helicopter in it. The blades on top of the copter are going to spin when it's complete. I imported 10 frames into the animate behavior to move the blades around, however I noticed it appeared to be moving VERY slowly. I increased the frame rate to 30 fps, which helped a little but was still moving fairly slow. Is there ANY way I can make my helicopter blades animate/move faster?

Comments

  • MalkovichMalkovich Member, PRO Posts: 116
    edited October 2014

    Really i don't know how to increase fps over 30 into the animate behavior, but what i would do is to draw less images, and then add to them for example a motion blur effect with PS or other effect that make the fast movement illusion or you can try to draw more blades on each frame with some movement effect. Well i hope that help you.

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408

    try dropping some of the frames, take out every other one and see how it looks.

  • LuMa GamesLuMa Games USAMember Posts: 129
    edited October 2014

    Thanks guys, what I ended up doing is making the animation only 3 frames. fortunately this time I can get by with that because it's pixel art. However, in the future I have a feeling this will become a problem when trying to animate more detailed images :( I really hope GS makes an update on this in the future allowing the cap to be at least 100.

  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2014

    @Luma said:
    Thanks guys, what I ended up doing is making the animation only 3 frames. fortunately this time I can get by with that because it's pixel art. However, in the future I have a feeling this will become a problem when trying to animate more detailed images :( I really hope GS makes an update on this in the future allowing the cap to be at least 100.

    100fps is impossible, at least on iDevices, as the upper limit is 60fps.

    You can run an animation at 100fps, and it will look like it is playing at 100fps because your eye can't tell the difference between 60fps and a sequenced 'timed' at 100fps but only playing at 60fps (i.e. it is skipping frames) - and as flawed as this sounds it's actually perfectly acceptable way of achieving 100fps as the timing is correct (i.e. it takes X seconds for the animation to complete) and the skipping is undetectable.

    So, if you want an animated sequence to run at 60fps (or even 100fps - accepting the above caveat) then just use this . . .

    Constrain self.image to floor(game.Time*60)%21

    60 is the frame rate

    21 is the loop point (if you need it to loop)

    I've posted more info here: https://forums.gamesalad.com/discussion/63454/fast-frame-swap

    P.S. increasing the frame rate of spinning helicopter blades will not make them appear to be moving faster.

  • LuMa GamesLuMa Games USAMember Posts: 129
    edited October 2014

    @Socks said:
    Constrain self.image to floor(game.Time*60)%21

    Socks, you are a genius. But I don't really understand how this works, are you essentially just speeding up the game time? also, what does floor do? as well as the percent sign?

  • LovejoyLovejoy Member Posts: 2,078

    @Luma said:
    Socks, you are a genius. I don't really understand how this works...but thanks a lot :)

    @Socks‌ new profile pic

    Fortuna Infortuna Forti Una

  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2014

    @Luma said:
    I don't really understand how this works...but thanks a lot :)

    P.S the above example presumes your animated sequence is named like this . . .1, 2, 3, 4, 5 . . etc.

    But you will likely have a name in your sequence like this . . . bomb1, bomb2, bomb3, bomb4, bomb5 . . . . etc

    In that case change the equation to this:

    _Constrain self.image to "bomb"..floor(game.Time*60)%21
    _

    . . . . . . . .

    . . . and one other thing, GS are planning at some stage in the future to drop the '%' modulus function, the new one is a little different, so a more up to date equation should actually look like this:

    Constrain self.image to mod(floor(game.Time*60),21)

    Or the version with a name in the sequence . . .

    Constrain self.image to "bomb"..mod(floor(game.Time*60),21)

    Hope that makes sense !

  • LuMa GamesLuMa Games USAMember Posts: 129
    edited October 2014

    @Socks, It's sort of starting to make sense. What if I were to make an animation behavior at 30 fps and then constrain self.time to self.time*2 wouldn't that double the game time, which in return double my fps to 60?

  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2014

    @Luma said:
    Socks, you are a genius. But I don't really understand how this works, are you essentially just speeding up the game time? also, what does floor do? as well as the percent sign?

    I explained a little about it above (before you edited your reply) . . . . but it's basically this . . (I'll explain it in the old modulus system for the moment to save confusion)

    floor(game.Time*60)%21

    Game.time = is a clock that starts running as soon as you start the game.

    So after 4 seconds game.time = 4, and after 99.4 seconds game.time = 99.4, and after 1 second game.time equals 1 . . . and so on.

    So, if we were constraining the image to game.time it would be very slow (1 fps), so we multiply it - in the above example by 60 to give us 60fps, so now the game.time value is increasing by 60 every 1 second (more correctly the sum within the brackets is increasing by that amount, we haven't really effected game.time).

    One other issue we also have to deal with is that game.time doesn't count up in whole numbers, it's a lot more accurate than that, the '99.4' above is one example, or another example would be that between 50 and 51 you have a whole range of numbers that are being sped through (50.001, 50.002, 50.003, 50.004 . . etc) - now we don't have a frame called 50.001 or even 7.3829 in our animation sequence as most people number their frames in whole numbers (unless you are criminally insane), so we use 'floor' to round the value down (ceil [ceiling] would round it up).

    So floor(50.001) gives us 50 and floor(7.3829) gives us 7.

    Now the sum within the brackets is increasing by whole numbers, 60 a second.

    Ok, so now after half a second we are on frame 30, after 1 second we are on frame 60, after 10 seconds we are on frame 600 . . . . but wait ! You have no frame 600, your animation sequence is only 21 images long.

    So we use a modulus function to 'loop' the animation after 21 frames . . . which is the %21 part.

    floor(game.Time*60)%21

    Translates to:

    Round down the following numbers (1 frame a second * 60 ) Loop after 21 frames.

  • SocksSocks London, UK.Member Posts: 12,822
    edited October 2014

    @Luma said:
    Socks, It's sort of starting to make sense. What if I were to make an animation behavior at 30 fps and then constrain self.time to self.time*2 wouldn't that double the game time, which in return double my fps to 60?

    Constrain self.time to self.time*2

    You cannot change game.time, that is to say you cannot effect it in any way, here you are attempting to constrain the game.time to another value, but it will have no effect as game.time is fixed.

  • SocksSocks London, UK.Member Posts: 12,822

    @raycur09 said:
    @Socks‌ new profile pic

    Lol. :smile:

  • LuMa GamesLuMa Games USAMember Posts: 129

    @Socks said:
    Round down the following numbers (1 frame a second * 60 ) Loop after 21 frames

    Thanks, I understand it a lot better now. I will definitely be using this method in future projects! :)

Sign In or Register to comment.