One more animation sequence question...
by Stefan Beffy Moises · in Torque Game Engine · 05/15/2002 (2:15 pm) · 14 replies
Sorry for this, there are already dozens of animation related questions around, but I still don't totally understand the sequence thing... especially in conjunction with the Milkshape exporter...:-(
It seems nobody has ever used MS to export a fully animated main player... at least I didn't get sufficient answers yet... :-(
So, basically, the question is: how is the animation sequence stuff handled with a single dts file which has all the animations included? (Or how is it handled in general in detail?)
For MAX, there is player.cs defining all the sequences (default: 0-29) pointing to the various DSQs... so far, so good... now Milkshape enters the stage and I'm getting confused... no DSQs, so no sequences, so I don't need the TSShapeConstructor(PlayerDts) helper at all - 1st question: do I still need a player.cs file (only containing something like)
datablock Foo(MSDts)
{
baseShape = "./player.dts";
};
??
2nd question: how are the animations handled in the engine then?
I got the key bindings for the animations in script (e.g. default.bind.cs), a global variable like "$showRightAction", and all the engine code in player.* , moveManager.h and gameConnectionMoves.cc ...
How does this all play together?
Are the animations simply looked up by name then? Or do they have to be in the right order to match a hard coded array structure?
Our current problem is, the "root" and "run" animations work very well, but then we added one more, named "side" (you'll guess what it's supposed to do... ;-), but this one doesn't show up at all... no matter what we write into "player.cs"...it would always play the "root" animation while moving sidewards...
So maybe we need some "core" animations which HAVE TO be there? - those may be:
Do we need a "back" animation before we can use the "side" one?
Well, quite confused right now, maybe someone could shed some light? Would be greatly appreciated!! :-)
Thanks!
It seems nobody has ever used MS to export a fully animated main player... at least I didn't get sufficient answers yet... :-(
So, basically, the question is: how is the animation sequence stuff handled with a single dts file which has all the animations included? (Or how is it handled in general in detail?)
For MAX, there is player.cs defining all the sequences (default: 0-29) pointing to the various DSQs... so far, so good... now Milkshape enters the stage and I'm getting confused... no DSQs, so no sequences, so I don't need the TSShapeConstructor(PlayerDts) helper at all - 1st question: do I still need a player.cs file (only containing something like)
datablock Foo(MSDts)
{
baseShape = "./player.dts";
};
??
2nd question: how are the animations handled in the engine then?
I got the key bindings for the animations in script (e.g. default.bind.cs), a global variable like "$showRightAction", and all the engine code in player.* , moveManager.h and gameConnectionMoves.cc ...
How does this all play together?
Are the animations simply looked up by name then? Or do they have to be in the right order to match a hard coded array structure?
Our current problem is, the "root" and "run" animations work very well, but then we added one more, named "side" (you'll guess what it's supposed to do... ;-), but this one doesn't show up at all... no matter what we write into "player.cs"...it would always play the "root" animation while moving sidewards...
So maybe we need some "core" animations which HAVE TO be there? - those may be:
{ "root" }, // RootAnim,
// These are selected in the move state based on velocity
{ "run", { 0,+1,0 } }, // RunForwardAnim,
{ "back", { 0,-1,0 } }, // BackBackwardAnim
{ "side", }, // SideLeftAnim,
// These are set explicitly based on player actions
{ "fall" }, // FallAnim
{ "jump" }, // JumpAnim
{ "standjump" }, // StandJumpAnim
{ "land" }, // LandAnimin order to make our model behave correctly??Do we need a "back" animation before we can use the "side" one?
Well, quite confused right now, maybe someone could shed some light? Would be greatly appreciated!! :-)
Thanks!
About the author
#2
seq: root=1-4, fps=1, cyclic
seq: run=40-57, fps=24, cyclic
seq: back=20-38, fps=18, cyclic
seq: side=60-72, fps=18, cyclic
and as mentioned, run and back are working, "side" isn't, the engine is playing the default root animation when walking sidewards...
Any ideas what might be wrong with our model??
Thanks very much!
05/15/2002 (10:00 pm)
The strange thing is we're doing exactly the same as far as I can tell... (we're also using the material list - just fewer animations yet) - here's the list of our character...seq: root=1-4, fps=1, cyclic
seq: run=40-57, fps=24, cyclic
seq: back=20-38, fps=18, cyclic
seq: side=60-72, fps=18, cyclic
and as mentioned, run and back are working, "side" isn't, the engine is playing the default root animation when walking sidewards...
Any ideas what might be wrong with our model??
Thanks very much!
#3
A tip: don't make your material names too long, there is a 31 character limit. You can remove the space after the commas to claw back some more characters.
05/15/2002 (10:32 pm)
You have to make sure that for the motion animations, that your 'base' node (the one that all the others branch from) moves a few units in the direction of the motion over the course of the sequence... have you done that ?A tip: don't make your material names too long, there is a 31 character limit. You can remove the space after the commas to claw back some more characters.
#4
Yes, I guess so... the whole character (and therefore ALL the joints) are moving a step sidewards during the "side" animation... in fact that's the only difference to the run animation (which runs completely at the same location - that is, the model doesn't "move" at all) - may that be the problem? Does the character have to stay at the same location during the side animation, too? Maybe I could send you the MS file and you could have a quick look at it? Our modeller is really frustrated having wasted the whole day to get this animation to show up in the engine... :-( Btw., didn't know about the 31 character limit...
Thanks again for your help!!
EDIT: Forgot to mention that the "side" animation works in the show tool...
EDIT#2: We now got "jump" and "land", too, and strangely enough these DO work, so it *seems* to be a specific problem with the "side" animation... maybe some Milkshape guru could have a look at it... would be great! :-)
05/15/2002 (10:49 pm)
Thanks for your answers, Ken!Yes, I guess so... the whole character (and therefore ALL the joints) are moving a step sidewards during the "side" animation... in fact that's the only difference to the run animation (which runs completely at the same location - that is, the model doesn't "move" at all) - may that be the problem? Does the character have to stay at the same location during the side animation, too? Maybe I could send you the MS file and you could have a quick look at it? Our modeller is really frustrated having wasted the whole day to get this animation to show up in the engine... :-( Btw., didn't know about the 31 character limit...
Thanks again for your help!!
EDIT: Forgot to mention that the "side" animation works in the show tool...
EDIT#2: We now got "jump" and "land", too, and strangely enough these DO work, so it *seems* to be a specific problem with the "side" animation... maybe some Milkshape guru could have a look at it... would be great! :-)
#5
05/16/2002 (10:21 pm)
Okay, now everything seems to work *besides* this "side" animation... is there anything specific to it? Any difference to all the other anims? Is he supposed to actually *move* to the side in Milkshape or should the animation stay "in place" / on the same spot (like the "run" animation for example)??
#6
05/16/2002 (10:52 pm)
hmmmmm....both my run and side animations move in space in their respective sequences, and they both work.
#7
05/16/2002 (10:57 pm)
Hm, so I don't see any difference at all... it just won't work... :-( Any other idea?? I really can't think of anything else now...
#8
05/17/2002 (6:17 am)
Try fiddling with the framerate. I know that there seems to be a 'sweet spot' with respect to the ratio of actual animation frames to the framerate, which I can't recall at the moment.
#9
05/17/2002 (9:17 am)
Ken, could you write up a resource on this? Sounds great.
#10
Alc
05/17/2002 (9:18 am)
Did you double check the sequence names? I'm pretty sure they are case sensitive so check that too. All the .cs file does is supply a pointer to the engine with which animations to pick up and where they are. Sequences are referenced by name so the order shouldn't matter.Alc
#11
05/17/2002 (1:49 pm)
Yes, we at least "triple-checked" the sequence names and changed the frames dozens of times, and the strange thing is that it *gets* exported and the show tool actually *plays* it... but it doesn't work in-game... :-(
#12
I finally got 1.3 BETA released last night, and every single tester encountered times when they were running along fine, then the run animation stopped, and then started again. Same with the side anims, the kneel, the jump, and another one - probably all actually exhibit the intermittant behaviour problem. One test never sees any animation at all, ever (when I was watching him, I didn't see his anims either, but I did for the other testers). So far that's 9 BETA testers - plus a few that were in that I haven't spoken to yet.
I suspect that perhaps it's a blending issue, since sometimes I can get the animations going again by changing the player actions, like selecting a different weapon, jumping, dieing and respawning, etc.
Then they will stop again... There is no way in MS to specify a blend sequence. I don't know why, but I managed to convince myself that two sequences that had mutually exclusive affected joints in their keyframes would simply 'automatically' blend together, but that may not be the case.
05/18/2002 (1:16 pm)
There is definitely a problem in-game, and it's not just related to the side animation.I finally got 1.3 BETA released last night, and every single tester encountered times when they were running along fine, then the run animation stopped, and then started again. Same with the side anims, the kneel, the jump, and another one - probably all actually exhibit the intermittant behaviour problem. One test never sees any animation at all, ever (when I was watching him, I didn't see his anims either, but I did for the other testers). So far that's 9 BETA testers - plus a few that were in that I haven't spoken to yet.
I suspect that perhaps it's a blending issue, since sometimes I can get the animations going again by changing the player actions, like selecting a different weapon, jumping, dieing and respawning, etc.
Then they will stop again... There is no way in MS to specify a blend sequence. I don't know why, but I managed to convince myself that two sequences that had mutually exclusive affected joints in their keyframes would simply 'automatically' blend together, but that may not be the case.
#13
Anyone? Please...! :-(
05/19/2002 (9:42 am)
It actually *works* in-game, if we replace for example the "run" animation with our "side" animation, the engine plays "side" while the character is moving forward... but it still doesn't play the "side" animation for the side movements...!Anyone? Please...! :-(
#14
seq:root=1-50,fps=10,cyclic
seq:throwdart=52-56,fps=15
06/16/2002 (12:18 pm)
Ken, In what file are you listing the special material sequences you described above? Such as:seq:root=1-50,fps=10,cyclic
seq:throwdart=52-56,fps=15
Torque Owner Ken Finney
Tubetti World
For the standard animations:
root (idle...)
run
side
back
jump
etc.
I just use the special materials technique, with those names as the names for the animations. They are invoked automatically by the engine when the player's motion transform have the right characteristics - basically the appropriate velocity vector triggers the animation.
For the others I've defined myself, like kneeling, going prone or rolling to supine, I use %obj.setActionThread("xxx");
One note of caution: if I use the standard Death animation tags (Death0..Death10) I get a crash with models exported from Milkshape. So, I've renamed them Die1, Die2, etc and invoke them manually when the player dies. I haven't tried debugging that problem yet.
here's my list of special sequence materials for our Standard Male character (I expect to add about another half dozen, probably all gestures):
seq:root=1-50,fps=10,cyclic
seq:throwdart=52-56,fps=15
seq:drink=58-66,fps=15
seq:headside=25-52,fps=15
seq:side=83-87,fps=15,cyclic
seq:walk=88-95,fps=5,cyclic
seq:jump=97-100,fps=5
seq:run=98-108,fps=15,cyclic
seq:push=110-120, fps=15
seq:look=115-121,fps=15
seq:kneel=121-127, fps=10
seq:land=122-127, fps=10
seq:pickup=122-135, fps=5
seq:stand=128-135, fps=15
seq:standjump=132-135,fps=5
seq:situp=137-140,fps=10
seq:sitdown=141-143,fps=10
seq:seated=144-151,fps=10
seq:sit=152-161,fps=10
seq:head=164-165
seq:crawl=195-200
seq:swim=195-200
seq:back=165-168,fps=10
seq:fall=185-186,fps=10
seq:die1=162-181,fps=10
seq:die2=183-200,fps=5