BODY ANIMATIONS WITH THE ANIMESH PLUGIN

First, this is not a step-by-step tutorial; I just wish to share a few tips, gathered while beta testing Wes_h's Animesh animation plugin. I'm quite new to this myself, so please feel free to point out any inaccuracy or share you own tips!


While a good knowledge of objects and behaviour editing is necessary in order to build elaborate new interactions, the following should help you to get simple but fun animations in game without great pains – just let your imagination loose. :)

Tutorials and must read

  • the Milkshape help: for your first steps with animations in Milkshape, there's an easy to follow tutorial in the help files, which you can download from the Chumbalum site and just put in your Milkshape program folder. While the chosen example is simple, the explanations are quite complete. You don't need to bother with the part about setting up the skeleton and assigning the vertices since you're going to use Unimesh extracted meshes, so you can just jump to the "create a walk animation" part.
     
  • the Animesh plug-in program notes, for details about the use of the plug-in: there's no reason to rewrite here what Wes explains clearly and extensively.

While this is not immediately necessary, my advice is still to try JohnBrehaut1's very well done sim animations tutorial that explains how to make your own test object (and skip the parts related to Miche's animation converter), and from there Echo's perfect BHAVs tutorials here and here; you may find that new interactions aren't as daunting as you thought, and this will be an inspiration for more elaborate stuff.

For objects animations, please refer to Echo's tutorial here.

Quick start

Dr Pixel released a set of ready to use meshes for both genders and needed ages including the face and scalp, which are very convenient for a good preview. Now, any Unimesh extracted model will do but you don't have to take this pain, unless you want to make an animation specific to a custom body shape or a rigged mesh like the one for my "bounce" animation.

For those of you who want to play with animations but don't feel comfortable with BHAVs I'm uploading here a test object package, which allows to test up to 6 animations (the 3 last ones are set to run in a loop).

To import your animation in the object package, just right click/replace any of the animation files; either copy the name beforehand and paste it back after reloading, or fix TGI and copy the new name (minus the _anim part) in the corresponding line of the animations text list (instance number 0x00000081 for adults, 0x00000082 for children).

Dos and Don'ts

  • The auskel bone shouldn't be moved or rotated. Doing it doesn't seem to break anything but the results can get a little weird. I noticed for example that it messes with the routing, the lighting, and also with the regular animations once yours is finished if the auskel ends up with a different position than the default one (like the top and the bottom of the body facing opposite directions...).
  • Make sure that you don't have more than one joint selected when you move or rotate something. As far as I could see, this isn't an issue with paired joints like the upperarms and shortsleeves, but that's most likely because the latter don't seem to be used in game.
    The root_rot and the root_trans must be selected in the joints list only, else you won't be able to select them separately; and when switching between both, make sure they are effectively selected before applying the transformation! You definitely don't want to apply a rotation to the root_trans or a translation to the root-rot.
  • If you're working with your own model, make sure to add "NoAnim:" (without the quotation marks) in a new line in the hair joints comments; this way they will use the game's animations and the hair will look more natural. You can also add the "NoAnim:" comment to bones that's aren't generally used in animations, like the longleeves and such, this will help keep the files smaller.
  • Use the "operate on selected joint only" option! This will let Milkshape smoothly interpolate the intermediary frames, and you'll have a lot less editing to do when you change something. This option also helps keeping the anim files small.
  • Work with the "local mode" checked when applying transformations; this way, they are applied in relation to the default pose and you will avoid moving things on wrong axis, and also prevent deformations of the skeleton.

Using the Milkshape animation tools (tools menu) and the SMD adjust keys

Well right, we're working with Unimesh meshes – and if you attempt to use some of the animation tools ("SMD adjust keys" in the animation menu, "scale animation" and "reverse animation" in the tools menu) you'll just mess up your skeleton. But there is a workaround, and I have to thank Wes for pointing me in that direction: you can export your animation to SMD as a sequence, import that one in a empty file, perform any surgery you wish (cut, paste, scale, reverse and so on) and export the file again; then, back in your original ms3d file, import the SMD sequence (skeleton only) and choose "no" when asked "do you want to append the frames at the end of the current animation?". This way, the SMD animation will replace your original one.

Now, doing this all the joints will be set in a keyframe for every frame – and you'll find this makes for huge animation files if they have more than 20 or 30 frames. So, you should do a little cleaning: select the bones you didn't move and "remove all keyframes" for these (with "operate on selected joints only" checked), and delete the keyframes for the other bones everywhere Milkshape can properly interpolate the frames (intermediary frames while raising an arm for example). This can be rather tedious, but sometimes the ability to use the animation editing tools is entirely worth it.

