Morrowind NPC/PC animation. Questions and Answers.

Post » Fri May 13, 2011 9:30 am

IMHO the heart of a video game is a PC/NPC animation system (animations themselves and gamer/game engine animation control: scripts). I have spent a lot of time collecting information about MW PC/NPC animation (tutorials, available documentation, etc.), performing numerous tests?
I would like to summarize/share here my "achievements" and hope to learn new approaches/solutions/techniques.

I would start fro the basics. Please, excuse me that I have to repeat a lot of well-known issues and correct in case of wrong assumptions. I will mainly concentrate on NPC animations and would mention specifically in case of PC related stuff.

Some history (to my knowledge):

1. RX31 was the fist who has created (in 3Ds Max) considerable number of custom MW animations based on available bvh mocaps.
2. Oshiel was the first (and the only one so far) who has created a PC Animation Replacer mod.
3. Mr.Cellopane has created the most sophisticated (released at the present moment) animation control via scripting.
4. LizTail has created "MW Animation Kit", a tool set dramatically simplifies MW animation packing and therefore creation.
5. I have found the way to add animated extra bones to MW NPC skeletons.

Tools and tutorials.

1. 3DS Max with original Bethesda exporter plugin (works with Max3,4,5) or with NifTools Max Plugin (import/export; works Max5,6,7,8,9,2008,2009) or Blender with NifTools Plugin (import/export; I am not a Blender user and, unfortunately, cannot provide useful advices for this free but complicated IMHO software). I assume that the links to these programs are well-known. Max2008/9 users are advised to check this Tazpn's WIP topic:
http://www.niftools.org/wiki/index.php/NIF_File_Format_Library_and_Tools

2. Animation Toolbox by RX31 (a very useful tool for Max users, Maxscripts):
http://rx31.rethan-manor.net/pages/animtool.htm

2. LizTail's Morrowind AnimKit 2.0: http://www.gamesas.com/bgsforums/index.php?showtopic=868016

3. Max blank animation files by Bethesda Softworks, can be downloaded for instance from here:
http://www.ageinc.com/Morrowind/Thanos_Tower/maxpage.html

4. MaxImmerse and NetImmerse viewers, nif documentation can be also found on Thanos Tower.

5. All collected by me animation tutorials created by many authors:
http://www.4shared.com/file/60996990/46f26751/MW_MAX_Anim.html

6. NifSope (the last but not the least).

MW animation related files.


MW has the following original animation files:

anim_dancingGirl.nif (a very interesting example of "custom" NPC animations)
xanim_dancingGirl.nif
xanim_dancingGirl.kf

