PDA

View Full Version : Animations .... what can we do with them?



Bwian
05-21-2007, 20:38
So far....animations are behaving like they should for me...

I have got hold of Calibans release of the raw data files, and unpacked them into my data/animations folder. Deleted ( well..moved them actually..I'm not THAT trusting! ) the PAK and IDX files..and sure enough, the game ran fine.

I'm running it from a mod folder with my Warhammer stuff in it..and I was interested to note that it built the new PAK and IDX files in the MOD folder, not the main one. That's OK....ultimately, thats what we would want to happen anyway. We can unpack the files into the real animation folder, and shove the real ones back in when we have built what we want. Good.

Then I tried playing about with the Scale factor .... but I can't get anything to take effect. Surely if it is REALLY building the pack files from the descr_skeleton files...then I should have seen SOMETHING change. Also...should I be changing the text file in the mod folder...or the one in the main folder. I tried both...but neither seemed to have an effect.

Has nayone actually had this work?

Eufarius
05-21-2007, 21:53
im pretty good with animations and no ive tried and nope:dizzy2:

KnightErrant
05-21-2007, 22:26
I know it reads descr_skeleton.txt to make the packs because that's
where I defined the new dwarf animation by copying the MTW2_2H_Axe
section and renaming it MTW2_Dwarf_2H_Axe. I think this was with
descr_skeleton.txt in the main \data folder but I'd have to check at home
to be sure. I haven't played with the SCALE though, so I don't know the
answer for that one.

Bwian
05-21-2007, 23:37
I've managed to get something working now .... but I haven't got the feet on the ground! I scaled up to 1.2, and the feet are buried. I think when I scaled up the mesh I have scaled it from the wrong point. More experimentation needed!

GrumpyOldMan
05-22-2007, 00:18
Hi Bwian


I've managed to get something working now .... but I haven't got the feet on the ground! I scaled up to 1.2, and the feet are buried. I think when I scaled up the mesh I have scaled it from the wrong point. More experimentation needed!

Are you doing the steps I outlined in https://forums.totalwar.org/vb/showpost.php?p=1535807&postcount=102 . You have to make changes to the mesh, the modeldb file and the descr_skeleton file. If you're doing your mesh scaling in Milkshape, make sure to set the scale point as 'origin'.

Cheers

GrumpyOldMan

Bwian
05-22-2007, 13:04
Yes ..GOM, that is the way I did it. I checked first to make sure that the dat and idx files were being rebuilt. I was using a mod folder and shortcut...and it built the files in the mod folder, not hte main one. Which was fine...it looked for the anims there too.

The centre function was used with origin... I guessed that was most likely.

The thing was not correctly aligned with the ground though. The feet were underground....which indicated to me that the vertical position of hte root bone had not shifted as it should.

Bizarre ..really...and obviousely not correct. If your hobbit archers had the same issue, they would have been floating! I need to verify that I have swapped all the correct animations. I used the fs_fast_mace skeleton for the Chaos Warriors, and I am wondering if there are some of the 'fast' anims that I have not picked out correctly. I will try and follow the hobbit steps EXACTLY and verify that I get that to work, then go back and troubleshoot the Chaos Warriors to see what steps I could have messed up.

Bwian
05-22-2007, 20:00
Additional:

I have double checked the mesh for the scaled up unit, and the origin is DEFINITELY still positioned exactly over the root bone, and is identical in position to the unscaled unit. The mesh has been scaled up in MS3D, and is no longer in line with the skeleton ... which I have not moved or changed.

The animation is MS2_fast_knifeman .... and I have copied both the parent animation set.... now MS2_knifeman ... with a scale of 1.2, and the extra run anim and basepose anim for fast_knifeman...which I have also given a 1.2 scale instruction after 'type'.

Modeldb also has a '1.2 4' line after the name and before the mesh definitions. This should have given me a scale of 1.2.

All works fine...the animation seems correct ( no obvious distortion or bones popping around ) and all is perfect except for the fact that the model is sitting with it's feet at the original foot level. The thing has scaled from the origin...but the origin should have moved up in proportion to the scale factor.... which it hasn't.

GrumpyOldMan
05-23-2007, 03:38
Hi Bwian


Additional:

I have double checked the mesh for the scaled up unit, and the origin is DEFINITELY still positioned exactly over the root bone, and is identical in position to the unscaled unit. The mesh has been scaled up in MS3D, and is no longer in line with the skeleton ... which I have not moved or changed.

The animation is MS2_fast_knifeman .... and I have copied both the parent animation set.... now MS2_knifeman ... with a scale of 1.2, and the extra run anim and basepose anim for fast_knifeman...which I have also given a 1.2 scale instruction after 'type'.

Modeldb also has a '1.2 4' line after the name and before the mesh definitions. This should have given me a scale of 1.2.

All works fine...the animation seems correct ( no obvious distortion or bones popping around ) and all is perfect except for the fact that the model is sitting with it's feet at the original foot level. The thing has scaled from the origin...but the origin should have moved up in proportion to the scale factor.... which it hasn't.

I just tried it and it worked for me:-

https://i150.photobucket.com/albums/s104/grumpyoldman2007/th_giant_knights1.jpg (https://i150.photobucket.com/albums/s104/grumpyoldman2007/giant_knights1.jpg)

https://i150.photobucket.com/albums/s104/grumpyoldman2007/th_giant_knights2.jpg (https://i150.photobucket.com/albums/s104/grumpyoldman2007/giant_knights2.jpg)

https://i150.photobucket.com/albums/s104/grumpyoldman2007/th_giant_knights3.jpg (https://i150.photobucket.com/albums/s104/grumpyoldman2007/giant_knights3.jpg)

Did you give them a new weapon scaled up as well?

Edit, in the descr_skeleton.txt file I mean.

Cheers

GrumpyOldMan

Bwian
05-23-2007, 09:03
:embarassed: no

I noriced there is a base-pose animation included in the weapon, and I giuess this is what is messing me up. I will try it again with the weapon bit changed as well. Got distracted by some stiuff KE sent over and a bundle of Dwarves ... but I will add this to my list oif things to play about with when I get home tonight!

Bwian
05-23-2007, 19:58
Tried it again, and made sure I had the weapon in as well, with a scale of 1.2. The model has scaled perfectly, and the animation shows the skeleton has scaled too. Lovely

Now....I have managed to duplicate the error..and it was rather odd. I ran the game having forgotten to amend the skeletons used. I had switched from knfeman to a more appropriate Mace set, and inadvertantly forgot to update it to Macex ( my scaled one ). The model ran fine, but the feet were underground. I must have messed up the skeleton def somehow, and wasn't getting the correct version. I'm amazed it actually ran at all!

But this is great all round! Coupled with the tools KE sent me today to make abstract skeletons, I am now one happy bunny! I can scale, I can tweak, and I can do things I never could with RTW .... and I think it's absolutely fantastic!

GrumpyOldMan
05-24-2007, 06:03
Hi Bwian


Tried it again, and made sure I had the weapon in as well, with a scale of 1.2. The model has scaled perfectly, and the animation shows the skeleton has scaled too. Lovely

Now....I have managed to duplicate the error..and it was rather odd. I ran the game having forgotten to amend the skeletons used. I had switched from knfeman to a more appropriate Mace set, and inadvertantly forgot to update it to Macex ( my scaled one ). The model ran fine, but the feet were underground. I must have messed up the skeleton def somehow, and wasn't getting the correct version. I'm amazed it actually ran at all!

Because the models are fairly close in size the difference between normal anims and scaled anims isn't too obvious only the feet sinking into the ground is a dead giveaway. Figures will run happily with mismatched anims, just as long as they have a full set and matched up against their bone structure in their mesh.


But this is great all round! Coupled with the tools KE sent me today to make abstract skeletons, I am now one happy bunny! I can scale, I can tweak, and I can do things I never could with RTW .... and I think it's absolutely fantastic!

Here's a sample of what I'm working on as a test project, to see if we can get new mounts and skeletons with additional bones into the game:-

https://i150.photobucket.com/albums/s104/grumpyoldman2007/th_test_dragon.jpg (https://i150.photobucket.com/albums/s104/grumpyoldman2007/test_dragon.jpg)

People may not want to use it but at least it's fun for now :beam: . After I finish there should be a new dragon/raptor skeleton and anims available for people to use.

@@@@@KE - I've had a further message from Mete on Time and Timing, seems he answered my question in haste and now wishes to add further information. It seems that the time is indeed timing, but he answered on the basis of a 1 fps model where the timing would be 1 per frame. The FPS value for the ms3d model/anim should be 20.0 (I'm amending my converter to fix this - I had 10.0 in this slot) and the frames should increase by 0.05 per frame, starting at 0.05 for the first frame. This shows the anim in real time.

