Skip to main content
GameDev.net gamedev.net
🔒 Locked

Animation Switching System

Started by Dark Metamorphosis Nov 24, 2004 at 1:27 PM 3 replies 750+ views
Original Post
Dark Metamorphosis
Dark Metamorphosis
hello, well, I am currently working on my character animation. so I want him to be able to walk, and jump, and do a 3 combo punch, aim with the gun, shoot, sneak...you get the idea. I've done the animation in 3d studio max, and exported them to x-file, with one animation set for each action (walk, run, jump....). here comes the hard part, I spent a lot of time trying to find how to make the transaction between the animations, (so the character is standing, then I press UP, he should just start to run, then loop the running animation, when he stops, play a stopp running animation). All I came to is the many nested if elses, but I think that this isn't the bestway to do this. So could any one tell me what is the best approach here please, and what is you own experience in this. Thanks.
K'-P = ME
JuNC
JuNC
You probably want to look up 'finite state machines'. The idea is that each animation sequence would be a state and events like 'up' cause the machine to transition between states. Your nested if/else tree does essentially the same thing but FSMs are more general (and more readable).

I could give an example but I think you'd do best looking it up yourself and learning the theory rather than just a single example (since they're useful elsewhere too). Try this to get started.
WebsiteWill
WebsiteWill
Take a look at this
http://www.gamasutra.com/features/20030704/edsall_01.shtml
I'm no professional here but I think this would provide the most realistic method of animation. It also may be more detailed than what you are looking for.

Do a search on Animation Blending and you will find lots more good information.

Hope it helps,
Webby
chevluh
chevluh
It doesn't exactly offer you an implementation, but there's my answer to a previous, similar question, using state machines and with an example of the concept.

http://www.gamedev.net/community/forums/topic.asp?topic_id=280107
Dark Metamorphosis
Dark Metamorphosis
ok guys, thanks for your help, I'll go with the FSM, and do some searches.
K'-P = ME

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.