Argonian_SwimKnA.nif (Argonian's specific swim NPC animation)
xArgonian_SwimKnA.nif
xArgonian_SwimKnA.kf

base_anim.nif (main animations for human NPCs and 3-d person view human PC animations)
xbase_anim.nif
xbase_anim.kf

base_anim.1st.nif (1-st person view human PC animations)
xbase_anim.1st.nif
xbase_anim.1st.kf

base_anim_female.nif (female specific NPC/3-d person view PC animations)
xbase_anim_female.nif
xbase_anim_female.kf

base_anim_female.1st.nif (female specific 1-st person view PC animations)
xbase_anim_female.1st.nif
xbase_anim_female.1st.kf

base_animKnA.nif (beast races NPC/3-d person view PC animations)
xbase_animKnA.nif
xbase_animKnA.kf

base_animKnA.1st.nif (beast races 1-st person view PC animations)
xbase_animKnA.1st.nif
xbase_animKnA.1st.kf

As you can see from above MW obligatory requires three files for every animation storage:

1. Main animation nif (e.g. base_anim.nif). This file is not used by the game engine and probably required only for display purposes in the TESCK. However, it should be obligatory present, its content could be any valid MW animation nif. This file contains animation data plus skeleton plus meshes (body parts). I guess it is something similar to NDL/Gamebryo .kfm animation file format that is not used in MW.

2. x.nif (e.g. xbase_anim.nif). This file contains information about skeleton structure and some additional animation nodes like Bounding Box (a sort of a reference for the skeleton root bone (Bip01) and collision mesh); Tri QuadPatch01 node (mysterious skinned/physiqued structure that I guess plays a certain role in hit combat detection); mesh boxes that are attached to bone chains or bones (I guess those are collision propagation nodes without their branches the corresponding body part will be corrupted in the game); PC skeleton has some other obligatory nodes that are not well documented e.g. camera. Skeleton structure in a x.nif should be identical to the skeleton used for all skinned/physiqued body/clothes/armor meshes/nifs that are used for this character. For instance Better Bodies are using a very good approximation of original skeleton (at that time there were no tools or blank animation templates available), as result the hands are not perfectly aligned to finger bones and in game the BB hands look odd (BTW LizTail has fixed that problem).

3. kf file (e.g. xbase_anim.kf). This file contains only animation data. Basically this is the only file we need to create for standard skeletons because the other two could be just renamed accordingly any working MW animation nifs. It is mportant that skeleton structure in x.nif and .kf should be identical (skeleton structure used for kf generation and in x.nif should be identical).


Animation files location. All three files should be in the same folder in MW "Data Files/Meshes" directory e.g. "Data Files/Meshes/MyAnim" or just in "Data Files/Meshes".

MW game engine loads/"searches" for animation files in the following order: 1. Attached to an NPC (for PC 3-d person view there is an NPC with ID "player", Dark Elf) in the TESCK animation nif (search how to do that in TESCK tutorials, note that only one file (e.g. MyAnim.nif) can be attached, therefore it should contain all sequences); 2. In "Data Files/Meshes" in the files with original names specified above; 3. In MW bsa archive files.

Animation file naming is important
: for global replaces it is necessary to use original file names mentioned above; for custom animation all three files should be named in the following way: MyAnim.nif, xMyAnim.nif, xMyAnim.kf.

MW game engine "recognizes" what particular animation sequence should be displayed at a certain game moment by "looking" into the note tracks text keys. Text keys are hardcoded (there is no chance to add new ones) and can be seen in the TESCK as well as in NifScope (block details window of the NiTextKeyExtraData node). A list of text keys and some very useful information can be found here:
http://preik.net/morrowind/animationgroups.html

MW PC/NPC animation control via scripting. There is only one properly working for NPCs MW animation scripting function- AIWonder and it is limited for Idle3-9 sequences; to my knowledge there is no direct PC animation controlling function.

Bone names are also hardcoded. Here's the full list of allowable Morrowind bone names created by LizTail:

Shield Bone
Bip01 L UpperArm
Bip01 L Clavicle
Weapon Bone
Bip01 R Finger42
Bip01 R Finger41
Bip01 R Finger4
Bip01 R Finger32
Bip01 R Finger31
Bip01 R Finger3
Bip01 R Finger22
Bip01 R Finger21
Bip01 R Finger2
Bip01 R Finger12
Bip01 R Finger11
Bip01 R Finger1
Bip01 R Finger02
Bip01 R Finger01
Bip01 R Finger0
Bip01 R Hand
Bip01 R Forearm
Bip01 R UpperArm
Bip01 R Clavicle
Bip01 Head
Bip01 Neck
Bip01 Spine2
Bip01 Spine1
Bip01 Tail3
Bip01 Tail2
Bip01 Tail1
Bip01 Tail
Bip01 L Toe0
Bip01 L Foot
Bip01 L Calf
Bip01 L Thigh
Bip01 R Toe0
Bip01 R Foot
Bip01 R Calf
Bip01 R Thigh
Bip01 Spine
Bip01 Pelvis
Bip01

No other names can be used. Human NPC skeleton contains not all of the above mentioned bones Hence, these names can be used for extra bones (e.g. wings).


MW animations should be sampled with 15 fps.


I think this could be enough for introduction. Please, do not hesitate to ask questions and share your MW animation experience.


:)
User avatar
Bird
 
