Making Things Easier: Animation Priorities

Jon

  • *
  • Posts: 17533
Greg suggested this today. What do you think about it? Is this something you've run into with your games?


Quote from: Greg
Problem:
- Why isn't my animation playing?

From my experience, this has been a frequent question.  The resolution is not always the same, but many times it's because other behaviors are also requesting animations and it's not clear to the user which will play.

This spans all genres of games.  For moderately complex characters, they may have a dozen behaviors, many of which need to set animations.  Let's say you have a walking animation and a shooting animation. 

1) The walking animation plays when you hold a direction key down. 
2) The shooting animation plays when you press the shoot key

So you want to shoot...so you check for the key press and expect the shooting animation to play, but it's not.  Well, it's because another behavior is constantly looping an idle or walking animation.  This is not obvious to a lot of users.

Now if we have a dozen behaviors, we have to check the status of what's going on in each behavior.  If I want to shoot, I now have to edit my Walking behavior so that it doesn't request the walking animation when shooting, etc....

-OR-
----------------------

Solution:
Build an animation management system directly into StencylWorks.  I created a behavior for this in the Jump and Run kit, but I really think it's better served as a feature in the program and engine itself.

How it would work:
1) A new field would be added to the Actor animation screen -- "Animation Priority" (actual text is up for debate).  You would provide a numeric value -- animations could share the same priority.

2) When the "set animation" block is used, it checks the priority of that animation versus the priority of the animation that's currently playing.  If the new animation has a higher (or equal) priority, it will become the current animation.   If the animation playing is not a looping animation, the engine will check to see if the animation has "finished" and if so, it will allow even a lower priority it take over when requested.

Would it break existing games?
No, every animation would be given a priority of 1 by default - so the system would work as it currently does if nothing was touched.

What do you guys think?  I really think this would be useful for all games - it would save on a lot of ugly logic and cut out many dependencies from the games themselves.

Pixel Pusher

  • Posts: 152
This would be a good implementation and very useful. From my experience anyway. Can get a bit tricky sometimes if the user can't tell why an animation isn't playing just because another has priority over it.

So, Yes. Good idea.

Greg

  • *
  • Posts: 1259
Anyone else have any feedback on this?  If it's not a problem that you're currently facing, we probably don't want to spend time coming up with a solution.

The jump and run kit has this sort of thing built into a behavior - but what are you guys doing for other games?  Are you coding the dependencies into your behaviors? 

chaosoul

  • *
  • Posts: 260
I was having the problem but I just used the animation manager part of the jump and run kit, but I like it if you implanted it
COOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEESS

mikbob

  • Posts: 493
Greg suggested this today. What do you think about it? Is this something you've run into with your games?


Quote from: Greg
Problem:
- Why isn't my animation playing?

From my experience, this has been a frequent question.  The resolution is not always the same, but many times it's because other behaviors are also requesting animations and it's not clear to the user which will play.

This spans all genres of games.  For moderately complex characters, they may have a dozen behaviors, many of which need to set animations.  Let's say you have a walking animation and a shooting animation. 

1) The walking animation plays when you hold a direction key down. 
2) The shooting animation plays when you press the shoot key

So you want to shoot...so you check for the key press and expect the shooting animation to play, but it's not.  Well, it's because another behavior is constantly looping an idle or walking animation.  This is not obvious to a lot of users.

Now if we have a dozen behaviors, we have to check the status of what's going on in each behavior.  If I want to shoot, I now have to edit my Walking behavior so that it doesn't request the walking animation when shooting, etc....

-OR-
----------------------

Solution:
Build an animation management system directly into StencylWorks.  I created a behavior for this in the Jump and Run kit, but I really think it's better served as a feature in the program and engine itself.

How it would work:
1) A new field would be added to the Actor animation screen -- "Animation Priority" (actual text is up for debate).  You would provide a numeric value -- animations could share the same priority.

2) When the "set animation" block is used, it checks the priority of that animation versus the priority of the animation that's currently playing.  If the new animation has a higher (or equal) priority, it will become the current animation.   If the animation playing is not a looping animation, the engine will check to see if the animation has "finished" and if so, it will allow even a lower priority it take over when requested.

Would it break existing games?
No, every animation would be given a priority of 1 by default - so the system would work as it currently does if nothing was touched.

What do you guys think?  I really think this would be useful for all games - it would save on a lot of ugly logic and cut out many dependencies from the games themselves.
Im not sure this is correct but you could do something on these lines.

[always]
[if {shooting} key pressed,
[stop {walking} animation.]

Im not sure that exists, but you might be able to improvise.

Visit Our Site!  http://www.mikbobgames.com
Play The Platforms 2!  http://bit.ly/theplatforms2
Check out our twitter!  www.twitter.com/mikbobgames

andelmar02

  • Posts: 41
I still think this would be a ridiculously helpful feature to implement! Is there a chance you guys will still do it??

johantri

  • Posts: 64
I'm playing around with 4 way movement by Mbuist from Stencylforge.. try to adding the fire button and adding firing animation by myself. But only got the first frame of the firing animation... so confusing ~____~