Cheers

GrumpyOldMan

Bwian
05-24-2007, 10:05
Looks promising.

I can think of a few uses for a skeleton like that ... especially for the Lizardmen.

How about an arachnid type of skeleton? Would that be possible? I am assuming there is no limit to the number of bones other than common sense and the burden of animating.

KnightErrant
05-24-2007, 14:37
@GOM
Awesome dragon. Ok, thanks for the update on timing. Must have
been something else that caused single stepping to hang on me.
Or maybe I didn't have 20.0 for FPS when I had 0.05 for time steps.

KnightErrant
05-24-2007, 15:33
@GOM
Time steps that aren't float integers is causing Milkshape
to hang while loading. Went back to framenumbers and
FPS=1.0 and its working again. Did you get yours working
with noninteger time steps?

GrumpyOldMan
05-25-2007, 03:37
Hi KE


@GOM
Time steps that aren't float integers is causing Milkshape
to hang while loading. Went back to framenumbers and
FPS=1.0 and its working again. Did you get yours working
with noninteger time steps?

I sent a sample ms3d and an animmerge2.py to you by email, it still seems to work. I set the FPS to 20 and the frametimes were (frame_num+1)*0.05 - to catch the zero value at the beginning.

If you need to watch the animation slower for debugging, leave the FPS in the Preferences window and use Menu/Tools/Scale Animation. I usually factor it up by 10 to slow it down and factor it down again to get real time action.