Posts: 3492
Joined: Fri Nov 30, 2007 12:45 am

Post » Fri May 13, 2011 7:01 pm

Thank you for this. I think if this by some factor of awesomeness causes some intrepid aspiring modder possessing exobitant amounts of free time decides to take up improving Morrowind's animations...

...you will be hailed a saint. :)
User avatar
Phoenix Draven
 
Posts: 3443
Joined: Thu Jun 29, 2006 3:50 am

Post » Fri May 13, 2011 8:36 am

Thank you so much for this! :bigsmile: I did try to get a Blender discussion going but nobody was interested. :embarrass:

One question: I know Blender can't be used to change the actual skeleton structure, but what apps *can* be used for that? Is it only max 4/5?
User avatar
Rozlyn Robinson
 
Posts: 3528
Joined: Wed Jun 21, 2006 1:25 am

Post » Fri May 13, 2011 5:17 pm

In all Max versions it is possible to "change" skeleton structure. The latest Niftools Max plugin also works with CS biped and CS biped extra bones (Max2008/2009). In older Max versions it is necessary either to used Max bones or combine them with CS biped. I would start with original Max blank animation skeletons. Note that it is necessary to add collision propagation boxes/branches for the new bones or bone chains (some results of my tests are described on the NifTools Forum).

But I can't believe that it is not possible to do that in Blender, we have find out how to do that correctly.

:)
User avatar
Rebekah Rebekah Nicole
 
Posts: 3477
Joined: Fri Oct 13, 2006 8:47 pm

Post » Fri May 13, 2011 9:08 am

But I can't believe that it is not possible to do that in Blender, we have find out how to do that correctly.

Heh, last time you said something like that I though "wishful thinking"... I've learned my lesson, now I'm thinking "Cool! What hasn't been tried yet?" :hehe:
User avatar
Juan Suarez
 
Posts: 3395
Joined: Sun Nov 25, 2007 4:09 am

Post » Fri May 13, 2011 6:33 am

Yes indeed, BIG THX for your effort!!! :tops: I know very well from my german forum, how hard it is to convince those people who know to share their knowledge. Most of them behave like gods and tell you not to bother them with any questions. Gladly a small hand of people, like you, don't do so!!!


TheDaywalker :rock:
User avatar
rebecca moody
 
Posts: 3430
Joined: Mon Mar 05, 2007 3:01 pm

Post » Fri May 13, 2011 6:56 am

MW PC/NPC animation control via scripting. There is only one properly working for NPCs MW animation scripting function- AIWonder and it is limited for Idle3-9 sequences; to my knowledge there is no direct PC animation controlling function.

So you couldn't make them for example, walk around and then sit on a chair and have a drink, then get up, pay their bill, and walk around some more? (with custom animations)
User avatar
Jessica White
 
Posts: 3419
Joined: Sun Aug 20, 2006 5:03 am

Post » Fri May 13, 2011 4:00 pm

You could, except it would be more or less random -- pays the bill, walks around, stands up, pays the bill, walks around, sits down, for example. Essentially worthless.
User avatar
Courtney Foren
 
Posts: 3418
Joined: Sun Mar 11, 2007 6:49 am

Post » Fri May 13, 2011 2:30 pm

You could, except it would be more or less random -- pays the bill, walks around, stands up, pays the bill, walks around, sits down, for example. Essentially worthless.

Rats.
User avatar
Jordan Moreno
 
Posts: 3462
Joined: Thu May 10, 2007 4:47 pm

Post » Fri May 13, 2011 8:08 am

So for the NPC animation script, are the idle animations already hard-coded into the new animation files and the script just triggers them to occur, or is it that the script assigns and animation as "Idle #x" and the game enginge uses the probability of switching to an idle animation to actually start the animation you assigned?
User avatar
JaNnatul Naimah
 
Posts: 3455
Joined: Fri Jun 23, 2006 8:33 am

