1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

How to: make minor changes to existing animation without 3Ds max

Discussion in 'Civ4 - Modding Tutorials & Reference' started by The_Coyote, Apr 13, 2008.

  1. The_Coyote

    The_Coyote Emperor

    Joined:
    Mar 1, 2008
    Messages:
    1,367
    Location:
    Europe
    So, my first small tutorial, how to make minor tweaks by an existing animation (without using 3Dmax), all programs needed are for free, so every one can made this.

    Two programs are needed to start:

    esemjays KFMconverter (http://forums.civfanatics.com/showthread.php?t=263215)

    Nifskope (not the Nifviewer)

    i´ve used this method so far three times (to made the mosquito animation from the avenger animation, to change the dive deep of the subs and to made the HMS Sussex animation from the destroyer animation)

    The last example will be used to explain what i did. When you only change the turret nodes in the nif, and then add the turret meshes at the nodes, the model looks good in Nifskope but in game there are flying turrets (the turrets are still on the postion where the were before)

    The problem is in the animation files, the position of the nodes is reseted there.

    But first, what is animated, if you import your nif in Nifskope you see a node called NiControllerManager, all child nodes are used in the animation files, so only object linked to such a node can be animated.



    As second step open the standard destroyer idle animation (destroyer_md_idle.kf), you see when you aktivate the 0 node and open under block details the controlled nodes all nodes which are controlled in this animation (under Value you see the name), when you extend one controlled node the number of the node in the kf files can also be seen (which has been proved very helpful to me)

    Now take a closer look at the aft turret (Dummy_Destroyer_AftGun01), you will see, that there are exact the coordinates where the standard destroyer aft turret is. This is also the reason for the flying turrets, the animation set the node to this coordinates. When the numbers are changed to the new numbers of the new model, the turret is on the right position in game



    side node: even is it not used here, the child node is normally the more interesting node, because there are the animation information (see the rotating information by mosquito_idle)



    Now you have only to look at all .kf files where this node is used and the position set and set it in all animation to the new position.

    Because it was not our target the change the standard destroyer animation use now the KFMconverter to make a new kfm file from the old for your model and link to the changed and hopeful renamed animation files

    i haven´t a complete understanding of what is possible, but what i know so far, if there is a second animated node in your model with the same modifiers in the kf files you can duplicate another node (done with the rear turret of the avenger animation to get a second working propeller). You can make minor changes to the animation itself, for example i changed the dive deep of the subs.

    What i didn´t figured out so far, how to change the animation modifier and how to add additional modifiers to an existing node (could be interesting with „unused“ nodes, to get new working nodes), how to get new nodes to be possible animated, how to add nodes to the kf files. Also i only made trial and error to figure out what is the important information to change (so far: translation modifier change the postion of the object, rotation modifier rotates the object, scale reduces the size (used in standard animation for the fade in and out animations)

    it also could be possible that this method is also used to make minor changes to leaderhead aniamtions

    So if someone has additional information feel free to provide a link and or post it in this thread

    Ciao
    The_Coyote
     

    Attached Files:

  2. Refar

    Refar Deity

    Joined:
    Apr 10, 2005
    Messages:
    4,608
    Thats great, thanks.
    I am hoping to use this to fix the overstretched neck on some LH animations.

    Good to know it kan be done from NifScope. I expected come kind HEX-Editor mess :lol:
     
  3. The_Coyote

    The_Coyote Emperor

    Joined:
    Mar 1, 2008
    Messages:
    1,367
    Location:
    Europe
    :) thanks for the hint with the Hex-Editor

    i made a small trial to see if there is an option to change more in an animation (had a node with no information in the NiTransformData subnode). Looked at a node with informations (get start and end offsets in Nifskope) and copied the stuff to the offset of the node without information. And voilá at least in nifskope there are now (same) transform modifiers to work with (and if i have time i must test if it still works in game ... :rolleyes:)

    Could be an option to get more "custom" animtion without 3dsmax ...
     
  4. Refar

    Refar Deity

    Joined:
    Apr 10, 2005
    Messages:
    4,608
    I think there might be something phony about the converted KFM... (See SC thread).

    Perhaps it is better to skip the conversion step (you can just copy the KF and KFM files into a new folder and keep using the old names, no real need for the conversion.)
     
  5. The_Coyote

    The_Coyote Emperor

    Joined:
    Mar 1, 2008
    Messages:
    1,367
    Location:
    Europe
    i have the feeling its because modular loading, it seems (but tbh i have no clue about the modular loading) that it needs all files needed by the animations, also the files needed for the effect, etc...

    small news, it is possible to change the attached sounds and effects this way (example is an already changed gunship ranged_strike.kf)



    first, go to the node named like in picture one, there are the information stored. In the second picture you see to which time which effect shall happen.



    First it´s says, that it is an effect, second which node is affected and last which effect (changed from gunfire to the rocket from the JetFighter (interception animation), copy pasted the name)

    In the next row you see which sound is played (after: Sound:), and because missiles with gunfire sounds is a little bit strange, i changed to the sound effect form the jetFighter animation
     

    Attached Files:

  6. Saschkin

    Saschkin Warlord

    Joined:
    Apr 2, 2008
    Messages:
    109
    Location:
    Saschkingrad
  7. Bangra 7

    Bangra 7 The Port Of Call

    Joined:
    Aug 28, 2008
    Messages:
    213
    Gender:
    Male
    Location:
    Raleigh, North Carolina
    Gracias Mi Amigo! Thanks for the tutorial!
     
  8. The_Coyote

    The_Coyote Emperor

    Joined:
    Mar 1, 2008
    Messages:
    1,367
    Location:
    Europe
    as long as it helps others the time wasn´t waste :)

    had a bit time to read and try and was able to get my first blender created run animation (easy mech run) in the game (used blender 2.46 and the latest Nifscrips).

    Short how to do:
    create the animation of the object and export them as oblivion animation (select animation only, tutorials http://niftools.sourceforge.net/wiki/Blender/Oblivion_Character_Animation and the gus runs tutorial: http://wiki.blender.org/index.php/Manual/PartI/Your_First_Animation_in_30_plus_30_Minutes_Part_II)

    The exported kf file didn´t worked for me but copying the created NiTransformData objects to corresponding entries in a self made master kf solved the problem. There will be a warnig because of the different nif version, but in my case it did not harmed the result. I created the master using the methods described above from a similar existing one and changing the names of the bones and set the positions etc. After changing the entries to match the civ kf files and creating (again changing a existing one) kfm resultet in a working animation. So far only idle and run.

    No more test so far from my side, so no idea if there will be problems, but at least it could be a change to make custom animation with blender and the great niftools :)
     
  9. achilleszero

    achilleszero Emperor

    Joined:
    Jun 19, 2006
    Messages:
    1,426
    Location:
    Biloxi, MS USA
    @The_Coyote: I have used your tutorial, and have been succesful at making changes to animations. However on a unit I am currently making, I am trying to animate a cape I have attached to it. I pulled the cape from the warlord, and the gave my unit the warlord's 3 cape bones. I changed the control nodes info to include the 3 new bones and the cape. The cape animates properly when I attach the custom kf's in nifscope. But when I put it into the game the cape still floats in the nuetral position.

    Any ideas on why it would animate properly in nifsope but not in the game???
     
  10. The_Coyote

    The_Coyote Emperor

    Joined:
    Mar 1, 2008
    Messages:
    1,367
    Location:
    Europe
    yes, something i didn´t know as i wrote this small tutorial is the importance of flags and the NiMultiTargetTransformController.

    You must add your added nodes as extra targets to the NiMultiTargetTransformController (without they wont be animated ingame), also the flags are important (in tree 6, tree end 22 - but because you copied the cape bones they should have the correct flag). More i can´t guess without seeing the unit
     
  11. achilleszero

    achilleszero Emperor

    Joined:
    Jun 19, 2006
    Messages:
    1,426
    Location:
    Biloxi, MS USA
    It works! Youre a genius. I would have never have thought to add them to the NiMultiTargetTransformController. Now all I have to do is to synchronize all my start and stop times since I mixed warlord and sumerian vulture cape bone animation info.

    One thing I still dont get is the flags. I did have to change two of the cape bones to #6 (it seems when I copied them it made them all #22). I have referenced several other nifs that have combined meshes of other units and it seems there is no rhyme or reason to them. I made my cape mesh flag #30 and the node it is attached to #2 because that is how it is in the warlord nif and the spearman nif I am working with. But in other custom nifs I see the meshes and their nodes have the 6&22 flag count. What gives? And what are the flags for exactly?
     
  12. The_Coyote

    The_Coyote Emperor

    Joined:
    Mar 1, 2008
    Messages:
    1,367
    Location:
    Europe
    the exact importance and meaning of the flags is imo still unknown, i only know what you also observed, 2 for general nodes (up to the mesh), 6 for armature nodes, 22 for armature end nodes, 30 for the mesh and 16 or 22 for effect nodes.

    While some flags seems to have minor importance (eg the mesh), i know that wrong flags on the armature nodes can cause problems. (had this before and not all part where animated in game)

    i think with you setting (30 for the cape mesh and 2 for the node before) you have chosen the 'better' values

    edit: perhaps the flags handle how the game engine attaches the information from the kf to the nif :confused:
     
  13. achilleszero

    achilleszero Emperor

    Joined:
    Jun 19, 2006
    Messages:
    1,426
    Location:
    Biloxi, MS USA
    Ok, thanks for the help. Keep the great tutorials!!
     
  14. cool3a2

    cool3a2 Deity

    Joined:
    Mar 30, 2007
    Messages:
    2,177
    I have to say thank you for this tutorial, The_Coyote. I had a leaderhead thats eyes turned out of their sockets. That really made me have headache for quite a long time. The Capo told me to nifswap it with another LH (I already nifswapped it with the leaderhead mine was based on, but that LH seems to be messed up) which then allowed me to get the eyes working in nifskope via editing the eyeballs bones, but not in-game. After some hours I found this tutorial, which allowed me to take the final step. It's exactly what you said: the changes to the eyeballs bones I made in nifskope to get it working there, have been overwritten by the kfs. After I edited them the changes to those bones take effect in in-game mode as well. So far I edited only the half of the kfs, just to get it working in the civilopedia for now. But I am quite optimistic that this will finally solve the problem. Also, this may help to fix the problem of having models that behave different in nifskope and in-game (it seems to me that this is quite a usual problem; don't know what you think, but it seems to me that this is because nifskope bases its animation calculations on the nif, whereas civ4 bases it on the kfs). BTW: I didn't use the converter. I simply saved the kfs in the new LHs own directory. I think, especially in case of units, this is a good idea anyways - unless this leads to different problems I am not aware of yet. But I don't think so as I just changed some values, there is nothing renamed.

    So thank you for helping me exorcising me this devil, The_Coyote! :goodjob:
     
  15. achilleszero

    achilleszero Emperor

    Joined:
    Jun 19, 2006
    Messages:
    1,426
    Location:
    Biloxi, MS USA
    Coyote. I have another question for you. Do you know how the NBSplineTransformInterpolater works? I cant seem to make any sense of how the short control points work. I am trying to make a custom opening screen and the only animation problem I am having is trying to control the arm of my model to make it stop and freeze at a certain point. It would be easy enough if it used the TransformInterpolater, I could just erase any rotation and movement keys after the ones that I want. But I absolutely dont understand how the splines work. Do you have any understanding of how they work or is there any known method of changing NBSplineTransformInterpolater to NiTransformInterpolater so I can easily change the XYZ rotations?
     
  16. The_Coyote

    The_Coyote Emperor

    Joined:
    Mar 1, 2008
    Messages:
    1,367
    Location:
    Europe
    i think it´s planned to add a function for this in nifscope, but atm you must import the animation in Blender and export it again - after the export all NBSplineTransformInterpolater are transformed to NiTransformInterpolater in the kf.

    You could also change the animaton already there, but unfortunally i saw cases were the import wasn´t 100% correct.

    and tbh, even if i have a small idea how it could work (i really should something aboutSpline Controller sometimes :crazyeye: ), but absolut no idea how to change it
     
  17. achilleszero

    achilleszero Emperor

    Joined:
    Jun 19, 2006
    Messages:
    1,426
    Location:
    Biloxi, MS USA
    Thanks Coyote, will try that now. I almost had a stroke trying to makes heads or tails of the short control point numbers. They dont seem to follow any logic and since several nodes use the sameSpline basis data but I cant tell what goes where.
     
  18. achilleszero

    achilleszero Emperor

    Joined:
    Jun 19, 2006
    Messages:
    1,426
    Location:
    Biloxi, MS USA
    Ok, hopefully this will be the last questions I will have to ask you about the current projsect I am working on.

    Can I attatch an effect, such as machingun fire of a fighter, using a transform controller or someother similar node. You may remember my thread about the fighter patrol animation. Well I took your advice and just made a 2 tranform interpolater, one for rotation and one for up and down motion that is out of sync with the first. Combined they give a convincing flying around effect. But now I need to randomly make the fighter swoop down for a strafing run with machingun fire. How can I attatch this to the fighter? The whole scene uses either embedded animations or attatched transorm controllers.

    Second question doesnt really have anything to do with the first. But I figure if it has to do wiht animation you would know. So I have imported a colonization man o war into civ 4 for someone. It was crashing the game, so I the imported and exported the model only, and it seems to not crash now. But the cannons do not function right. They do not retract in idle animation and they do not move back and forth in strikeA. But they do what theyre supposed to in strikeA when I attatch the Kf in Nifskope.:confused: The only difference I see between its kf's and the Sotl's Kf's is it is missing a controll node for the parent of the meshes. But I dont see how that matters since Ive animated things before without having a controll node for a meshes parent node. If you have time could you look at it and see if you can tell what's wrong?

    It is just a reskin with an extra flag. Nothing else has been altered except what I mentioned before.
     
  19. The_Coyote

    The_Coyote Emperor

    Joined:
    Mar 1, 2008
    Messages:
    1,367
    Location:
    Europe
    was a bit busy with uni, therefore couldn´t look before:

    to 1. no proven idea, but an idea, because effects are activated by the text keys in the kfm i fear there aren´t useable for this, but with a visibility controller and an attachement it could work (so the weapon fire is invisible when patrolling and is visible while strafing). Also really randomly seems imposible to me (it would be like calling a certain animation by random, which could be possible with python, but embedded animation = :confused:), what seems possible to make a long animation and to certain frames let start the strafing (and if you have 4 or 5 irregular timed strafing runs it should almost look random)

    to 2. made a quick check, did you used this kfm? it´s a renamed paratrooper.kfm (all links refer to paratrooper.kfs, there aren´t any, no animation), beside this, didn´t saw anything that serious so far (will edit this post if had the time for a second closer look)
     
  20. achilleszero

    achilleszero Emperor

    Joined:
    Jun 19, 2006
    Messages:
    1,426
    Location:
    Biloxi, MS USA
    :lol: I honestly have no idea how that happened, unless I was messing around with kf converter before I sent it. But when I was originall checking it, it was definitely a man o war kfm.

    Here is the right animations (i hope):
    View attachment HMS_Victory.zip

    EFIT: The thing I dont understand is how all its other animations do work, but the cannons are motionless. The cannon FX shows up properly, the ship rocks back and forth, and the sails & masts get messed up when damaged.
     

Share This Page