Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Techniques For Animating  (Read 1146 times)

0 Members and 1 Guest are viewing this topic.

Strikerklm96

  • Jr. Member
  • **
  • Posts: 74
    • View Profile
    • Email
Techniques For Animating
« on: October 27, 2014, 11:24:55 pm »
Note: When I refer to animation, I only refer to the tiled position of the texture coordinates
So I have implemented large portions of my game, including Animation, and some new strange questions have arisen. I have completed my own solutions to these, but there are probably better solutions which is what I'm looking for. So, what are some common ways animation deals with these:

1. Should an animation complete before accepting another animation, or should it drop what it's doing and switch? A setting i'm guessing.
2. Should an animation, when done, repeat or revert to a default state.
3. Should the controlling object be constantly telling the animator device what state it should be in, or should it just send a signal once, and update each time the state switches?

I solved these in my own way, but I wasn't that happy with my choices, and rather than experimenting more, what does a good Animation process look like?

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: Techniques For Animating
« Reply #1 on: October 27, 2014, 11:32:11 pm »
Note: When I refer to animation, I only refer to the tiled position of the texture coordinates
So I have implemented large portions of my game, including Animation, and some new strange questions have arisen. I have completed my own solutions to these, but there are probably better solutions which is what I'm looking for. So, what are some common ways animation deals with these:

1. Should an animation complete before accepting another animation, or should it drop what it's doing and switch? A setting i'm guessing.
2. Should an animation, when done, repeat or revert to a default state.
3. Should the controlling object be constantly telling the animator device what state it should be in, or should it just send a signal once, and update each time the state switches?

I solved these in my own way, but I wasn't that happy with my choices, and rather than experimenting more, what does a good Animation process look like?

1. That's entirely up to the individual application. What makes sense for your app?  There's no way to give a definitive ansver to that. Many different solutions/options could be correct for any given program - pick what's right for you.

2. See "1.".

3. Depends on your overall design. There are many ways to "cut the cake" - what's right in your case "depends" and what's right in some other app may not be the same as in yours.

As for good animation classes. Take a look at the Thor Animations classes. They do a pretty good job of encapsulating general animation functionality (IMHO).

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6286
  • Thor Developer
    • View Profile
    • Bromeon
Re: Techniques For Animating
« Reply #2 on: October 27, 2014, 11:34:26 pm »
1. Should an animation complete before accepting another animation, or should it drop what it's doing and switch? A setting i'm guessing.
That depends on the game logic you're animating. If it's interrupted to show another animation, then switch instantly; if the new animation can wait, then let it finish.

2. Should an animation, when done, repeat or revert to a default state.
Same here: it really depends on what you animate. A looping animation like walking should repeat, while a one-time animation like casting a spell shouldn't.

3. Should the controlling object be constantly telling the animator device what state it should be in, or should it just send a signal once, and update each time the state switches?
When the controlling instance needs to know in which state the animation currently is, then there is no point of having an animator -- because that's exactly what the animator is supposed to do. thor::Animator accepts such signals via playAnimation() and will play the animation until finished or having new orders. In the meantime, it is constantly updated using update().
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

 

anything