Game Development Community

Need help with recoil and look animations. (screenshots)

by Jan-Ove Leksell · in Artist Corner · 08/06/2005 (1:59 pm) · 17 replies

I recently made a post about having some problems with the death animation etc. but after a lot of looking around, reading resources and forum threads It seems that the idiotic problems I'm having are a result of me missunderstanding how the thread animation system and blender exporter works.

I downloaded the Show tool demo to have a look on the standard TGE orch and I seem to have most things down but I was suprised by the look and recoil, In my character I've made the two animations use different bones to avoid collison which sure works fine but that seems to be a work around as the orc uses the same bones in both animation without any problems (and it looks better when you can use all the bones in the arms for both animations)

Well, I've tried and tried but I just can't make it work, please have a look at my setup and tell me what I'm doing wrong:

The Root animation:
www.narcissisticstudios.com/pmodel/root.jpg
The Look:
www.narcissisticstudios.com/pmodel/look.jpg
And the Recoil:
www.narcissisticstudios.com/pmodel/recoil.jpg
Now when I open the model in TGE showtool and load "Root" and "look" it looks fine:
www.narcissisticstudios.com/pmodel/lar.jpg
But when I add the "recoil" animation the arms bend backwards straight into the shoulders and the head:
www.narcissisticstudios.com/pmodel/larar.jpg

When I put him in the TGE it looks the same and when I fire the weapon the recoil plays by making him slap himself on the back of the head.

Please help me out on this one, it's probably something obvious I'm missing but it's driving me mad.

#1
08/06/2005 (6:46 pm)
The recoil animation should be a blend animation and the first frame of it should be with your character's arms already posed in the root pose. It seems like the problem is that you're double-animating the arms, once in the root pose and once in the recoil. (or did you have the arms completely controlled by the look animation?)
#2
08/07/2005 (3:07 am)
@Jeff: Thanks for the reply! :) I'm not sure what you mean tho, if you look at the screenshots you can see that none of the arm bones are controlled by the root animation and that the recoil is a blend.. All arm bones are animate in booth look and recoil tho, is this wrong? When I looked at the orc in the showtool I got the impression thats how they did it? Please explain how it should be set up.

Also, the recoil animation has three keys, nr1 in the standard pose, nr3 in the recoiled pose and nr5 back in the standard pose. And if I just combine the root and recoil in the showtool that works aswell, it's as soon as I use booth the look and recoil animation that things go funky..
#3
08/07/2005 (9:46 am)
If your look and recoil animations are *actually* blend animations (double check by looking at the sequence properties in the show tool), the problem must be that the reference frame is a frame where the character is in the "bind pose", the original pose. So it's blending from there to the root pose twice. The way the orc and many other characters are set up (there's no one right way...) is that the root anim contains animation on all the bones, and both the look and recoil are blends on the arms on top of that.

I'm not sure with the blender exporter how you would mark the reference frame for the blends, but they need to be at the beginning of the animation, ie with the character already in the root pose.
#4
08/07/2005 (12:08 pm)
Double checked and yes, they are blends. Tried to add keys to the arm bones in the root anim and the result is similiar, the arms are still nowhere near where they are supposed to be :/ I'm not sure what frame it uses as the reference, can someone with experience in the blender exporter please explain?
#5
08/09/2005 (6:16 pm)
Is there no one who actually made it work with blender? Not just partialy, I mean the whole thing including, look, recoil, death, jump, run, reload, etc. etc.? I'm having trouble believing that's the case, at least I sure hope it's possible :/
#6
08/12/2005 (1:15 am)
The standard Blender exporter creates the root animation based on the _unrotated_ null rest position of the bones. This makes creating complex blend animations rather tricky, if not practically impossible.

In this thread, I describe how to modify the exporter Python scripts so that blends are based on custom root animations. Basically, with this modification the blend animations will not export their last frame, instead using it as the root reference (not the bone null position).
#7
08/13/2005 (5:13 am)
@Walter: Thanks for the reply, I did the changes to Dts_Blender.py that you suggested in the thread but when I export the model and load it into the showtool with just root and look the look animation goes from the top to the bottom and then continues to the middle (root) so the last frame is still exported for some reason.

I've made sure it's a blend, and I've tried to set the "root" pose of the arms as the last keys in the animation as well as set the "End:" of the animation in the Scene editor to 40 and then add the top arm pose to nr 1, the bottom to nr 39 and finally the root to 40 but nothing helps, are there anything else I need to do or am I just misunderstanding something?
#8
08/13/2005 (11:43 pm)
EDIT:
I tracked down the bug with my hack that was causing the last Blend frame to be exported under certain circumstances. Turns out that my own peculiar animating habits didn't trigger the bug, so I didn't quite catch it the first time around. This time it should work.

