Animated Models


Multi Frame Models
Creating multiframed models is the same as creating a single framed model, with the exception that you will have multiple models in your working directory. One model for each animation frame of the model. When you use lw2md2 all of the models in the working directory are compiled into one .md2 resulting in a model with animation.

Another restriction is that the .bmp texture you use when compiling your model must be multiple of 32, with a maximum of 256x256(32x32, 32x128, 256x256, 256x32, 64x128, etc...), and the final texture you use(.tga,.png, etc...) must be a multiple of the .bmp in height and width. For example if your .bmp is 32x32 your final texture could be 2048x2048(32 times 64), if you want a hires final texture. If your .bmp is 32x128 your final texture could be 2048x8192(32 times 64 & 128 times 64). If you do not do this your model will not have any AnimIDs in Anachronox and you will not be able to animate it.

Understanding Animation Sets
A finished model will have many many frames usually around a thousand. These frames are catagorized in animation sets. A set can be called anything you want with aa maximum of sixteen characters, but there are some set names that are required and are called by Anachronox. For example you can create your own set and call it anything you want(i.e.: myset_a) and use planet to initiate that animation set sequence within a planet movie, or with APE. But some sets are required like amb_a. Amb_a is the ambient motion for your model if it is just standing still. The amb_a for characters are usually them just standing still and breathing, and is called automatically by Anachronox.

Below is a table that shows some of the different framesets for models, the name of the set, the typical number of frames and a short description. You should use particleman and look at different models that come with Anachronox to get a feel for various frameset names and how they are used.
frame set name number of frames description
amb_a 30 ambient animation
climb_a 12 ladder climb
gest_a 15 a gesture
die_a 33 die
hit_a 16 hit
walk_a 15 walk
atak1_a 15 attack animation 1
atak2_a 12 attack animation 2
talk_a 28 talk
atakamb_a 24 default attack animation
jump_s 10 jump
lookl_a 5 look left
lookr_a   look right
turn_r   turn right
turn_l   turn left
run_a   run
win_a   battle win
     

To create a .md2 with animation all you have to do is create the actual animation in your modeling package then export and convert each frame of that animation you want into a .lwo file iin your working directory. For example: I have created an elf in my modeling package, and set up an ambient animation of him breathing. My working directory is c:\lw2md2\elf, I have my .uv file, .bmp texture, and standard elf .lwo model located there. My total ambient animation is 60 frames in my modeling package, but to save on Anachronox resources I only need to export every other frame, resulting in a total of 30 frames.
All I have to do is save every other frame of the animation into my working directory as amb_a_###.lwo. The ### should be the frame number of the animation. So in my working directory I should have 33 files; elf.lwo, elftex.bmp, elf.uv, amb_a_001.lwo, amb_a_003.lwo, amb_a_005.lwo, amb_a_007.lwo, etc...

Now when I run lw2md2 it will parse each frame of the model and create a single elf.md2 with a animation set called amb_a. I can then load the model into Partcleman and goto the frames tab. It will show 30 Raw Frames, and 1 Parsed Animations called amb_a. If I select the Parsed Animation amb_a in Particleman I will see the model perform that animation. Way cool huh?
Don't forget that your .md2 and it's .tga must be copied into the anachronox\data\models directory for your texture to show up!

To create a model with multiple animation sets all you have to do is save each and every frame of every set into your working directory. So if I want to create a elf model with an amb_a set, a walk_a set, and a gest_a set I save every other frame of each animation into my working directory. So the files in my working directory should be" elf.lwo, elf.uv, elftex.bmp, amb_a_001.lwo, amb_a_003.lwo, amb_a_005.lwo, ...., walk_a_001.lwo, walk_a_003.lwo, walk_a_005.lwo, ...., gest_a_001.lwo, gest_a_003.lwo, gest_a_005.lwo, ...., etc...

As you can see creating a full fledged model with animations, shaders, tagged surfaces, and morphs can take a very long time.

If you need help don't be afriad to email me at creaper1@hotmail.com or the link above.

List of all AnimIDs to be incorperated