Of course, this is also useful if you want to combine animations or import keyframes from another file; in this case let the SMD importer add the frames at the end of your animation.

For example, I set the arms and hands in a relaxed position on the first frame, then moved them, and now I need to have the hands stretched flat: editing the rotations would be a pain, so I just import the default position from another file with just one frame exported to SMD, appending it at the end of my anim; then I copy the keyframe where I need it with only the hands joints selected, then delete the imported keyframe and set back the original frame number.

Getting smooth and lifelike motions

This is certainly not the easiest part. If you watch closely, you'll notice that the slightest move involves the full body, in order to keep the general balance. Walking involves not only the legs, but also the pelvis, and the upper body moves the opposite way; when raising an arm, the clavicles go with the movement – and so on.
 
While it's sometimes subtle and would be poorly rendered in game, you need to pay attention to this for the more ample movements or the animation will have a robotic feel; spending time in front of the mirror, looking closely at existing animations and watching videos would help with this.
 
Now this is certainly not something I've mastered yet! It's just a principle that should be kept in mind, and that will give the best results after a little training.

Also, exaggerated motions will look better in game, but it's hard to get right since the normal ones look perfect in Milkshape...

Common issues

  • I shortened my animation but it's still the same in game
     
    Before you set a smaller number of frames, make sure to delete the keyframes (with "operate on selected joints only" unchecked) on those you want to remove. Else they won't be properly deleted, and setting back the original frame number you'll see that they are still there.
     
  • Aaargh, the toes are turning into giant paddles!!
     
    This is one of the quirks of working with "global mode" checked instead of "local mode".
     
  • The feet won't stay in place during the animation!
     
    This happens everytime the root_trans is significantly moved in a non linear way. This joint commands the offset of the whole body on every axis (translations only); if you check my dance animation, you'll see that the body moves up and down and to the sides: all this is done with translations of the root_trans, while the lower body is adjusted so the feet stay in the same absolute position.
     
    Now, for no obvious reason, the non-linear movements of the root_trans aren't always accurately rendered in game, no matter if it's set in a keyframe for every frame; this results in approximate placing of the body, and it's very noticeable on the feet – for example, the sim pedalling upstairs instead of properly climbing step by step.
     
    Weirdly, the SMD export/import will fix this; same advice as above, clean the unneeded keyframes before the Animesh export, but in this instance leave the root_trans alone – and generally the whole bottom.
     
    Now the issue isn't consistent, and you might find out that when working from a file that went through the SMD export once it won't happen again later, no matter what changes are made.
     
  • These bones don't move in game like they do in Milkshape...
     
    The root_rot has annoying quirks: as soon as it reaches a 90 degrees angle in any direction on the Y axis the body spins wildly. What would be perfectly expectable is a reversal of the rotation once it reaches 180 degrees (as explained in Echo's object animations tutorial), but there is some weirdness going on here. With a little patience and logic skills you can fix the rotations manually in SimPE, but in this case it's better to work with precise rotation values and this for the Y axis only, so what you'll find in raw view will make more sense – you can trust me on this!
    Summary: With a rotation on the Y axis only, from 0 to under 90 degrees, the numbers are ok; then, the precise 90, 180, 270 and 360 degrees angles will display 0 instead of 5760, 11520, 17280 and 23040 (angle in degrees x 64). All the intermediary frames above 90 degrees need the X and Z values reset to 0, and the Y value removed from 11520 to get the right number (11520-3000=8520, 11520-(-3000)=14520).
     
    The thighs, when rotated backwards, end up with reversed rotation values; in game you'll see them spin around the X axis. Here the fix in SimPE is easy: you'll notice in raw view that when the X value should go above 11520 (180 x 64), it switches instead to a negative value; just remove that one from 23040 to obtain the correct value.  
    If you notice something else with any other bone, please report on the Animesh plugin thread.
     
  • My loop doesn't run smoothly
     
    In game, a looped animation that looks perfectly fine in Milkshape jumps at the junction – Echo gives an explanation about this in her objects animations tutorial.
     
    In short, the frames around the junction get "squeezed". The workaround I used for my dance anim is stretch the animation for the 5 or 6 first and last frames, by adding a few intermediary frames; now that was entirely trial and error.

# # #