Jump to content
A 2021 backup has been restored. Forums are closed and work in progress. Join our Discord server for more updates! ×
SoaH City Message Board

[MMF2] Animation, bleh?


Asuma

Recommended Posts

Dami and DW call them "States", but ive been using technically the exact same thing for years now. I just came across the method out my head while programming an old fighting game around 2001.

Basically, you should have a system that dictates everything that should be happening and why. I call them "Action Variables", because every single action in my engine can be carried out by simply changing this "Action Variable" to a different value.

for example, when my AV is 0, this is mostly normal walking, running and jumping with no special events or actions happening. So, my animation events go something like this:

[X of (player) = 0]

[Y of (player) = 0]

[ Ground Sensor of (player) = overlapping obsticle background]

[Action Value of (Player) = 0] ---> change animation to Standing.

[X of (player) > 0 ]

[X of (player) </= 5]

[Y of (player) = 0]

[Action Value of (Player) = 0] ---> change animation to Walking.

However, these events can be overridden completely with the change of one simple ingame alteration -- changing the Action Value to anything other than 0. (This includes decimals as well. You can use 0 /0.1/0.2/0.3 too, giving you an almost endless amount of actions and alterations possible to your engine.

So, if those conditions are met and the Action Value is DIFFERENT than 0, then the animations will not play. From here you can actually create different things to happen when those exact same events happen and just assign a different variable, like 1 or 0.1. Also, you can easily do something such as getting hit, and have your animation not get stuck.

Events for that :

[(laser) collides with (player)] ---> Set Action Variable(player) to 1

[Action Variable(player) = 1] ----> Set Animation(player) to Hurt

[Action Variable(player) =1]

[Animation "Hurt" is over] ----> Set Action Variable to 0

This way, when your character gets hurt, they have no way of any other animation getting in its way.

However, everything in your engine has to be setup this way, but in all truth this eliminates the amount of events you need by a pretty large fraction. Anytime you need your character to get hit, just change the action variable.

This system is almost required for something such as a fighting game or action-adventure platformer. Simple [player collides with (laser) --> set animation to hurt] events clash with tons of other events in your game, so its really not smart to do it that way.

And on top of that, having to put [Animation (x) is not playing] one hundred trillion times can be confusing and looks really sloppy too. Its far more simple to simply put [Action Variable =/= (x)] and have that count for about 10 different instances instead.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...