#define ANIM_ID_INVALID 0
#define ANIM_ID_AMB 1 // sub = 'A' 'B'
#define ANIM_ID_WALK 2 // sub = don't care
#define ANIM_ID_RUN 3 // sub = don't care
#define ANIM_ID_TALK 4 // sub = 'A' 'B'
#define ANIM_ID_GEST 5 // sub = 'A'..'J' only.
#define ANIM_ID_TURN 6 // sub = 'L' or 'R'
#define ANIM_ID_JUMP 7 // sub = 'A' 'B'
#define ANIM_ID_A2W 8 // sub = 'A' 'B'
#define ANIM_ID_W2A 9 // sub = 'L' or 'R'
#define ANIM_ID_ATAK1 10 // sub = 'A' 'B'
#define ANIM_ID_ATAK2 11 // sub = 'A' 'B'
#define ANIM_ID_ATAK3 12 // sub = 'A' 'B'
#define ANIM_ID_ATAK4 13 // sub = 'A' 'B'
#define ANIM_ID_ATAK5 14 // sub = 'A' 'B'
#define ANIM_ID_ATAK6 15 // sub = 'A' 'B'
#define ANIM_ID_ATAK7 16 // sub = 'A' 'B'
#define ANIM_ID_ATAK8 17 // sub = 'A' 'B'
#define ANIM_ID_ATAK9 18 // sub = 'A' 'B'
#define ANIM_ID_ATAK10 19 // sub = 'A' 'B'
#define ANIM_ID_ATAKR1 20 // sub = 'A' 'B'
#define ANIM_ID_ATAKR2 21 // sub = 'A' 'B'
#define ANIM_ID_ATAKR3 22 // sub = 'A' 'B'
#define ANIM_ID_ATAKR4 23 // sub = 'A' 'B'
#define ANIM_ID_ATAKR5 24 // sub = 'A' 'B'
#define ANIM_ID_DIE 25 // sub = 'A' 'B'
#define ANIM_ID_HIT 26 // sub = 'A' 'B'
#define ANIM_ID_STUN 27 // sub = 'A' 'B'
#define ANIM_ID_ATAKAMB 28 // sub = 'A' 'B'
#define ANIM_ID_WIN 29 // sub = 'A' 'B'
#define ANIM_ID_ATAKGEST 30 // sub = 'A' 'B'
#define ANIM_ID_USE1 31 // sub = 'A' 'B'
#define ANIM_ID_USE2 32 // sub = 'A' 'B'
#define ANIM_ID_TOSS1 33 // sub = 'A' 'B'
#define ANIM_ID_TOSS2 34 // sub = 'A' 'B'
#define ANIM_ID_THROW1 35 // sub = 'A' 'B'
#define ANIM_ID_THROW2 36 // sub = 'A' 'B'
#define ANIM_ID_CAST1 37 // sub = 'A' 'B'
#define ANIM_ID_CAST2 38 // sub = 'A' 'B'
#define ANIM_ID_A2ATAK1 39 // sub = 'A' 'B'
#define ANIM_ID_A2ATAK2 40 // sub = 'A' 'B'
#define ANIM_ID_STAND 41 // sub = 'A' 'B'
#define ANIM_ID_GRAB 42 // sub = 'L' 'M' 'H'
#define ANIM_ID_CINE 43 // sub = an char
#define ANIM_ID_ATAK11 44 // sub = 'A' 'B'
#define ANIM_ID_ATAK12 45 // sub = 'A' 'B'
#define ANIM_ID_HEAL 46 // sub = 'A' 'B'
#define ANIM_ID_PICK 47 // sub = 'A' 'B'
#define ANIM_ID_LOOKR 48 // sub = 'A' 'B'
#define ANIM_ID_LOOKL 49 // sub = 'A' 'B'
#define ANIM_ID_CLIMB 50 // ???
#define ANIM_ID_CINE2 51 // sub = 'A' - 'Z'
#define ANIM_ID_SIT 52
#define ANIM_ID_ATAK_M 53
#define ANIM_ID_SKILL 54
#define ANIM_ID_WSKILL 55
#define ANIM_ID_DART 56
#define ANIM_ID_WAIT 57 // battle anims
#define ANIM_ID_W2ATAK 58
#define ANIM_ID_A2WAIT 59
#define ANIM_ID_BSKILL1 60 // battle skills
#define ANIM_ID_BSKILL2 61
#define ANIM_ID_BSKILL3 62
#define ANIM_ID_BSKILL4 63
#define ANIM_ID_BSKILL5 64
#define ANIM_ID_BSKILL6 65