Forums Gallery Downloads LOGIN |REGISTER

Setting up Aim IK for Custom Characters

Character and Object Animation Setup. Trackview Cutscenes Setup.


 

Terach
Just getting started
Just getting started
 
Posts: 8
Member since: 29.11.2012, 22:33
Likes: 0

Setting up Aim IK for Custom Characters

Postby Terach » 01.03.2013, 06:45

I'm having some trouble setting up Aim IK for my character correctly. My character often looks opposite of where I'm aiming and seems to snap to the aim poses. It's a bit weird because the character's Look IK works perfectly. Is there a way to fix or adjust this? You can see a video of the problem below.



I'm using the CryEngine 3 SDK and the character is using a custom skeleton, set up and exported from Maya. Any help would be appreciated!
User avatar
rocknroll237
Junior Dev
Junior Dev
 
Posts: 150
Member since: 10.08.2011, 19:10
Location: Somerset (England)
Likes: 1

Re: Setting up Aim IK for Custom Characters

Postby rocknroll237 » 02.03.2013, 22:29

Terry is an animator on our team and unfortunately, unless we get a reply to this post, we can't really do any more animation work.

Help would be very much appreciated. :-)
Part of the Star Wars: BattleCry team!
http://www.moddb.com/games/star-wars-battlecry


My rig:
i7 960 @ 3.2ghz, Asus Ares gpu @ stock, 6gb XMS3 DDR3 ram @ 1600mhz, Antec 1200 case, Samsung 840 256gb SSD, Asus P6X58D-E mobo
User avatar
Mika
Honourable Member
Honourable Member
 
Posts: 605
Member since: 01.11.2010, 15:28
Location: Orlando, FL
Likes: 10

Re: Setting up Aim IK for Custom Characters

Postby Mika » 04.03.2013, 23:12

It is hard to tell what went wrong with your animations. Possibly the aim poses are too narrow and don't cover enough of an angle. How many poses are you using? 9, 15 or 21?

Can you turn on the aim pose debug drawing and maybe post a screenshot/video of this?
ca_DrawAimPoses
Terach
Just getting started
Just getting started
 
Posts: 8
Member since: 29.11.2012, 22:33
Likes: 0

Re: Setting up Aim IK for Custom Characters

Postby Terach » 05.03.2013, 02:17

I'm using 9 poses for my Aim Poses, following the documentation. I tried widening the range of the poses a bit and that did seem to help with smoothing the tracking a little.

I turned on aim pose draw but I'm not quite sure what it does. The blue line that appears seems to always be pointing downwards and stays by the leg.
Image
I noticed on the default male character that it's supposed to follow his weapon bone. Is this part of the problem?

I'm also wondering if it could be a joint rotation problem, even if Look IK works?
User avatar
Mika
Honourable Member
Honourable Member
 
Posts: 605
Member since: 01.11.2010, 15:28
Location: Orlando, FL
Likes: 10

Re: Setting up Aim IK for Custom Characters

Postby Mika » 05.03.2013, 17:17

Hi again,
I was hoping for a screenshot inside the level with the debug draw on, but in general you are correct, the weapon bone should be giving the direction that the character is aiming in. The aim setup in the chrparams file takes care of this. You weapon bone (and if I remember correctly your should bone) are set up in there and your bone names should match the setup.
LookIK uses a different bone to calculate the rotation and it is likely that that setup in the chrparams file simply matches your character's setup.
Terach
Just getting started
Just getting started
 
Posts: 8
Member since: 29.11.2012, 22:33
Likes: 0

Re: Setting up Aim IK for Custom Characters

Postby Terach » 06.03.2013, 01:16

Here is the video of the debug inside the level. Hopefully you can get something from it.