I'd just like to add my voice to what should be thunderous applause, while I've been kerfuffling along you've got on with the job and come up with some great tools. Great work :2thumbsup: :2thumbsup: :2thumbsup: . Just going to try them on other stuff and see if I can break 'em :beam: :beam: .

Cheers

GrumpyOldMan

Bwian
05-25-2007, 12:53
KE ... please slap me if I am asking a stooopid question ... but can I edit the actual raw CAS animation files in MS3D, or should I be looking at the 'official' CAS tool released by CA earlier on ? I am more at home using that to mess with RTW anims ...and would like to use it for this..but I don't know if I am going to introduce nasty issues if I do. Everything else is going swimmingly.

Your tool handles non-standard animations fine, and converts them over to the new skeleton with very little fuss. If I wanted to make a custom animation for a custom skeleton...how would that work? Not in Max I suspect ...so I wanted to know of there is an MS3D or Max tool or part of the current toolsets that would help.

I wanted to try adding a 'tail' to a human skeleton...and animate that. Just don't know where to start!

KnightErrant
05-25-2007, 17:32
Hi all,

GOM helped me find my error so now I can set FPS and have it work
right in Milkshape.

@Bwian
From GrumpyOldMan's post in the animations thread he could add bones
and animate them by string name so it should work. Not familiar with
CA's tool. I'm still a novice at animating in Milkshape but I think that
would work. Question is what happens if you pull in a 20 bone animation
with animmerge, THEN add a tail bone. Does it put in N frames of
null animation for that bone which you can then edit in the keyframer
or does it just keep that bone with zero animation frames. Don't know how
you tell Milkshape you want to create frames for a single bone.

What I'm getting at is animextract as it stands now would probably work
right if you could get the same number of frames for each bone because it
reads the joint data in the ms3d file but it ignores any bone with
'weapon' or 'shield' in its name (no anims for these). Only problem I
see, and its a small one, is that I hard-coded the hierarchy tree for
humans into the extractor. I just need to make this a filechooser
pop-up to let you pick a standard hierarchy tree or a new one with an extra
bone. I need to solve this problem to do mounts and other non-human
anims anyway.

By hierarchy tree I mean the entries near the top of the .cas file that
look like this (when pulled out to decimal):


21
0 0 1 2 3 1 5 6 7 7 6 10 11 12 6 14 15 16 1 18 19

This does the parent/child relationship for bones. Presumably a tail bone
would come from bone_pelvis so it would be a 1 appended onto the end
of this and that's the new hierarchy tree.

