Merrak's Non-Isometric Adventures -- Planar Programming

merrak

  • *
  • Posts: 2644
Devlog 5. This is the second part on my "state machine" approach to handling dozens of animations. Fun stuff if you want to create a cinematic platformer!

<a href="https://www.youtube.com/v/Z4EW1VzMLNA" target="_blank" class="new_win">https://www.youtube.com/v/Z4EW1VzMLNA</a>

mdotedot

  • Posts: 1640
Hey Merrak,

Great devlog as always.

Thank you for working on your animation/state manager.

As you may know I'm investigating this myself.

The 'standard' animation manager from the jump and run-kit works fine for non-interactive objects and when you don't have a lot of states.

I've hit on the animation manager problem on two projects that involved:
  • Animation sequence involving multiple actors
  • Switching animation during an animation

When you have an animation sequence where you for instance push a rock. Ideal you go from idle/stand position to a push behavior.
Then you move the actor and you need to check if the actor really 'hits' the other actor and then the rock needs to move in sequence of the push animation.

When the player holds down the direction key the push animation shouldn't become an Idle/Stand but keep on pushing. But when the player does  not hold the direction key the animation should go to 'from push to idle'.
And then when you are in the animation sequence of going from push to idle and during that animation the player hits the direction button again it should go back to the push animation sequence.
That applies to turning around as well while in push state. The rock should be going to the direction it needs to go (tile based) and the player could move away.

My approach wasn't behavior-based. And I'm not sure if that is the right direction for me to take.

Do After blocks indeed are problematic. (Especially with the slide block from Stencyl which has duration and using do after that duration )

Change-State-Matrix is something I was thinking about, but I'm not sure if that is the right approach.

I'm thinking of a more frame-based approach but I still do not have code to back it up.



Hanging out in the Chat:  http://www.stencyl.com/chat/

Proud member of the League of Idiotic Stencylers! Doing things in Stencyl that probably shouldn't be done.

merrak

  • *
  • Posts: 2644
Great devlog as always.

Thanks! :D

Animation sequences with multiple actors is well beyond the scope of what I'm trying to accomplish, but switching animations within another animation is what I'm working on right now to try to smooth out the run -> turn to face other direction -> continue running sequence. This is the one I showed that had the extra frame that had Marika pointing the wrong direction. Unfortunately, that's the symptom of a much larger problem with player controls. In order to turn around while running, the player will have to hold down the new direction while also holding down the previous direction. If there's a frame in which the player releases both keys, Marika will stop.

Fortunately, I may have solved this problem by accident. The first three frames of the six-frame turning animation are also the same three frames that make up the animation for the stopping state. So all I need to do is check which direction key (if any) the player is holding when the stop state comes to, well, a stop.



merrak

  • *
  • Posts: 2644
Devlog 6. It's election time! In Update 6, we'll take a look at a problem regarding NPC leadership--and how the state manager might be used to solve it.

<a href="https://www.youtube.com/v/206G8Ol4AUA" target="_blank" class="new_win">https://www.youtube.com/v/206G8Ol4AUA</a>