Small bug in Animation transitions?

0 favourites
  • 8 posts
From the Asset Store
3 pixel charaters with over 8 animations each + animations with a gun
  • I am trying to figure out if a small error in the way my player character transitions between animations is my fault or a bug in the way Construct handles the transitions.

    The relevant code is here:

    I don't think the rest of the code not shown would interfere with the above in any way.

    Here is the problem. When I quickly transition between the Run_Shoot_Up and Run_Shoot_Down (by quickly rolling my thumb over up and down on the d-pad while continuously pressing right or left) my player character animation freezes in place while it continues to move. It does not do this when I press up and down more slowly, only when I do it quickly which leads me to believe it's an animation engine issue.

    I have uploaded a short video as an example:

    https://gfycat.com/RemarkableGloriousGoose

    It's not a huge problem, but just looks wonky and I would expect a modern animation engine to do this properly.

    Edit: I forgot to mention that this happens in both Construct 2 and 3.

  • I'm not 100% familiar with using the game pad but you could zero in on the issue by disabling 1 bracket of code at a time in that section to see what's interfering with it.

    Wait!!! I think I figured it out VicTokai your swapping between the 2 animations so fast that you cant see the legs move because there's no more than a second to see the frames you'll have to put your characters legs as a separate object and pin them to the players body and make them a family. Your player will need to become composed of multiple parts the second option is to force a delay like wait 1 second between animations.

  • I would think that if an animation needs to be triggered quickly the engine should be able to handle it. If I can only switch between an animation state every second and not any faster that's a total showstopper for any kind of action game.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Here is a great tutorial scirra.com/tutorials/355/ma ... iple-parts

    Now that I'm thinking about it making your players hands a second Sprite would be easier and it makes player customization and weapon swapping a breeze.

  • I am trying to figure out if a small error in the way my player character transitions between animations is my fault or a bug in the way Construct handles the transitions.

    The relevant code is here:

    I don't think the rest of the code not shown would interfere with the above in any way.

    Here is the problem. When I quickly transition between the Run_Shoot_Up and Run_Shoot_Down (by quickly rolling my thumb over up and down on the d-pad while continuously pressing right or left) my player character animation freezes in place while it continues to move. It does not do this when I press up and down more slowly, only when I do it quickly which leads me to believe it's an animation engine issue.

    I have uploaded a short video as an example:

    https://gfycat.com/RemarkableGloriousGoose

    It's not a huge problem, but just looks wonky and I would expect a modern animation engine to do this properly.

    Edit: I forgot to mention that this happens in both Construct 2 and 3.

    Add an "Else" (system condition) to the second condition (dpad down). The problem is that your events allow for both dpad down and up to trigger simultaneously.

  • Can you elaborate? I don't see how I could put an 'Else' statement in there. When I add an else anywhere in there it says it's not valid.

    Edit: Is this what you mean?

    This did not solve the problem, unfortunately. The behavior is exactly the same.

  • The else should work, try also replacing the last two negative conditions with an "else".

    For a split second there, two or three animations are set simultaneously, which somehow resets the frame index back to 0. I've verified this in Construct 2 just now. So your sprite is "frozen" on the first frame when you quickly press the d pads one after the other.

    I'm thinking of a brute force solution: you can manually set the frame index every tick.

    Have a local variable named "runFrameIndex", then manually increase it (just before the three conditions) :

    Every (1.0 / YourAnimationFramerate) seconds, add 1 to runFrameIndex

    if (runFrameIndex >= YourAnimationFrameCount) set runFrameIndex to 0

    Then, after the 3 conditions, force the frame index to be set to your variable.

    PS: you've made the problem harder than it should be by mixing input logic with animation logic. So I guess a brute force solution is appropriate here. You should also learn how to use the basic system conditions/actions like the conditional structures, the loops, etc. Usually in professional games, the animations are handled by an "FSM" (finite state machine) and are completely isolated from the input handling logic and the gameplay logic.

  • Thank you so much Zed and Tyler. I appreciate the advice and help. I will try out your tips and hopefully get where I want to be. I have a lot to learn.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)