Post » Fri May 13, 2011 10:59 am

this is vaguely unrelated but what is the name of the animation part where people just stand there? I'm merging together different mw animations laying around with the animation toolkit, and right now I have the basic "standing about" animation as Oshiel (since it's the base i am using) but I just wanna swap the standing animation out for the base from morrowind but I can't find it. I thouht it was the un-numbered Idle.kf replacing it only made the difference that when they idle they would stand "normally".

Makes sense?
User avatar
Saul C
 
Posts: 3405
Joined: Wed Oct 17, 2007 12:41 pm

Post » Fri May 13, 2011 12:07 pm

You could, except it would be more or less random -- pays the bill, walks around, stands up, pays the bill, walks around, sits down, for example. Essentially worthless.

Actually you could script the order (by using AIWander with 100 chance for the idle you want and 0 for the others) - but the transitions would probably be awkward if they were all on different idles.
User avatar
T. tacks Rims
 
Posts: 3447
Joined: Wed Oct 10, 2007 10:35 am

Post » Fri May 13, 2011 8:55 am

Actually you could script the order (by using AIWander with 100 chance for the idle you want and 0 for the others) - but the transitions would probably be awkward if they were all on different idles.

Each idle would need to have the requiste animations: sitting down would need to have the NPC actually going through the process of sitting down; standing up the same, etc. If you planned it out like a sequence, starting with a low idle (like 3), then flow through the last idle, it should be pretty smooth. :)
User avatar
Chad Holloway
 
Posts: 3388
Joined: Wed Nov 21, 2007 5:21 am

Post » Fri May 13, 2011 7:07 am

Hi guys,

I have no animation-skills at all, but I'm still following the diskussion eagerly. I have an idea, but I don't know if it is absolutely nonsense:

When I got you all right, then there is only a certain number of idle slots and that can't be expanded so easily? Right? - Hope so?!

But when do we really need a NPC to be a NPC? Only when talking to him, attacking him or contacting him in another way. So why could one not simply replace the NPC with a static, that's a copie of him and let that static do, whatever we want. And in case that static gets contacted, it becomes disabled and the real NPC shows up again.

It's not the ideal solution, but one could come around the idle-problem. I hope animations for statics can be made in 3dsmax and blender too and don't have to be scripted in the CS.


PS: Forgive me for that, when it made no sense, I'm just trying to spread some ideas.



TheDaywalker :rock:
User avatar
Len swann
 
Posts: 3466
Joined: Mon Jun 18, 2007 5:02 pm

Post » Fri May 13, 2011 8:47 pm

When I got you all right, then there is only a certain number of idle slots and that can't be expanded so easily? Right? - Hope so?!

There are nine available idles and no more can be added. The idles are the animations NPCs "perform" while standing around (defaults are head scratching, stretching, etc).

But when do we really need a NPC to be a NPC? Only when talking to him, attacking him or contacting him in another way. So why could one not simply replace the NPC with a static, that's a copie of him and let that static do, whatever we want. And in case that static gets contacted, it becomes disabled and the real NPC shows up again.

As far as I know, statics can't move and activators (like the gate at GhostGate) are also limited in what they can do. Speaking of that gate, it doesn't move so much as is raised and lowered.

It's not the ideal solution, but one could come around the idle-problem. I hope animations for statics can be made in 3dsmax and blender too and don't have to be scripted in the CS.
PS: Forgive me for that, when it made no sense, I'm just trying to spread some ideas.

I'm not an animator either, so I could be off base here. I have talked about them with Axel quite a bit because of a project we worked on awhile back, but he knows more than me. :)
User avatar
bimsy
 
Posts: 3541
Joined: Wed Oct 11, 2006 3:04 pm

Post » Fri May 13, 2011 5:38 am

As far as I know, statics can't move and activators (like the gate at GhostGate) are also limited in what they can do. Speaking of that gate, it doesn't move so much as is raised and lowered.


