Game Development Community

Independant animation frames

by Ajari Wilson · in Torque Game Builder · 08/30/2005 (12:57 pm) · 2 replies

I have a question about character animation frames. Ok here's the scenario. The main character from Contra or Metal Slug is running with a gun in his hand. We'll say it's about 4 frames of animation total. He isn't shooting so his arms are swaying naturally with the run. At any point and time I can fire his weapon, triggering a completely new animation for his upper body by raising his gun in front of him, and recoiling it back in mid run as many times as I want, and his legs never skip a beat.

How is this done? The only things I can think of is either make every frame of animation for every possible situation. Triggering frame 27 when you want to throw a grenade while jumping instead of shooting while jumping or simply jumping. Or cut the character in half allowing his upper body the be independent from his legs so that any action can happen at any time without causing the character to stutter step or glitch out.

My best guess would be my last assumption. If I'm correct, how easy is something like that to do in T2D? Is it a feature that would take a few minutes for the average person to include or would it be a grueling test of programming prowess to accomplish? Is it a simple feature that is already possible in T2D through scripts or would I have to add code in C++ and somehow modify T2D to add this feature?
Thanks,
-Ajari-

#1
08/30/2005 (1:43 pm)
It is trivial to accomplish with some of Torque2D's built-in capabilities, entirely doable within script alone. You'd basically have two separate objects, one for the lower body and one for the upper, with the upper mounted on top of the lower using the .mount() function. The hardest part would be designing the artwork itself, depending on the view angle. Think of the character composition as a tank with a turret.

The only time it could get complicated is if you have plans for animations that involve both sprites at once. For example, a jump animation having the torso and arms animate in addition to the legs crouching and leaping; you can still run into situations where transitions from one state to another (mid-firing to jumping for example) won't be covered, But these can be minimized or eliminated of course by designing around them (e.g. not allowing a jump to happen while firing, not allowing the upper-body jump animation to override a fire animation, etc.)
#2
09/05/2005 (11:41 pm)
I think having a shoot/grenade upper body animation override any idle upper body animation like jumping or running is the only way to go.

You telling me that the art work will be the hardest task for this particular feature has given me a tremendous amount of confidence. Thanks Luke.
-Ajari-