I also double checked the chrparams file and the bone names match up. The definition is pretty much the same as the one in the documentation, but maybe there is something out of place.
Code: Select all
<AimIK_Definition>
   <DirectionalBlends>
      <Joint AnimToken="AimPoses" ParameterJoint="weapon_bone" ReferenceJoint="Bip01" StartJoint="Bip01 R UpperArm"/>
   </DirectionalBlends>
         
   <RotationList>
     <Rotation Additive="0" JointName="Bip01 Spine" Primary="1"/>
     <Rotation Additive="0" JointName="Bip01 Spine1" Primary="1"/>
     <Rotation Additive="0" JointName="Bip01 Spine2" Primary="1"/>
     <Rotation Additive="0" JointName="Bip01 Spine3" Primary="1"/>
     <Rotation Additive="0" JointName="Bip01 Neck" Primary="1"/>
     <Rotation Additive="0" JointName="Bip01 Head" Primary="0"/>

     <Rotation Additive="0" JointName="Bip01 R Clavicle" Primary="1"/>
     <Rotation Additive="0" JointName="Bip01 R UpperArm" Primary="1"/>
     <Rotation Additive="0" JointName="Bip01 R ForeArm" Primary="1"/>
     <Rotation Additive="0" JointName="Bip01 R Hand" Primary="1"/>
     <Rotation Additive="0" JointName="weapon_bone" Primary="1"/>

     <Rotation Additive="0" JointName="Bip01 L Clavicle" Primary="0"/>
     <Rotation Additive="0" JointName="Bip01 L UpperArm" Primary="0"/>
     <Rotation Additive="0" JointName="Bip01 L ForeArm" Primary="0"/>
     <Rotation Additive="0" JointName="Bip01 L Hand" Primary="0"/>
   </RotationList>


   <PositionList>
     <Position JointName="Bip01 R Clavicle"/>
     <Position JointName="weapon_bone"/>
     <Position JointName="Bip01 L Clavicle"/>
   </PositionList>

   <ProcAdjustments>
      <Spine JointName="Bip01 Pelvis"/>
      <Spine JointName="Bip01 Spine"/>
      <Spine JointName="Bip01 Spine1"/>
      <Spine JointName="Bip01 Spine2"/>
      <Spine JointName="Bip01 Spine3"/>
   </ProcAdjustments>
</AimIK_Definition>
User avatar
Mika
Honourable Member
Honourable Member
 
Posts: 605
Member since: 01.11.2010, 15:28
Location: Orlando, FL
Likes: 10

Re: Setting up Aim IK for Custom Characters

Postby Mika » 06.03.2013, 16:12

Hm, this is strange behaviour. I guess it must be something in the animation itself, since the aim poses of the SDK character seem to work fine.
You are using 9 poses, right? Have you been manually creating them, or using the aim pose script? (I am not sure Maya comes with a similar script as Max)
Are the upper aim poses covering at least the same angle range than the lower ones?
User avatar
DT85
Just getting started
Just getting started
 
Posts: 5
Member since: 07.03.2013, 02:16
Location: Australia
Likes: 0

Re: Setting up Aim IK for Custom Characters

Postby DT85 » 07.03.2013, 02:32

I had a similar issue when making Star Wars The New Era's aim directions on source engine. Can you please post a video again, but with what direction you're trying to aim?

Also, check to see if your bone axis orientation matches up to the original skeleton.


I'm going to download the tools and have a looksee at how the original skeleton is setup.
Terach
Just getting started
Just getting started
 
Posts: 8
Member since: 29.11.2012, 22:33
Likes: 0

Re: Setting up Aim IK for Custom Characters

Postby Terach » 07.03.2013, 22:14

I managed to partially solve the problem. It turned out that some of my joint orients still had values. After zeroing everything out and quickly reskinning and redoing the aim poses, aim ik seems to work now.

The down side is that there's a new problem. The spine has extra rotation to the left and my character seems to be looking to the left by default. It's a bit weird since all of my rotations are zeroed out and the character editor's preview is normal.



I am using 9 aim poses again, manually created without tools.
User avatar
DT85
Just getting started
Just getting started
 
Posts: 5
Member since: 07.03.2013, 02:16
Location: Australia
Likes: 0

Re: Setting up Aim IK for Custom Characters

Postby DT85 » 08.03.2013, 03:11

Very curious. Have you tried exporting the agent's skeleton from Maya? Your issues could be due to Maya's CryEngine plugins or your skeleton so we need to rule out one or the other.
Terach
Just getting started
Just getting started
 
Posts: 8
Member since: 29.11.2012, 22:33
Likes: 0

Re: Setting up Aim IK for Custom Characters

Postby Terach » 14.03.2013, 09:27

After some more tinkering I managed to get it to work! It turns out that the rotation of the weapon bone is very important. After a minor adjustment, all of the aim poses work normally.



Big thanks to Mika and DT85 for the help!
User avatar
rocknroll237
Junior Dev
Junior Dev
 
Posts: 150
Member since: 10.08.2011, 19:10
Location: Somerset (England)
Likes: 1

Re: Setting up Aim IK for Custom Characters

Postby rocknroll237 » 14.03.2013, 10:48

YES!

Thanks for helping Terach everyone, this is good news.
Part of the Star Wars: BattleCry team!
http://www.moddb.com/games/star-wars-battlecry


My rig:
i7 960 @ 3.2ghz, Asus Ares gpu @ stock, 6gb XMS3 DDR3 ram @ 1600mhz, Antec 1200 case, Samsung 840 256gb SSD, Asus P6X58D-E mobo


 
Connect and collaborate with CRYENGINE developers in the official Forums.
Visit the Gallery to share what you have created and be inspired by what others are creating with CRYENGINE.
Community