Morrowind NPCPC animation. Questions and Answers.

Post » Tue Oct 06, 2015 4:22 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?br />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
Jake Easom
 
Posts: 3424
Joined: Sun Jul 29, 2007 4:33 am

Post » Mon Oct 05, 2015 1:54 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
Tyrone Haywood
 
Posts: 3472
Joined: Sun Apr 29, 2007 7:10 am

Post » Mon Oct 05, 2015 11:43 pm

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
Alyna
 
Posts: 3412
Joined: Wed Aug 30, 2006 4:54 am

Post » Mon Oct 05, 2015 5:36 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
kasia
 
Posts: 3427
Joined: Sun Jun 18, 2006 10:46 pm

Post » Tue Oct 06, 2015 3:07 am

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
Carlos Rojas
 
Posts: 3391
Joined: Thu Aug 16, 2007 11:19 am

Post » Mon Oct 05, 2015 3:30 pm

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
Penny Wills
 
Posts: 3474
Joined: Wed Sep 27, 2006 6:16 pm

Post » Mon Oct 05, 2015 10:10 pm

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
Britta Gronkowski
 
Posts: 3475
Joined: Mon Apr 09, 2007 3:14 pm

Post » Tue Oct 06, 2015 1:13 am

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
Agnieszka Bak
 
Posts: 3540
Joined: Fri Jun 16, 2006 4:15 pm

Post » Mon Oct 05, 2015 3:17 pm

Rats.
User avatar
Janine Rose
 
Posts: 3428
Joined: Wed Feb 14, 2007 6:59 pm

Post » Tue Oct 06, 2015 1:28 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
Trent Theriot
 
Posts: 3395
Joined: Sat Oct 13, 2007 3:37 am

Post » Tue Oct 06, 2015 12:26 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
Eve(G)
 
Posts: 3546
Joined: Tue Oct 23, 2007 11:45 am

Post » Mon Oct 05, 2015 6:57 pm

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
Dylan Markese
 
Posts: 3513
Joined: Sat Dec 01, 2007 11:58 am

Post » Mon Oct 05, 2015 8:54 pm

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
Shianne Donato
 
Posts: 3422
Joined: Sat Aug 11, 2007 5:55 am

Post » Mon Oct 05, 2015 5:35 pm

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
Katharine Newton
 
Posts: 3318
Joined: Tue Jun 13, 2006 12:33 pm

Post » Mon Oct 05, 2015 5:50 pm

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).

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.

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
Devin Sluis
 
Posts: 3389
Joined: Wed Oct 24, 2007 4:22 am

Post » Mon Oct 05, 2015 8:48 pm


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
Jynx Anthropic
 
Posts: 3352
Joined: Fri Sep 08, 2006 9:36 pm

Post » Mon Oct 05, 2015 11:42 pm

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.


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.


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
El Khatiri
 
Posts: 3568
Joined: Sat Sep 01, 2007 2:43 am

Post » Tue Oct 06, 2015 12:07 am

Ah, thanks. This is quite interesting stuff. Good gosh, had I the free time... :(
User avatar
Tikarma Vodicka-McPherson
 
Posts: 3426
Joined: Fri Feb 02, 2007 9:15 am

Post » Mon Oct 05, 2015 3:44 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...

Many thanks for all these great informations on animation you share!
User avatar
Judy Lynch
 
Posts: 3504
Joined: Fri Oct 20, 2006 8:31 am

Post » Mon Oct 05, 2015 1:37 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
Marie
 
Posts: 3405
Joined: Thu Jun 29, 2006 12:05 am

Post » Mon Oct 05, 2015 12:51 pm

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
Queen
 
Posts: 3480
Joined: Fri Dec 29, 2006 1:00 pm

Post » Tue Oct 06, 2015 4:22 am

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
Lizbeth Ruiz
 
Posts: 3358
Joined: Fri Aug 24, 2007 1:35 pm

Post » Tue Oct 06, 2015 3:47 am

Sorry, Typo from me. I meant 5.1.
User avatar
Phillip Hamilton
 
Posts: 3457
Joined: Wed Oct 10, 2007 3:07 pm

Post » Tue Oct 06, 2015 3:56 am

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
butterfly
 
Posts: 3467
Joined: Wed Aug 16, 2006 8:20 pm

Post » Tue Oct 06, 2015 2:01 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
joseluis perez
 
Posts: 3507
Joined: Thu Nov 22, 2007 7:51 am

Next

Return to III - Morrowind