6th Venom@Posted: Thu Oct 30, 2008 5:09 pm :
Did anyone encountered a strange animation deformation that happen when you enable legs IK, that make your custom character walking like a frog?

By walking like a frog i mean: the knee go to the exterior while the ankle is going up, and then back pointing in front of the character while the ankle going down...

Doom3 IK is something i don't know very well.
If someone can help me to understand the very basics, this would be 'kewl' :D

a few questions:
A) What is "anim ik_pose" used for exactly?
B) What are "ik_footUpTrace", "ik_footDownTrace" and "ik_liftWaist" for?
C) What are "ik_numArms" (& co) usefull for? (i mean is it used when the player fall, when the player is against a wall, or something like that?)
D) Is there some "rules" to respect to have a fully workable IK, like never do x thing in your animations? (like put the ankle upper than the knee for exemple...)

Thanks for any infos!



der_ton@Posted: Thu Oct 30, 2008 9:58 pm :
There are helper bones in the skeletons that are referenced in the ik portion of an entity definition. They tell the engine the directions in which a joint should move when it is to be moved by ik. For example the imp has RKnee and LKnee bones in the md5mesh file for that purpose, they are positioned outside of the body infront of the actual knee bones.

A related thread that might have some hints: viewtopic.php?f=3&t=20904&p=192423



6th Venom@Posted: Thu Oct 30, 2008 10:44 pm :
Hey, thank you!

I managed to solve my problem early in the evening.
I found that the IK_pose anim got to have legs oriented in the direction you want these to be by the IK when walking/running, plus if you look carefully at this anim too, you'll see that Lknee & Rknee are far away from the rest of the body, in the "right" direction/orientation for legs.

Looking at the sdk, i think i understood that the walk anim is combined with a modified IK_pose anim, modified by the IK system itself.
So you got to do an IK_pose very similar to the way your character walk/run (usually a T pose) and not use an initial star pose (isolated legs & arms).

Still missing the arms IK use... :?



BloodRayne@Posted: Fri Oct 31, 2008 7:27 am :
We've encountered all of these issues with IK and more with Edge of Chaos. And I'm not sure if we've even solved them, allthough all of our anims look good now in game. We've fiddled with this for months on end. Trying to get a custom creature with good IK but there is very little information on it available.

The code below works fine, but as soon as we uncomment the IK_Dir keys things go terribly wrong, the feet end up underground, as if the bones are placed wrong. If anyone has *any* ideas on how to solve this. I'd be greatly appreciative. :)

Code:
   "ik_numLegs"               "2"
   "ik_footSize"               "16"
   "ik_waist"               "Hips"
   "ik_hip1"               "Lupleg"
   "ik_hip2"               "Rupleg"
   "ik_knee1"               "Lloleg"
   "ik_knee2"               "Rloleg"
   "ik_ankle1"               "Lball_r"
   "ik_ankle2"               "Rball_r"
   
   //this works, but feet go underground.
   //"ik_dir1"               "ltip_r"
   //"ik_dir2"               "rtip_r"
   
   "ik_foot1"               "Rtoe1_r"
   "ik_foot2"               "Ltoe2_r"



der_ton@Posted: Fri Oct 31, 2008 9:15 am :
Where are those ltip_r and rtip_r bones placed? Do you have a screenshot with the skeleton and the bone names?
I've taken a look at the SDK's IK.cpp. The bones used as ik_dir are used automatically by the engine in relation to the respective ik_knee bones (only the helper bone's position is used, the orientation seems not to be relevant). They are helpers to determine where to move the knee, and can't be used as a target for any other bone.

I only took a quick glance at this, and I've never played around with that stuff with practical experience. If you have a coder, he might be able to understand from the ik.cpp how the ik stuff in the def file is supposed to be set up.
http://www.koders.com/cpp/fidDB6CEB7E30 ... Joints#L12



6th Venom@Posted: Thu Oct 30, 2008 5:09 pm :
Did anyone encountered a strange animation deformation that happen when you enable legs IK, that make your custom character walking like a frog?

By walking like a frog i mean: the knee go to the exterior while the ankle is going up, and then back pointing in front of the character while the ankle going down...

Doom3 IK is something i don't know very well.
If someone can help me to understand the very basics, this would be 'kewl' :D

a few questions:
A) What is "anim ik_pose" used for exactly?
B) What are "ik_footUpTrace", "ik_footDownTrace" and "ik_liftWaist" for?
C) What are "ik_numArms" (& co) usefull for? (i mean is it used when the player fall, when the player is against a wall, or something like that?)
D) Is there some "rules" to respect to have a fully workable IK, like never do x thing in your animations? (like put the ankle upper than the knee for exemple...)

Thanks for any infos!



der_ton@Posted: Thu Oct 30, 2008 9:58 pm :
There are helper bones in the skeletons that are referenced in the ik portion of an entity definition. They tell the engine the directions in which a joint should move when it is to be moved by ik. For example the imp has RKnee and LKnee bones in the md5mesh file for that purpose, they are positioned outside of the body infront of the actual knee bones.

A related thread that might have some hints: viewtopic.php?f=3&t=20904&p=192423



6th Venom@Posted: Thu Oct 30, 2008 10:44 pm :
Hey, thank you!

I managed to solve my problem early in the evening.
I found that the IK_pose anim got to have legs oriented in the direction you want these to be by the IK when walking/running, plus if you look carefully at this anim too, you'll see that Lknee & Rknee are far away from the rest of the body, in the "right" direction/orientation for legs.

Looking at the sdk, i think i understood that the walk anim is combined with a modified IK_pose anim, modified by the IK system itself.
So you got to do an IK_pose very similar to the way your character walk/run (usually a T pose) and not use an initial star pose (isolated legs & arms).

Still missing the arms IK use... :?



BloodRayne@Posted: Fri Oct 31, 2008 7:27 am :
We've encountered all of these issues with IK and more with Edge of Chaos. And I'm not sure if we've even solved them, allthough all of our anims look good now in game. We've fiddled with this for months on end. Trying to get a custom creature with good IK but there is very little information on it available.

The code below works fine, but as soon as we uncomment the IK_Dir keys things go terribly wrong, the feet end up underground, as if the bones are placed wrong. If anyone has *any* ideas on how to solve this. I'd be greatly appreciative. :)

Code:
   "ik_numLegs"               "2"
   "ik_footSize"               "16"
   "ik_waist"               "Hips"
   "ik_hip1"               "Lupleg"
   "ik_hip2"               "Rupleg"
   "ik_knee1"               "Lloleg"
   "ik_knee2"               "Rloleg"
   "ik_ankle1"               "Lball_r"
   "ik_ankle2"               "Rball_r"
   
   //this works, but feet go underground.
   //"ik_dir1"               "ltip_r"
   //"ik_dir2"               "rtip_r"
   
   "ik_foot1"               "Rtoe1_r"
   "ik_foot2"               "Ltoe2_r"



der_ton@Posted: Fri Oct 31, 2008 9:15 am :
Where are those ltip_r and rtip_r bones placed? Do you have a screenshot with the skeleton and the bone names?
I've taken a look at the SDK's IK.cpp. The bones used as ik_dir are used automatically by the engine in relation to the respective ik_knee bones (only the helper bone's position is used, the orientation seems not to be relevant). They are helpers to determine where to move the knee, and can't be used as a target for any other bone.

I only took a quick glance at this, and I've never played around with that stuff with practical experience. If you have a coder, he might be able to understand from the ik.cpp how the ik stuff in the def file is supposed to be set up.
http://www.koders.com/cpp/fidDB6CEB7E30 ... Joints#L12