You can move and rotate statics by script for example, that's what I know and I read that animation in morrowind doesn't mean anything else. Just rotation or movement of bodyparts/ meshes, no vertex-group deformation, just quite simple.


TheDaywalker :rock:
User avatar
Monika Krzyzak
 
Posts: 3471
Joined: Fri Oct 13, 2006 11:29 pm

Post » Fri May 13, 2011 9:04 am

Melian. I share your frustration. I have installed Blender, bought a book about animation in Blender? and no progress. The bad thing is that nobody at NifTools Forum are interested in MW any longer.

You could, except it would be more or less random -- pays the bill, walks around, stands up, pays the bill, walks around, sits down, for example. Essentially worthless.


This is not entirely true. I am not an expert-scripter, but with sequential calls (AIWander/GetAIPackageDone checks and timer) I was able to create something similar: enter room and go to the specified place; sit down; perform certain animation; stand up; go to the specified place; switch to idle.

Atrus. Check AIWander format here: http://www.uesp.net/wiki/Tes3Mod:AIWander

"Idle" (AIWander, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0) is actually very tricky ? this is the main transition pose/animation used by the game engine. It is better to create all your custom animations from frame 0 of "Idle" in order to achieve smooth transitions.

TheDaywalker. I think your idea worth testing. You can set a suitable (one animation sequence attached) creature nif in the TESCK as an activator and see what happens. Transitions might be a problem (black screen; magic effects, etc. are not always good).

Jac. There are 2/3-9 Idles available, hence 7-8 animation sequences.

I read that animation in morrowind doesn't mean anything else. Just rotation or movement of bodyparts/ meshes, no vertex-group deformation, just quite simple.


Well, it depends how to define the term "animation". For instance what is MW animated texture than? There is no rotation/translation/scaling. BTW, MW animated heads is a good example of morph animations ("vertex-group deformation") in MW.
However, every with "simple" things we have a lot of problems: MW uses quaternions for smoothing rotations, but even Sir Hamilton himself was not able to finalize his theory.

:)
User avatar
CHangohh BOyy
 
Posts: 3462
Joined: Mon Aug 20, 2007 12:12 pm

Post » Fri May 13, 2011 8:10 pm