If you try adding the bone after merging with a walk animation or something,
e-mail me the .ms3d file. I'd love to look at the joints section to see what
it did.

KnightErrant
05-25-2007, 19:07
Revisiting: got a jog in and cleared the cobwebs. Not thinking
big picture enough. You don't want animextract, you need a bigger
and better exportskeleton function. Let's say the .skeleton file
now includes the pose vectors AND bone names. So with a tail
it is now 21 lines long with the last entry having the bone_tail
pose info.

You also need an ASCII hierarchy file to read like the above post with
correct parent/child. Now when it reads all the .cas files in a directory
that you've moused to, it puts in the updated hierarchy tree, time ticks
stay the same (haven't changed the animation), it writes the bone section
but adds the new bone name at the end and duplicates the quat frame
number integer, duplicates the anim frame number integer, calculates a
new quat offset byte count, a new anim offset byte count, does a int 0,
an int 1, and a final byte 0 to complete the bone section.

It then replicates all 20 quat blocks for the regular bones, adds a new
block of Nframes of 0.0 0.0 0.0 1.0 which are base pose quats for the
tail. Then replicates all 20 anim blocks for the regular bones, adds a new
block of Nframes of 0.0 0.0 0.0 deltas for the tail bone, then does
the new skeleton pose data with the new bone, then adds the usual
footer. Scaling of the anims could also be done here just like the
regular exportskeleton function.

Now all the anims in that directory should be ok, its just that the tail
isn't animated beyond its base pose.

The problem as you've noted are the stock animations like knifeman
and crew. We ignored this for the Dwarves but if they ever start swimming
they'll pop back to full size. For units with a new bone, they might crash
the game. Probably one would have to copy the stock anims into the
new directory and rewrite descr_skeleton.txt so that the new anim section
there points to the copies of crew and knifeman in the new directory where
they will receive the extra bone and animation data when
"biggerandbetterexportskeleton" is run.

Without too much thought on the subject, it seems like the above could
be generalized to adding more than one bone at a time. Of course, someone
is going to have to animmerge these into Milkshape to make the tail
move and some anim families like MTW2_Mace has 185 anims, MTW2_Halberd
has 205, MTW2_2H_Axe has 215, etc. from my survey.

Does that sound like a reasonable automated animation modification?

GrumpyOldMan
05-25-2007, 22:23
Hi KE

Haven't got much time today but a few thoughts on adding bones. Bones can only be added at the end of hierarchy table in the mesh and anim because otherwise you have to do a lot of reassigning verts because of the change in bone indices.

With the new method you're proposing, you may have to go to a template system - eg extract and merge all Mace anims with tails and wings skeleton with number of frames by 0 position and rotation values for the new bones. Maybe a dropdown or list with available options. Possibly the templates could be extracted from a Milkshape master. Maybe you could use a generic figure for merging purposes.

@Bwian - Scaling doesn't add anything to what's stored on the HD but the anims are recalculated and stored in memory for each different scaling when the game runs

Cheers

GrumpyOldMan

KnightErrant
05-26-2007, 03:19
Yes, yes, what GrumpyOldMan said. Let's do this experiment
this coming week. Convert a likely unit, preferably one that
doesn't use an anim type that you had nonconverting files with.
(I've had problems with HR_lance and HR_sword due to short
footers.) Add a tail bone and associated mesh to make a new
.ms3d file. I'll extend exportskeleton to process a copied directory
to add in the new bone, quats, and anims. Then let's try using animmerge
to bring in the walk animation and make the tail wag in Milkshape.

Then put back in game and just make them walk around to see what happens.

medieval lord 10
06-19-2007, 19:48
hey please research duald wield animation too for me. :2thumbsup: :beam: :help: :sweatdrop:

Bwian
06-20-2007, 15:10
There is no need to research dual wield animations ... they can be made now. All that needs to be done is to re-write all the attack animations to move the left hand as if it was holding a weapon. It's a lot of work, but possible.

The game is not going to actually 'use' the second weapon, since the combat power and effectiveness is set by the stats. You would just increase the attack values in the unit to represent the extra weapon, and the animation would make it visually there. No special bones etc. are needed to do this.

Unfortunately .. there is no shortcut way to do this other than by re-writing hte animation movements.