Animating Characters Tutorial

From HEWIKI
Jump to: navigation, search

Icon 3dsMax.png Icon Maya.png

Contents

He advanced.png


This page offers a walkthrough for Animators preparing the various character files required for Hero Engine.

Overview

This tutorial goes over various ways of applying Animation (vda) to a character, by briefly touching on the processes of different types of animations and the accompanying animation sequences (.asq's). Along with these, it is also necessary to review the information on the animation agent (.aas), in order to wire all of the animation sequences together.

Examples such as idle, turn, walk and run, death, transitions, impacts, and attacks are covered from a content creation standpoint. Wiring animation together is a much larger topic, which is covered in the animation wiring section of this wiki.

Details on error-free exporting are located at the Hero Export Guide.

This following process is the same for static and dynamic characters.


Anim ghosted run.jpg


Review

Some things to keep in mind when creating animation content:

3ds Max


Maya



After the animation content is created:

The following three file types are all located in a given character's animation folder:

  1. Animation Agent files are .aas and have the same name as the character's .dat file
  2. Sequence files are .asq. Every Animation file has at least one .asq associated with it. This is generally the same name as the animation file.
  3. The animationset.dat is just a list of all .asq files that are available for the given character.


Using the SRB in 3ds Max

Anim SRB1.jpg

The SRB (Synthetic Root Bone) is used by HeroEngine to track and control a character's position and orientation as well as syncing animations. As an Animator, think of it as a portal that links all your animations together. The rest of the rig is really just aesthetic. To keep it from popping, keep the pose the same.

For best results, the SRB should be controlled in different ways depending on the goal of the specific animation. Since HeroEngine thinks about this bone as the location of the character, its motion should probably be restricted as much as possible. By default, it stays on the ground plane and directly under the Bip01 bone.

To gain familiarity with how this works:

  • The upper section contains locks, which may not be used very often, but can still be helpful. When the Lock for a given Move, Rotate, or Scale is on, you cannot move the SRB. If you uncheck any of them, you will be able to key frame and use that specific axis to better control the motion of the SRB.
  • The Inherit section on the bottom section allows for the SRB to have automated motion. By checking any of the Move, Rotate, or Scale boxes, the SRB is unrestricted, and allowed to move on its own, relative to the Bip01 bone. 98% of the time this is how the SRB is controlled, and rarely is it necessary to override this with the Locks.



Using the SRB in Maya

SRB maya shelf.png

The SRB (Synthetic Root Bone) is used by HeroEngine to track and control a character's position and orientation as well as syncing animations. As an Animator, think of it as the portal that links all your animations together. The rest of the rig is really just aesthetic. To keep it from popping, keep the pose the same.

For best results, the SRB should be controlled in different ways depending on the goal of the specific animation. Since HeroEngine thinks about this bone as the location of the character, its motion should probably be restricted as much as possible. By default, it follows the Bip01 (or root joint) in an offset location at ground level.

To gain familiarity with how this works:

  • there are 6 buttons with the SRB icon that are used for toggling the motion of the SRB on or off. They are:
  • tx toggle
  • ty toggle
  • tz toggle
  • rx toggle
  • ry toggle
  • rz toggle
  • When the border around the icon is red, this means that the axis of motion has been muted, so it will not inherit the motion from the bip01/root joint on that axis.
  • If the border is green, that means that it will inherit the motion from the bip01/root joint on that axis.


Exporting Animation

  1. Hide any unwanted objects/helpers, or additional parts in the background before export
  2. Any additional rigging components (helpers), do not need to be exported.
  1. Normal idles
  2. Combat idles
  3. Walks, runs, and locomotion
  4. Attacks
  5. Turns
  6. Combat turns
  7. Specialty cases
  8. Anything that gets additional or alternate rigging will get its own file as well.

The section highlighted in Orange is for Curve Tolerances. Changing these values controls how the animation curves are compressed on export. Position and scale Tolerances are rarely used since almost all character animation is based on Orientation Tolerances. If you find your characters' feet are not staying put or you need to have a bit more accuracy with a certain animation, simply dial down the Orientation Tolerance to a lower number. This results in a bigger file, so only dial down the animations that really need it.

All of the following animations will be exported with the animation(vda) mode checked.

3ds Max exporter
Maya exporter



Animating

That all being said, Let's Animate! It is important to note here, that All of the code you see on this page involving ASQ sequences no longer needs to to be edited by hand. The animation panel in the engine now handles all the editing of these nodes. The code on this page will be left intact as a reference to what is going on under the hood. Also, these can still be edited by hand without the panel if the need should ever arise.


Idle Animations

Idle animations Start and Stop in the same pose, position, and orientation. Even though your character may sway a little bit, or move and come back to the starting spot, you want the SRB to stay perfectly still.


Walk/Run Animation

HE-anim panel tutorial walkrun.png
With animations such as the following, the character translates on the Y-axis only.

On the SRB Inherit panel, check the Move Y check box, once again at the beginning of your animation. This allows the SRB to move underneath the Bip01 along the Y axis, accurately displaying its movement to HeroEngine.

Once your animations are exported, Animation Sequence files, .asq's, need to be created. There will be three sequences to create a walk/run blend. To apply animation sequences:

This is what your walk .asq will look like:

!
! Animation Sequence Spec
!
Version=1
[ABILITIES]
  Apply Animation
    .Animation=walk.hgm
    .InitialSpeed=1
    .InitialLoop=true
    .InitialAlign=false

This is what your run .asq will look like:

!
! Animation Sequence Spec
!
Version=1
[ABILITIES]
  Apply Animation
    .Animation=run.hgm
    .InitialSpeed=1
    .InitialLoop=true
    .InitialAlign=false

This is what your walk/run .asq will look like:

!
! Animation Sequence Spec
!
Version=1
[ABILITIES]
  Speed Blend
    .SequenceA=walk
    .SequenceB=run
    .SpeedController=Speed
    .LowSpeedA=0
    .HighSpeedA=.4
    .LowSpeedB=.2
    .HighSpeedB=1
    .SequenceAFeedbackName=Feedback_WalkSpeed
    .SequenceBFeedbackName=Feedback_RunSpeed

Now that the sequences have been created, add them to the Animationset.dat file located in your creatures animation folder. The following is an excerpt from the animationset.dat file. All sequences for a creature should be listed in the animationset.dat:

 !
 ! 
 Version=1
 [SEQUENCES]
   walk
   run
   walkrun


Turn Animations

HE-anim panel tutorial turn.png
With turn animations, your character is typically rotating around the origin however many degrees. On the SRB Inherit Panel, check the Rotate Z axis box. This will restrict the SRB to always face straight ahead from the Character while staying beneath where the Bip01 started out, origin.

We generally do 7 turns for a character set: Left 45, 90, 135, and 180, and Right 45, 90, and 135. It is up to you to decide if this is appropriate for your game.

turn_left_90 would look like this:

!
! Animation Sequence Spec
!
Version=1
[ABILITIES]
  Apply Animation
    .Animation=turn_left_90.hgm
    .InitialSpeed=1
    .InitialLoop=false
    .InitialAlign=true


 !
 ! 
 Version=1
 [SEQUENCES]
   walk
   run
   walkrun
   turn_left_180
   turn_left_135
   turn_left_45
   turn_left_90
   turn_right_135
   turn_right_45
   turn_right_90


Jump/fall Animations

Anim jump.jpg
Jump and fall animations are pretty simple the way that we have implemented them. Basically you have a slightly oscillating pose of a character in mid jump, animated at origin with no translation. This animation is anywhere between 10-22 frames on average. Then HeroEngine blends to this animation during a jump. The SRB in this case stays completely still, just like an idle.

Your .asq will look like this, minus the name of the animation, which will probably be different.

HE-anim panel tutorial fall Loop.png
!
! Animation Sequence Spec
!
Version=1
[ABILITIES]
  Apply Animation
    .Animation=fall_loop_run.hgm
    .InitialSpeed=1
    .InitialLoop=false
    .InitialAlign=true


Impact Animations

HE-anim panel tutorial impact.png

Impact animations are treated like idles as well. The SRB should stay still and the character should come back to its initial pose. It is then added into the animation agent with the ability to fall through and play on a second animation channel, in this case, the impact channel.

The .asq is a simple apply animation ability as follows:

!
! Animation Sequence Spec
!
Version=1
[ABILITIES]
  Apply Animation
    .Animation=Impact.hgm
    .InitialSpeed=1
    .InitialLoop=false
    .InitialAlign=true


Attack Animations

HE-anim panel tutorial attack.png
HE-anim panel tutorial sideslashCombo.png

Attack animations are also treated like Idle animations. The SRB should stay completely still. Most of the time your character will come back to rest in the same pose.

An .asq for a basic attack is once again, just an apply animation ability.

!
! Animation Sequence Spec
!
Version=1
[ABILITIES]
  Apply Animation
    .Animation=Sunok_juggle.hgm
    .InitialSpeed=1
    .InitialLoop=false
    .InitialAlign=true

But, if you capitalize on what the animation sequencing can do, then your character can make decisions about what animations to play next. In this case the pose could be different where these decisions are made. For example, after the character slashes, we use the extreme pose of the followthrough to cut the animation. The next animation can be any animation that starts there and then returns to combat pose. You can daisy chain as many of these as you like.

There are 2 ways to approach the SRB in this case.

  1. Allow the SRB to move on the x and z move axis. This allows for accurate placement if the attack is interrupted.
  2. The method I tend to use is to just keep the SRB in the same location through all possible sequences. Since I know that the character will return to the same combat pose and location, I can have the SRB stay put by turning off all inherits at the beginning of the very first slash.

Your .asq file for this sort of attack would look like this:

!
! Animation Sequence Spec
!
Version=1
[ABILITIES]
  Apply Animation
    .Animation=combat_sideslash_open_end.hgm
    .InitialSpeed=1
    .InitialLoop=false
    .InitialAlign=false
  Next
  Multiplex
    .AddSequence=combat_sideslash_followup_backslash 10 align
    .AddSequence=combat_sideslash_followup_thrust 10 align
    .AddSequence=combat_sideslash_followup_spin 10 align


Asset Interaction

Anim asset1.jpg
There are various ways to have a character interact with an object. One method which works well in a majority of cases, is to have your object in the scene with your character when you are animating it, so that they work fluidly with one another. Then by hiding and unhiding, first export your character animation, then export the animated asset. Via script these can be lined up and played simultaneously, giving the player the illusion of character interaction.


The .asq for an animation like this, is once again just an apply animation ability:

!
! Animation Sequence Spec
!
Version=1
[ABILITIES]
  Apply Animation
    .Animation=cauldron_dump.hgm
    .InitialSpeed=1
    .InitialLoop=false
    .InitialAlign=true

Animation Notes

Animation notes can be used on a character animation to trigger in game events. An example would be the release point of a particle effect or projectile during a spell cast or attack animation. Both the FX system and any HSL script can read these notes. Thus, notes can be a very powerful way of creating engaging content.

Animation notes are added via the animation panel as an ability.

As an example, we can add a note to the character_sample character. By default, your character in clean engine is of the spec character_sample. Select your character with the select tool and open the animation panel. Under the Animation Set section, choose the animationSet.dat file for the character_sample character. This is located in Character/Character_sample/animation/AnimationSet.dat. This will give you a list of all the sequences on your character. When you select the sequence a dialog should be seen below that is an apply animation ability. Click add Ability at the bottom of it as seen in the example below on the left. Choose Notes. You can put any string you want in the Note field, it can even be animation commands or macros. Most of the time, it will just be a string that the design and animation team agree upon. In this case, "Release". Then use the slider to adjust where the note is during the animation playback. Press commit changes, and you are done. Now the fx system as well as script can see this note firing off and you can tie to anything ion your game. Also, multiple note can be added if need be.

Select the sequence Combat_spellcast_left_sidearm

Animation Agent

Now that your animations have been properly created and you have animation sequences(.asq) and your animationset.dat set up, you can wire them all together in the animation agent (.aas). For more detailed information, please see the Animation Agent Script.


See also

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox