How do I create an animation precedence system

Get help using Construct 2

Post » Wed Jul 01, 2015 4:03 pm

First off, I'm not sure what else to call this other than animation precedence . If there's a more common industry term please let me know. But this has always been the bane of my game dev skills.

I have some physics based characters that have different states such as "walking", "climbing", "running", etc. Each of these states have associated animations. Where I'm running into problems is on the animations that aren't tied to a state. For example an "attack" animation should have a higher precedence than "walking" so it should immediately animate then return back to the walking animation. Further still a "take damage" animation would have a higher precedence than "attack" which means it would play then return to walking.

So one, am I looking at this wrong? Should each one of my animations -including the one shot triggered animations like "attack"- be a state? Then I could just craft my FSM as usual and only have to worry about playing an animation that matches the state.

or

Is there a better way of looking at or handling this whole thing? I know in Unity there's a animation tree that takes care of most of this but I searched the forums and tutorials and didn't find a quick answer.

THANKS!!!
B
52
S
13
G
7
Posts: 147
Reputation: 6,800

Post » Wed Jul 01, 2015 8:35 pm

I'm not able to answer you, because I have the same doubt. although I always worked with the animations exactly like this.
There is a hierarchy between the animations which few animations have preference to play before others, like taking damage or attacking should not be playing in order to walk animation to play.

I can't tell you if this is right or wrong, or if it's the best way to do it. But I can tell you that I work just like this and I never had problems with this.

So if anyone has a better way of handling this whole thing I would be glad to know it to.

So.... UP!
B
17
S
7
Posts: 280
Reputation: 2,522

Post » Wed Jul 01, 2015 8:47 pm

Here's how I did it. It's just nested if statement. The character can't do anything if he's dead so I check that first, and than I work my way to the top. First if he is climbing, because he can't use items while climbing, and then, finally, I do regular animations like walking, standing and jumping.

Image

You'll notice that everything that I want my character to do while dead is put into an else statement.
Banned User
B
6
S
3
Posts: 105
Reputation: 1,170

Post » Thu Jul 02, 2015 1:50 pm

Awesome! Thanks @tarik00555! That's kinda what I've done in the past. It can just get messy if you're not careful. :cry:

I guess I was hoping for something a bit more procedural since a lot of my characters will share the same base animations. But I guess depending on how I use families it could be a little more general.

Anyone have any other takes on it? :idea: ;)
B
52
S
13
G
7
Posts: 147
Reputation: 6,800


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 31 guests