Ah, thanks. This is quite interesting stuff. Good gosh, had I the free time... :(
User avatar
REVLUTIN
 
Posts: 3498
Joined: Tue Dec 26, 2006 8:44 pm

Post » Fri May 13, 2011 7:38 pm

In all Max versions it is possible to "change" skeleton structure. The latest Niftools Max plugin also works with CS biped and CS biped extra bones (Max2008/2009).

Do you mean that it is possible to create and export animation for MW PC&NPC using Max2008/2009? For a long time, the only solution was to use max 4.2 + studio character...

Many thanks for all these great informations on animation you share!
User avatar
Chloe Botham
 
Posts: 3537
Joined: Wed Aug 30, 2006 12:11 am

Post » Fri May 13, 2011 1:12 pm

About the Radiant AI thing (npc's sitting down/drinking etc.) I should point out http://www.gamesas.com/bgsforums/index.php?showtopic=882251&hl=load, if animators and scripters grouped together, than they could possibly make some soft of radiant AI mod? It's worth a shot.
User avatar
Tyler F
 
Posts: 3420
Joined: Mon Aug 27, 2007 8:07 pm

Post » Fri May 13, 2011 2:57 pm

Do you mean that it is possible to create and export animation for MW PC&NPC using Max2008/2009? For a long time, the only solution was to use max 4.2 + studio character...

Yes!
Actually it's been possible to use 3DSMax 5.2 with the FreedomForce exporter and the NifTools exporters for 3DSMax, Maya and blender for quite some time.
User avatar
bimsy
 
Posts: 3541
Joined: Wed Oct 11, 2006 3:04 pm

Post » Fri May 13, 2011 1:56 pm

Max5.1 (I have never seen Max version 5.2!?) with original MW exporter works very well. Maya nif plugin does not support animation (import/export). Note that the latest NifTools Max plugin supports CS Biped export (with skin modifier) with extra biped bones ("Extra Nodes on Mesh" option should be checked).

:)
User avatar
Bad News Rogers
 
Posts: 3356
Joined: Fri Sep 08, 2006 8:37 am

Post » Fri May 13, 2011 7:33 am

Max5.1 (I have never seen Max version 5.2!?)

Sorry, Typo from me. I meant 5.1.
User avatar
Ross Thomas
 
Posts: 3371
Joined: Sat Jul 21, 2007 12:06 am

Post » Fri May 13, 2011 6:11 pm

I would like to add some important information to my old notes.

1. When exporting MW animations that are using original so called Max blank animation templates files with some recent versions of NifTools Max plugins (e.g. MaxTools v. 3.5.5.4728) it is necessary to check "Extra Nodes on Mesh" exporter option. Others can be the same:
http://i109.photobucket.com/albums/n45/AxelIP/MWMaxImportExport.jpg

2. In some original animation sequences (usually when PC/NPC has something in hands e.g. "WeaponTwoWide. Thrust Large Follow") "Weapon bone" is animated with translation and rotation keys. Yes, with translations! For instance spear "slides" in hands forward.

3. If you are intending to use LizTail's Animation Kit for merging .kf files check that all Max bones controllers should be set to linear. This is especially true for rotations (Max default is Euler XYZ, it is supported by the plugin and MW but NOT by the Kit).

4. Renamed with valid MW bone names CS biped twist bones are supported by NifTools exporter and MW.

5. Original and NifTools plugin samples controller driven animations and usually works with fine with different Max controllers. However, some fancy things like forces (e.g. Gravity) are not supported by NifTools plugin. There could be also problems with some Max constrains.

6. Animation main nif file could be an empty MW nif file (In this case you will not see animations in the TESCS preview window. However, if to use x.nif renamed as main nif it is possibly to see animations in the TESCS preview as usual); x.nif should contain a valid skeleton that is used in accompanying x.kf files but it's content can be the same for many animation "triplets" (main nif, x.kf. x.nif) that are based on the same skeleton.


I wish I knew that before, this would save me a lot of time.

:)
User avatar
mollypop
 
Posts: 3420
Joined: Fri Jan 05, 2007 1:47 am

Post » Fri May 13, 2011 9:54 am

Statics can indeed be be animated. From what I can recall any nif no matter what object type can animate if the nif has an animation node and controller and/or morph. (body parts are more tricky + limited)

The main difference between statics and activators is not in the rendering of the nif but how it interfaces. Statics do not have scripts attached to them, but an external script can control via object name, so it has to have unique ID. Also statics can't be "activated" by clicking on them in game.

A good example is the sotha dicer from Tribunal. It is a simple loop animation in the single nif file ( no xnif or kf file ) If used as an activator or a static ( or book, hair, light, etc.) it slices and dices all the same. But for it to hurt colliding actors it is used as an activator for the script attached. Particle controllers usually loop animate like this as well pretty much the same way.

this type of loop animation cannot be stopped or controlled like kf animation with playgroup scripting, but if used with a "clamp" flag instead of loop and with proper timing and text keys can animate weapons and body parts in sync with the base animation timing, with extra bones, segmented or physiqued. (See my nunchucks and whip meshes). and of course morph animations work great for this kind of thing, heads and bows use morph, and phijama released a shield with blocking animation.

I ran into trouble with the game engine combining walk/run/swim/jump/etc. with chop/swing/thrust in using this method. When standing still my animation worked, but when moving it was overrided by the other animation. :shrug: I had a few ideas to try to fix it but have no time and that was a couple years ago. It's a big complicated ordeal in nifskope to even attempt I do not recommend it :D

thats all the input i can give for now, thanks for the info thread!
User avatar
D IV
 
Posts: 3406
Joined: Fri Nov 24, 2006 1:32 am

Next

Return to III - Morrowind