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 keySo 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.
Greg suggested this today. What do you think about it? Is this something you've run into with your games?Quote from: GregProblem:- 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 keySo 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.