Original: On motion capture for the common man--especially for walking.
Poster: Gen.jamesWolfe

Article the name kind of says it all really. but before I begin, I must give some background.

specifically, I am the mod leader (and main modder), of the Seven years war mod of Alexander: total war, which has been in the works (and betas released), since 2011. And for a while I have had a nagging problem with the animations. namely, the walking animations are most unsatisfactory: soldiers from the time did not march that way, or at that rate (120 steps a minute), but more like 60-75 steps a minute, depending on the army. however, it was not initially possible to make my dream come true here: walking animations made manually are a bit...unnatural, and its hard to import the biped animations (which are also hard to do manually), to cas skeletons.

now, the most obvious solution--motion capture software--was out of the question (and still is). I was told to use a hacked kinect, or some other softwares, but that was also out of the question. Which meant that until recently, I was in a bit of a bind.

that is, until I had an epiphany.

now, this probably isn't the first time anyone has done this, but I suspect from the assemblage of animations I've seen thus far that it is the first use of the method that tackles walking/running animations (as far as I know--if there have been successful attempts in the past, I do not know of them)--which from personal experience I can assure you is the hardest type of animation to make. in addition, I hope that by putting this here, I can finally provide a tutorial on this technique, the application of which can be used for the wider Total war community.

so let's cut to it: how to make animations of walking people (or any animations), using the poor man's motion capture. I'll give you an example, with steps to take.

skill level: high (you need to know how to animate for RTW properly. to do this this I recommend this thread). I am afraid I have to write this with the assumption that the person knows how to use a 3d modelling software, especially 3dsmax, which is the most common program for this IIRC. for this I must apologize.

anyways, what you will need:

1-a program to edit with the animations (3dsmax is ideal)
2-a video and means of capturing it/recording it/downloading it (please consult local laws about that last bit).
3-some sort of video editing program (must be able to take snapshots of the individual frames in a picture format. being able to slow or speed up the video goes without saying.)

step 1: find (or shoot) a video of the action required.

Spoiler Alert, click show to read: 
Now this is actually the easy bit, as technical expertise here is unnecessary, and most of what you look for can be found online (again, consult the law first). if you do shoot it yourself, just make sure the whole person is in view, and you point it in the right direction relative to the target, and not shake around. in my case, I simply need footage of a french soldier. in this case, you want the view to be in profile--from the side. going left or right matters little, so long as the person walking is from the side. and you only really need 1 full stepping motion (a pace however is ideal). I no longer have the video I used, but it was ideal, showing reenactors in profile while marching. measurements reveal one of the men was ~6 feet tall (about that of the RTW model, scaled down), and had the correct pace length (~60-65 cm)


step 2: edit the video.

Spoiler Alert, click show to read: 
for this, you can download the windows movie maker, which is for free. it's not very sophisticaed, but that's alright. it has two things we need:the ability to take snapshots in a picture format, and the ability to slow down the footage (in multiples of 2. so by 2, 4, 8, 16,etc). slow it down as much as you feel comfortable (personally, I find x0.125 speed (so by 8 times) to be good), and can make out individual frames. the steps are relatively simple--if a bit time consuming, going from here:

1-first, slow down the video to an appropriate level.

2-find a point to start in (you can choose this as you see fit). take a snapshot of this. remember that you have to track only a single person, to keep the scale consistent.

3-then take snapshots at regular intervals. be precise--otherwise things will look screwy when rendered in animation in RTW. export the snapshots preferably as a png or other lossless formats, but jpg is acceptable. finally, make sure it covers the whole loop/cycle.


step 3: splice the snapshots together.

Spoiler Alert, click show to read: 
1-any picture editing software will do. I used GIMP.

2-create a new file, where you'll be putting the loop in.

3-take each snapshot, and cut out the relevant person/persons.

4-paste them into the new file. keep them in line, with a single reference (the ground in this case). this will save you much time and heartache. keep the proportions intact: GIMP has atool that will let you resize, while keeping proportions, should that be necessary.

do this right, and you'll get something like this:



5-(this is really important) write down the dimensions of the resulting picture (if necessary including the height of the character)! if the picture is say, 300 x 500 pixels, write that measurements down! you'll see why later.



step 4: calibrate the frame-rate.
Spoiler Alert, click show to read: 

what this means is that you must synchronize the frame rate of what you captured (in my case, 8 frames/second), to correspond to what it would be in RTW (which is 20 frames/second).

1-set the very first frame in the loop as being frame zero. the second frame is now frame 1, then 2, 3, 4, and so on, unto 10,000 frames (+rep for whoever gets the referece)

2- find the ratio between the frame rate you made, and the RTW frame rate. in my case, the ratio is 2.5:1 between the two framerates, so in this case, multiply the former's frame number by 2.5, and then add 1, to get the position in 3dsmax. doing this right, you'll get the following for 1 step:

0,1,2,3,4,5,6,7,8 ==> 1, 3.5, 6, 8.5, 11, 13.5, 16, 18.5, 21

3-don't worry about the ones with a half in them. we'll deal with it later.


step 5: 3dsmax (or whatever works for you):

Spoiler Alert, click show to read: 
1-this is straightforward: import a model of a soldier standing still (so also import the animation relevant). this is to account for different ways of carrying weapons, and will save you time. in my case, I used a french fusilier, arms shouldered.

2-create a plane (textured side facing the soldier), whose height is that of the soldier: note the height! now, this is where the proportions of the picture come in handy: you know the height of the soldier (hopefully), so with the proportions you wrote down, you can get the length.

3-import the snapshot file, and use it as the skin of the plane. if you do everything right, it should look a lot like this (well, this is after I got the animations done, but you get the idea):



4-as you can see, you need to then find a reference to calculate the displacement (i.e., step) length. that's what the boxes below the man are for.

you're now ready to make the animation!



step 6: animation making proper.

Spoiler Alert, click show to read: 

1-start with the frames that correspond to the beginning, middle, and end, of the loop (so the beginning and end of every step). these will always be whole numbers--unless you made a mistake. first, match the pose of your model with the corresponding snapshot from the sequence. be as precise as possible. then place them in the correct position (the boxes come in handy here: you don't want either foot going into either box wilst they are still on the ground. the boxes represent toe to heel distance).

2-do the same for the whole number frames that aren't at the beginning and end of the step. note that I only have one step represented. that is fine, as one can just reverse which joints to bend, and still keep it corresponding to the picture.

3-now for the ones with half in them, you have two solutions:
a. some of you may want to change the frame rate in the time configuration button from the default 30, to 60, and work steps 1 and 2 with that, and then add the "trouble" frames in (which would now be whole numbers), after which you reset the frame rate to the default (30 fps). this would split the ones that would normally be with a half, into two separate frames (in theory at least--worked for me elsewhere).
b. the other solution--the one I went with--is to omit them unless it is necessary (to make the walk more natural), at which point I would round the frames up or down to the nearest integer (alternate them), and hope for the best. As it happened, I didn't need them, so I'm not too worried.

4-export the animation, and get it into the game.


note you can do this for when you want animations transitioning from a stop to walk, or from walk to stop as well. you don't even necessarily need a second loop for that: the one for the marching loop will be more than adequate: just make the necessary changes.

and of course, this method is great for all manner of animations: fighting, turning, standing, etc. this however, is really at its best helping one create walking animations.

One final note: while I have implemented the animations, I have not taken any screenshots or video of them in action, at this time. my apologies. one day I do hope to do so however.

EDIT: a video of it applied to RTW. I just realized there is a glitch in the transition between the stand to march, and march animations, but this can be fixed.

http://www.youtube.com/watch?v=Rpa5r4bs6RE