Here's a link to the corrected Dts_Blender.py hack: Dts_Blender_hack.zip.
#9
08/14/2005 (5:31 pm)
@Walter: I tried both versions (the old and the new edit) but still doesn't work, the 4:th frame (root) is still exported..

It's late and I'm tired, I'll give it another try tomorow if I have some time over, thanks for the help anyhow :] I'd be more then thankfull if you could make a simple boxman (.blend) with a root, look and recoil that works and post to see if I'm doing something wrong, if you have the time that is, thanks again for helping with this, I'ts driving me utterly insane >_<
#10
08/15/2005 (2:37 am)
@Jove: Here you go. Boxman with simple root, look, and recoil sequences. boxman.zip It should export correctly when using my exporter modification.
#11
08/20/2005 (3:40 am)
@Walter: Once again, thanks for the help. I tried your boxman but it give exactly the same result as my own model.. it exports all frames and send them all over the place when blended, but at least this got me thinking, maybe the problem is in my Blender/python/dts exporter setup? I'll re-install everything asap and give it a new try, what versions are you using?

EDIT: You are my fricking hero man! I tried going back to Blender 2.36 and it works! Seriously, I've been tearing my hair out for the better part of a month over this and when I go back a version of Blender and use your "hack" it works like a charm! Thanks for all the help and patience, you'll definitively going to get some cred when the game is finished :D

Edit2: Tried some things on my own model and a new problem occurred to me.. as it is now everything works fine as long as the arms have keys in the "root" animation which is fine if you only want to use one weapon, the problem is that the player needs separate look and recoil animation for each gun (try holding a handgun the same way as you do a heavy machinegun, you'll shoot yourself in the hand) We already have a working system that changes the look and recoil as you switch weapons implemented but when you don't have the "arm keys" in the root animation the look and recoil animations blends on top of the "null" position of the bones, resulting in the model looking like a lovesick scarecrow.

In essence, what we need is for the look and recoil animations to blend on top of the last frame (Correct me if I'm wrong but I got the idea that this is what it actually was supposed to do?) so that you don't need to animate the arms in the root/run/jump/fall/etc. animations. Otherwise you would have to make a separate animation set (all animations) for every single weapon and then code into TGE to switch between these which seems odd to say the least.
#12
08/20/2005 (6:36 am)
@Jove: Glad to see that it's working, though it's strange that you'd need to use Blender version 2.36; I'm using version 2.37a myself. My Python version however is at 2.3 since that's what Blender 2.37a has been compiled against.

Regarding the arms issue, the way I'm doing things is that I have one generic "holding weapon in front of self" set of sequences that are used for root, running, jumping, etc. I base the weapon look sequence on the generic root pose, and then I base the recoil sequence off the weapon pose.

For example, a rifle look sequence would be structured like this:

frame 1 - rifle pointing up
...etc etc...
frame x - rifle pointing down
last frame - generic root pose

and the rifle recoil sequence like this:

frame 1 - rifle recoil animation begin
...etc etc...
frame x - rifle recoil animation end
last frame - rifle pointing middle

Basically, in the actual game Torque will stack the animation threads on top of each other in order of root, look, and recoil. So the look must be based on the root, and the recoil must be based on the look.

EDIT: The original boxman file I posted doesn't show how this works, so here's an updated version. The *.blend file contains generic_root, generic_look, and generic_recoil animations, as well as rifle_look and rifle_recoil poses that blend properly with generic_root.

boxman2.zip
#13
08/20/2005 (6:37 am)
Good Thread. Thanks, it's given me a few things to consider. I seem to be having similar issues even though it's with the ms3d dtsplus! exporter...
#14
08/27/2005 (8:17 am)
@Walter: Played around with it and I'm finally getting the hang of it all, and at the moment I can't find any more problems, everything seems to work fine. Thanks again for all the help, I would have gone mad without it :)
#15
09/01/2005 (4:38 am)
I'm up against the same problem now myself, this is a great thread, I too am tearing out my hair over this :)

Is there any chance this will get easier in the next release of the exporter?

Plus is there a definative guide on the current process somewhere on the net?

Thanks,

Nigel
#16
09/01/2005 (3:00 pm)
Nigel,

This problem will definately be fixed in the next release.
As for when the next release will be, its taking a while, so don't ask :)

I would suggest using walter's hack in the short-term. Otherwise, model all of your blend animations relative to the the root armature pose.
#17
09/05/2005 (12:25 am)
Most excellent to hear.

Keep up the good work!