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

[TUT] Merging animations from example files with your model

Discussion in 'Civ4 - Modding Tutorials & Reference' started by sharick, Jul 29, 2006.

  1. sharick

    sharick Warlord

    Joined:
    Jan 18, 2006
    Messages:
    250
    Merging animations from example files with your modell


    I would like to explain the technique I used to animate my tanks. In short I used Tank_Complete.max example file, replaced Sherman tank with my own model, adjusted envelopes and exported it. At the end I had my tank with all the default tank’s animations and effects (except for damage states). It might be a little complicated at the beginning if you’ve never done it before, but after some practice you can do all the steps in no longer than half an hour.
    You must have: 3DStudio Max, Civ4 Plugins, Fireaxis example files and your own model.

    Let’s go!

    1. Open Tank_Complete.max

    2. Clean it up:
    - delete models: tank and Tread
    - delete dummies: Dummy_Tank_GunLeft (if you don’t have MG mounted on turret)
    - delete damage dummies (optional): I don’t do damage states so I delete these

    - delete all materials (except for Tank Dummy Wireframe): you don’t really have to, because they won’t be exported but you might get duplicate material warning when you import your model
    - it’s helpful at this point to hide in viewport everything except for Dummy_Tank_Body, Dummy_Tank_Turret, Dummy_Tank_Cannon
    - if you plan on doing more tanks, save now so you won’t have to repeat previous steps

    3. Merge your model. Important - it should already be finished. It must be one object, cannot be a group, modifier stack should be collapsed. See the manual “Getting your units in Civilization 4” for the optimal model set up.

    4. Adjust scale, rotation and position. Try to match your model with the dummies (Dummy_Tank_Body, Turret, Cannon) as close as possible. Work only with your model and always use uniform scale (the one that scales all 3 axes simultaneously). Don’t worry if it’s not perfect. The important thing is to have your and dummy turret centered. If the tank still don't fit in there you can adjust dummies.


    5. Select your model and apply Skin modifier.

    6. Add fallowing bones: Dummy_Tank_Body, Dummy_Tank_Turret, Dummy_Tank_Cannon. Now, as you move time slider you can see that your tank is moving around, though it’s still messy.



    7. Adjust envelopes (the most tricky part).
    The idea is to indicate which vertices of the mesh will be affected by the appropriate dummy (bone).
    For example the cannon:

    Chose Envelope sub-object in Skin modifier and pick Dummy_Tank_Cannon.

    Move the Cross Section points until all the vertices of the cannon are inside.

    Select vertices in viewport and use options Exclude or Include Verts to include only the cannon’s vertices into envelope. Make sure that Vertices option in Parameters:Select is on.

    I personally find it easier first to remove all the verts and then include desired ones.

    Finish the remaining bones the same way.
    At the end all the vertices must be controlled by some bone. For the mechanical objects like tanks one vert should not be controlled by two or more bones (red colored vert).

    Run the animation to see if you didn’t miss any vertices.

    8. Adjust effects. You need to unhide effect dummies if you’ve hidden them before. They are responsible for various effects like explosions or smoke. Very often I end up with EFFECT_WEAPON_PANZER_FIRE in the middle of the cannon. To fix this just move the dummies where they are suppose to be.


    9. Select 3 main dummies and hide them.

    10. Export your brand new animated unit with CivilizationIV Export plugin. Leave the settings as they are. It will create model .nif file and .kf, .kfm animation files. Once you pick a name for your .nif file don’t change it unless you want to have weird bugs in game. If you really need to, export it again with new filename.

    Voila! You’re done. It’s time to test your unit in game. :)


    If you like to experiment here are a few ideas:

    - it’s fairly easy to manipulate the special and sound effects. Why not make your unit disappear in a big nuclear explosion. All effects are controlled in Track View - Dope Sheet and by dummies, but that’s for another tutorial. Anyway it’s not very difficult and more or less explained in “Getting your units in Civilization 4” manual.
    - so far we have 2 more example files: Pretorian and Chokunu. Another way of making new units would be to use and modify these models, which is possible as long as you stay in envelope boundaries.
    I really wish they released more .max files especially for Infantry. Can anybody start a petition for that?


    P.S.
    If you noticed any mistakes or know more efficient ways to do something, please let me know. Thanks.
    This is my first tutorial so if something is not clear, ask me. I will try to anwser in 2nd post.

    Sharick
     
  2. sharick

    sharick Warlord

    Joined:
    Jan 18, 2006
    Messages:
    250
    Reserved for Q&A

    changelog
    - I changed point 9. Instead of reducing opacity, hide the dummies.
     
  3. Excellent work sharick! :goodjob:

    If I may just make a few suggestions/comments:

    I usually prefer not to delete anything unless I know 110% I won't need it so for the second step, I'd say hide it and then at the end delete if you really don't need it anymore. This is especially true for the damage state dummies as you might find yourself wanting to add those at the end. And that left gun dummy, it could be used for example to animated maybe a guy who's looking out of the tank. :D

    The dummies for the meshes (turret, cannon, etc.), the ones that are orange (not green) are actually just ordinary geometry (unlike the effect dummies which are actual dummy objects). That means you can adjust them as well, i.e. you can fit your tank to them, or you can fit them to your tank, or some combination of both. It is however trickier to adjust those dummies because of animations but still possible and sometimes useful.

    I still haven't figured out the damage states textures but the geometry is easy. You simply need to skin the tank to those damage state dummies and adjust the envelopes so that when these dummies get animated they "damage" the tank, i.e. bend or break parts of it.

    With this tutorial, hopefully more people will feel confident animating their vehicles. And of course this can be applied to any track or wheel based vehicles - this is how I animated my warhammer 40k tank units. :)
     
  4. sharick

    sharick Warlord

    Joined:
    Jan 18, 2006
    Messages:
    250
    All good ponits there. Thanks for feedback Rabbit, White.

    Me too, but in this case I'm sure I won't need it and I actually have a file without all those dummies so I can mass animate the tanks.

    When it comes to damage states I'm aware that they are no so hard to do but I have less time nowadays to finish the unit that I decided not to do them at all. If I did I would end up fixing and tweaking every little vert I wouldn't like.

    It's possible but as you said it's tricky because they are animated so I prefere not to touch them. So far I didn't animate the tank that wouldn't fit into those boxes.

    Nevertheless I encourage everybody to experimenton their own.
     
  5. woodelf

    woodelf Bard

    Joined:
    Jun 12, 2003
    Messages:
    15,036
    Location:
    Gallery
    Wow, thanks for this write-up. :thumbsup:
     
  6. asioasioasio

    asioasioasio Fallout Scrubber

    Joined:
    Mar 4, 2006
    Messages:
    3,058
    Location:
    Poland, EU
    Thx sharick :) very good and very needed tutorial. now i'll give life to my units
    it helped me a lot - I've made already animation for one of my existing tanks

    i have question:

    about adding other sounds and effects
    i wanted to add other sound i checked Dope Sheet and i replaced text in note in sound's helper (right clicking on it): and i've just replace text:
    SOUND:AS3D_UN_ARTILLERY_FIRE
    with
    SOUND:AS3D_UN_RIFLE_FIRE
    what should change (i suppose) sound in the game from artillery fire to shot of rifleman (what is necessary for truck wich will be using only body dummy from sherman animations). but it doesn't change.
    so probaly i missed something. i spent a lot of time and i can't find the rison
     
  7. woodelf

    woodelf Bard

    Joined:
    Jun 12, 2003
    Messages:
    15,036
    Location:
    Gallery
    Is there a way to merge Firaxis' cannon animations with your own?
     
  8. Not in max, 'cause there's no max file for that. However, you can try to do it in nif viewer, it might be simple with a cannon. My guess you want three main things - you want the cannonier in there lighting the fuse, you want the cannon to "shake" as it fires, and you want the effects, right?

    So for the first, you just need to make sure that when you insert your cannon into the civ cannon, it's fuse is roughly in the same location as the one for the vanilla cannon.

    For second and third it's a bit tricky. First thing you'll want to do is check if there is a specific bone (node) for the barrel (i.e. separate from the wheels/chassis), chances are there is. Then you'll want to export your cannon in such way as to have the barrel and the chassis separate. To do that you'll need to first make sure that they are separate objects in max, and then on the material uncheck the "No Sorter" button. (Before you actually export also make sure that the rest of the cannon parts are not separate, for example the wheels should be a part of the chassis object, otherwise when you export all these different parts will be separate and it will more difficult to merge it into the vanilla canon.)

    With this done, when you export the cannon it will have two meshes, barrel and chassis. So, then you just load up the vanilla cannon, add to it your cannon, and attach the barrel mesh of your cannon to the barrel node of the cannon - position and align correctly, add water and you're done. :)

    Well you'll still want to clean up the file obviously, and maybe there's a node for the chassis as well, so if you attach the chassis to it, the cannon might look less "rigid" as it moves.
     
  9. sharick

    sharick Warlord

    Joined:
    Jan 18, 2006
    Messages:
    250
    @asioasioasio - weird, I did a quick test doing the same what you and it worked. Try again or send me the file and I'll have a look.
     
  10. asioasioasio

    asioasioasio Fallout Scrubber

    Joined:
    Mar 4, 2006
    Messages:
    3,058
    Location:
    Poland, EU
    ok i'll check it once again. txw - when something will go wrong i'll send you a model :)

    i've made onother mistake. i found that in some models there's vissible dummies (especially in this gui where the tank is (near statistics)) - on main map is invisible but in the left down corner is vissible. as you said it's important to hide dummies (not only change opacity)
     
  11. woodelf

    woodelf Bard

    Joined:
    Jun 12, 2003
    Messages:
    15,036
    Location:
    Gallery
    Real noob question since they haven't released anything other than tank and chokuno, can you somehow use the tank for a cannon model using just the EFFECT_WEAPON_PANZER_FIRE somehow? I'm just starting to try animating so I may be really asking a boner of a question. :)
     
  12. asioasioasio

    asioasioasio Fallout Scrubber

    Joined:
    Mar 4, 2006
    Messages:
    3,058
    Location:
    Poland, EU
    yes it's very easy
    ypu can merge them only with eefect without dummies, or merging with effects and only tank body duumies - look for animation of Stug III - its just only animation of tank body - without rotating turret but with fire and sound comming from gun
     
  13. woodelf

    woodelf Bard

    Joined:
    Jun 12, 2003
    Messages:
    15,036
    Location:
    Gallery
    Thanks asio^3. I'll take a look at the Stug III.
     
  14. asioasioasio

    asioasioasio Fallout Scrubber

    Joined:
    Mar 4, 2006
    Messages:
    3,058
    Location:
    Poland, EU
    if you need help or more explanation just ask
     
  15. woodelf

    woodelf Bard

    Joined:
    Jun 12, 2003
    Messages:
    15,036
    Location:
    Gallery
    Read your PMs. :)
     
  16. Oh man, you have no idea. You just opened the Pandora's box! :D :lol:
     
  17. woodelf

    woodelf Bard

    Joined:
    Jun 12, 2003
    Messages:
    15,036
    Location:
    Gallery
    Do you mean with me specifically or in general? ;)
     
  18. asioasioasio

    asioasioasio Fallout Scrubber

    Joined:
    Mar 4, 2006
    Messages:
    3,058
    Location:
    Poland, EU
    lol :) I want to help woodelf in advancing in next 3dsmax level :)


    It's nothing hard - i animate model in about a half an hour. Whebn you make animation for the gun is even simpler

    1. when you clean example model as sharick said in point 1. 2 of tutorial. you can save it - it'll be useful in later adding animation to other units.

    2. Now You delete more two things
    Dummy_Tank_Turret, - animates turret
    Dummy_Tank_Cannon - animates cannon since it's connected with cannon it won't be necessary too
    i tried to save only cannon without turret but than animation is very crappy
    ATTACHABLE_DAMAGE_SMOKE - it's smoke from engine so it won't be needed
    They won't be necessary for cannon

    So you have only this files
    Dummy_Tank_Body,
    Effect_Heal_Sparkle
    Attachables
    Effect_TankSmallEcplode01
    Effect_TankSmallEcplode02
    Effect_TankSmallEcplode03
    Effect_TankSmallEcplode04
    Effect_TankSmallEcplode05
    EFFECT_WEAPON_PANZER_FIRE
    MD
    Environment_Light
    EFFECTS
    SOUND

    3. You hide all of them without
    Dummy_Tank_Body,
    and
    EFFECT_WEAPON_PANZER_FIRE

    4. You scale your cannon to the size of this orange box - Dummy_Tank_Body
    You can also scale a little bit this orange sqare to make it fit much better

    5. select your cannon model and from modifiers menu choose animations\skin

    6. When you select skin on right panel (in modifier panel - this one with blue wire) in Parameters select Bones: add
    click on this button and add
    Dummy_Tank_Body
    7. If you made it good the cannon wll animate a litle bit - only when firing and getting hits (cause it have's only Dummy_Tank_Body so there's no turret to rotate and so on).

    8. If it animates good nothing more is needed to do
    you can export it.
    If not you must click in modifier panel (this one with blue wire)
    on envelope, select verices and on the draw select all the vertices and press include. If you had more dummies probably you need also use exlude verts, but since we have only Dummy_Tank_Body it won't be necessary

    I didn't added screens cause sharick made it ver well. If you have still some problems i'll add then.
     
  19. woodelf

    woodelf Bard

    Joined:
    Jun 12, 2003
    Messages:
    15,036
    Location:
    Gallery
    Ah, thanks asio^3. I was trying to use the Dummy_Tank_Turret and Cannon and not the Body.

    Also, to prove I'm still a noob...do I need bones and rigging in my model or do I use the Dummy ones from the Body?
     
  20. woodelf

    woodelf Bard

    Joined:
    Jun 12, 2003
    Messages:
    15,036
    Location:
    Gallery
    WOO-F'IN-HOO!!!!!!

    It works! :dance:

    Thanks a ton guys. That addendum really did the trick asio. :thumbsup:

    The only noob thing I did was that when I exported I forgot to hide the Dummy_Tank_Body the first time so I had a yellow box in game. :blush:

    I'm restesting it without the box now and I'll be putting up my new Civil War Cannoon soon with screenies!

    Thanks so much.
     

Share This Page