View Full Version : Making units that use Civ 5 animations


Deliverator
Nov 06, 2010, 07:04 AM
Update 6th May 2013: I'm going to do a better version of this that goes into a higher level detail on rigging Civ 4 meshes to Civ 5 skeletons. Watch this space!

This is a tutorial on how to rig a Civ 4 unit mesh to a Civ 5 unit skeleton and animations.

The Civ 5 Skeleton Template Library

Here is a collaborative Google spreadsheet for tracking which units have been extracted to .blend files by the community to use as unit templates in Blender. You'll need to select an appropriate Civ 5 unit to rig your Civ 4 unit mesh to.

To see how more templates can be created see this thread (http://forums.civfanatics.com/showthread.php?t=495207).

Making your Civ 4 unit use Civ 5 animations in Civ 5

1) First load the unified NIF you have made in Stage 2 of the other tutorial (http://forums.civfanatics.com/showthread.php?t=394056). Using Nifskope rename the bones so that they have the Civ 5 equivalent names. The purpose of this is that we don't have to do as much work with Vertex Groups when we merge this unit with our Civ 5 template in Blender. To rename a bone just double click on the name then you can either type or (easier) paste in the new name.

http://forums.civfanatics.com/attachment.php?attachmentid=271559&stc=1&d=1289040974

Rename as follows:
BIP Pelvis -> Base HumanPelvis
BIP L Thigh -> Base HumanLThigh
BIP L Calf -> Base HumanLCalf
BIP L Foot -> Base HumanLFoot
BIP R Thigh -> Base HumanRThigh
BIP R Calf -> Base HumanRCalf
BIP R Foot -> Base HumanRFoot
BIP Spine -> Base HumanSpine1 (Note!)
BIP Spine1 -> Base HumanSpine2 (Note!)
BIP Neck -> Base HumanNeck1
BIP Head -> Base HumanNeck2
BIP L Clavicle -> Base HumanLCollarbone
BIP L UpperArm -> Base HumanLUpperarm
BIP L Forearm -> Base HumanLForearm
BIP L Hand -> Base HumanLPalm
BIP R Clavicle -> Base HumanRCollarbone
BIP R UpperArm -> Base HumanRUpperarm
BIP R Forearm -> Base HumanRForearm
BIP R Hand -> Base HumanRPalm

i) Some Civ 4 bones names begin with Bip01 instead of BIP - it should be easy to figure out the equivalents.
ii) Don't worry if your model doesn't have some of these bones like Clavicles or Neck - it doesn't really matter - just rename the ones out this list you do have.
iii) Any bones names not in this list (like BIP and BIP Footsteps) don't need to be renamed.

Here's the list of target names on its own for easy copy-and-pasting into Nifskope:
Base HumanPelvis
Base HumanLThigh
Base HumanLCalf
Base HumanLFoot
Base HumanRThigh
Base HumanRCalf
Base HumanRFoot
Base HumanSpine1
Base HumanSpine2
Base HumanNeck1
Base HumanNeck2
Base HumanLCollarbone
Base HumanLUpperarm
Base HumanLForearm
Base HumanLPalm
Base HumanRCollarbone
Base HumanRUpperarm
Base HumanRForearm
Base HumanRPalm
After you've finished the renaming in Nifskope save your NIF as a new file.
2) Start up two separate instances of Blender. In the first, open civ5_minuteman_template.blend from the Skeleton Template Library (http://forums.civfanatics.com/attachment.php?attachmentid=271561&stc=1&d=1289041857). In the second, import the NIF that you were just working with in Nifskope.

3) In the blender instance that has your imported NIF, right click on the mesh in the 3D window so that only it is selected and not the skeleton. Now we are going to use the Copy and Paste script to copy the mesh into the other Blender instance.

For the Copy and Paste script to work you need to save your file as a .blend first - so press Ctrl-S or use the File menu to save it. Once you've done that in Scripts window go to Scripts -> Objects -> Copy and Paste Objects then select Copy object(s) to buffer. (If the option to Copy and Paste Objects isn't there then either you have installed the attached scripts or you need to restart Blender)

http://forums.civfanatics.com/attachment.php?attachmentid=271563&stc=1&d=1289042879

4) Now in the other Blender instance where we loaded civ5_minuteman_template.blend, in the Scripts window go to Scripts -> Objects -> Copy and Paste Objects then select Paste object(s) from buffer. A small copy of your Civ 4 unit should appear.

Now before you do anything else, join the newly pasted mesh with the larger mesh - you may have to use Shift-click to multi-selected in the Outliner window. Ctrl-J will join the two meshes together. This is to fix the paste mesh in place in terms of position and rotate - if you try and do anything to it without doing this the rotation and position usually jumps. You can then go into Edit Mode use the Material selector to select only the parts of the mesh you pasted in and press P to separate them again. Now you have two separate objects again which is easier to work with for the next step.

http://forums.civfanatics.com/attachment.php?attachmentid=271564&stc=1&d=1289043559

5) Now we need to match our pasted mesh to the position of the one that came with the template. First, to scale the model to the correct proportion it is useful do the following, (i) Snap the Cursor to the origin using Shift-S and Snap Cursor to Grid. (ii) Switch the Pivot to 3D Cursor as shown below. Now you can use S to scale and the model with scale from the floor up rather than from its centre point.

http://forums.civfanatics.com/attachment.php?attachmentid=271565&stc=1&d=1289043649

http://forums.civfanatics.com/attachment.php?attachmentid=271566&stc=1&d=1289043861

(In the screenshots I didn't split the mesh into two again as described in Step 4 - I thought of that idea later)

Now it is a question of trying to match the mesh accurately to the pose of the template. Some tips for doing this.

i) Use Numpad 1, 3 and 7 keys to check things from all angles. Often the alignment will look fine from one angle but needs fixing in another. Remember you can use G,X or G,Y or G,Z to move all or parts of a mesh along a particular axis.

http://forums.civfanatics.com/attachment.php?attachmentid=271568&stc=1&d=1289044414

ii) You can use 3D Cursor pivot to rotate parts of the mesh around a specific point - this is useful to rotate of arms around shoulder sockets, legs around hips or to fix the rotation of ankles as shown:

http://forums.civfanatics.com/attachment.php?attachmentid=271567&stc=1&d=1289044063

iii) Positioning hands really accurately is important if there are going to be holding weapons or something else:

http://forums.civfanatics.com/attachment.php?attachmentid=271569&stc=1&d=1289044459

6) Once you've matched the position of the mesh, you can delete the templete mesh leaving just you new one. Ctrl-J join the mesh back with weapons if needs be. Then go through the Vertex Group names and make sure there are no names that refer to Civ 4 bones. For the Minuteman the list should be this - it should be the same as when you first loaded it - if merging your new mesh has added to this list then just delete the surplus nodes. If you don't then your FBX export will probably be scrambled.

http://forums.civfanatics.com/attachment.php?attachmentid=271575&stc=1&d=1289045836

7) Export your FBX. My updated script adds two changes, the ability to set the name of the root bone and the ability to enter any rotation values you like for X, Y and Z. If you are rigging to the Minuteman template you won't need to change anything.

http://forums.civfanatics.com/attachment.php?attachmentid=271576&stc=1&d=1289045836

If you want to try out your model with different Civ 5 animation set you'll need to get the Root Bone name from the Model List tab in Granny Viewer for the unit you want to use the animations of. (This is how we can expand the template library but more on that later).

http://forums.civfanatics.com/attachment.php?attachmentid=271577&stc=1&d=1289046157

8) Convert your FBX into a GR2 using Indiestone NexusBuddy - I use the older v0.1 version (http://forums.civfanatics.com/attachment.php?attachmentid=271659&d=1289089329) as I find it quicker for this - set your textures and material and use Save not Export - you shouldn't need the Smart Exporter tab at all.

(I recommend you give your FBX a short name like a1.fbx as you'll likely need to repeat this step several times to get things looking right with the Civ 5 animations. When you press Save in NexusBuddy the name of the GR2 will be the same as the FBX.)

9) Make a new fxsxml using the Minuteman one as a base - you only need to change the second line to, for example:
<Mesh file="a1.gr2" source="Tool"/>
Everything else can stay the same.

10) Load up your fxsxml in Asset Viewer in Nexus you can use the 3D Viewer and Animation Triggers to test your converted model with the Civ 5 animations.

11) By making adjustments to the skeleton, mesh and vertex groups in Blender then repeating steps 7 to 10, you should eventually be able to make new unit using Civ 5 animations like this one (http://forums.civfanatics.com/showthread.php?p=9874560).

http://forums.civfanatics.com/attachment.php?attachmentid=271554&stc=1&d=1289038956


Old Irrelevant Info:
This tutorial assumes you have some followed or understood Stage 2 from the Getting Civ 4 Units into Civ 5 tutorial (http://forums.civfanatics.com/showthread.php?t=394056) or have a reasonable degree of Blender know-how to start off with.

In this thread, I am going to go through things in general terms rather than describing particular examples in detail - hopefully this is enough for people to be able to follow, but I'll try and answer any questions that arise.

You will need to add the scripts in the attached zip (http://forums.civfanatics.com/attachment.php?attachmentid=271558&stc=1&d=1289040810) to your Blender scripts repository. (The bundled export_fbx.py script will be overwritten so you may want to back it up somewhere outside the scripts folder first.)

Deliverator
Nov 06, 2010, 07:12 AM
Reserving for more 1

Deliverator
Nov 06, 2010, 07:13 AM
Reserving for more 2

Deliverator
Nov 06, 2010, 07:14 AM
Reserving for more 3

Jaythekiller
Nov 06, 2010, 08:46 AM
Great job,once again :)

EDIT: was it difficult to do the template?/ are some particular tools needed (except granny viewer)?

LoneGamer
Nov 06, 2010, 10:50 AM
Great work.

If you want to try out your model with different Civ 5 animation set you'll need to get the Root Bone name from the Model List tab in Granny Viewer for the unit you want to use the animations of. (This is how we can expand the template library but more on that later).

Sweet deal.
A favor. Could you upload your nexus buddy version1. I deleted mine when I updated it and can't seem to find the older version here.

Cheers.

Deliverator
Nov 06, 2010, 07:22 PM
EDIT: was it difficult to do the template?/ are some particular tools needed (except granny viewer)?

A bit tricky seeing as I was matching a skeleton in Blender by looking at it Nexus 3D Viewer and Granny Viewer. Now it should possible to use the one I've done as a base for the other human units.

I've attached the older version of NexusBuddy.

Jaythekiller
Nov 07, 2010, 01:39 AM
A bit tricky seeing as I was matching a skeleton in Blender by looking at it Nexus 3D Viewer and Granny Viewer. Now it should possible to use the one I've done as a base for the other human units.

If i understand well,we can use this skeleton to create templates using others animations

Then, how to create those templates?

Deliverator
Nov 07, 2010, 02:23 PM
Then, how to create those templates?

I'll make that my next write up. I want to get a bit more practice at doing it myself first. I've successfully rigged the Zulu Impi I was working on to the Civ 5 Aztec Jaguar animations - see here (http://forums.civfanatics.com/showthread.php?t=397159) - so that's another template done. My next priorities are Archer, Swordsman and Paratrooper - if I can do those then I should have enough experience to describe the process in a bit more depth.

danrell
Nov 07, 2010, 03:04 PM
Thanks for the tutorial and templates, I follow your tutorial and conversion the unit, it worked, but I need modify some rotation of bones axes.

http://forums.civfanatics.com/downloads/snap025_5fv.jpg

Deliverator
Nov 08, 2010, 04:00 AM
Thanks for the tutorial and templates, I follow your tutorial and conversion the unit, it worked, but I need modify some rotation of bones axes.

That's great, danrell. I'm glad that you could follow this (even without a lot of detail) and it's good to have one of the greats of Civ 4 unit modding around!

Yes, to get the best result it is necessary to tweak the rotation of bones, the position of bones relative to the mesh or mesh relative to the bones and adjust vertex groups until the animations look right in Nexus 3D View. It's trial and error to get the best result, but it's worth the effort to get a fully animated unit with sounds and effects.

Deliverator
Nov 08, 2010, 02:35 PM
New version of the template library attached to the opening post. Now includes the Aztec Jaguar template.

blazekid87
Nov 12, 2010, 07:31 PM
I was able to add my own custom texture using the civ 5 minuteman animations.

http://img715.imageshack.us/img715/7492/modernmarines.jpg (http://img715.imageshack.us/i/modernmarines.jpg/)

Now, Im trying to see if I can reuse that template and get the infantry animations working by simply changing the names of the gun_bone and the root bone. The problem is that when I export to fbx using your script, I get both the WORLD_center and Dummy_WORLD bones. Im not sure if it actually adds both but it would be nice if it would actually replace it instead of adding a new one.

I dont see the original WORLD_center dummy bone in the heirarchy in blender so I cannot delete it.
Other than that, the new template helped me produce alot of new units so many thanks for doing so =].

Deliverator
Nov 13, 2010, 02:27 AM
I dont see the original WORLD_center dummy bone in the heirarchy in blender so I cannot delete it.
Other than that, the new template helped me produce alot of new units so many thanks for doing so =].

Did you change the name of the root bone in the options when using my new FBX export script?

http://forums.civfanatics.com/attachment.php?attachmentid=271576&stc=1&d=1289045836

All you should need to do is rename the gun bone and then see the Root Name to Dummy_WORLD in the export options, In any case having extra bones not referred to by the animations doesn't matter too much. I have deliberately added the Adj and Adj2 bones so that I can tweak the position of weapons,etc and know that the animation won't affect my adjustments.

Also, I would like to suggest that people posting units should include their final .blend in their uploaded files. Since conversion into GR2 is a one-way street, doing this would allow other modders to make variations or adaptations of your unit. I'm going to start doing this myself with units I post to the database. I see danrell already did this with his Samurai conversion (http://forums.civfanatics.com/showthread.php?t=397870).

blazekid87
Nov 13, 2010, 10:55 AM
Yea, I changed the name of the gun bone and the WORLD_center to Dummy_WORLD like i mentioned. But when I view it through nexus, I can still see both. The animation also doesnt move, it stays in the t pose.

I also tried to use the paratrooper animations since the dummy origin has the same name. The animations work, but simply changing the name of the gun bone didnt work because the gun stays laying on the floor. I assigned the gun verticies to the "gun" bone. Or should it be assigned to the Adj2 bone?

danrell
Nov 14, 2010, 03:31 AM
Hello Deliverator ,
I making the tank unit, then I added the bone correctly, and play it in the Animation Triggers, looks pretty good, but it didn't work in the game.
I upload the blend file, can you see what wrong? sorry my bad english...:blush:

http://forums.civfanatics.com/attachment.php?attachmentid=272513&stc=1&d=1289727016
http://forums.civfanatics.com/attachment.php?attachmentid=272514&stc=1&d=1289727016
http://forums.civfanatics.com/attachment.php?attachmentid=272515&stc=1&d=1289727016

Deliverator
Nov 14, 2010, 04:11 AM
Hello Deliverator ,
I making the tank unit, then I added the bone correctly, and play it in the Animation Triggers, looks pretty good, but it didn't work in the game.
I upload the blend file, can you see what wrong? sorry my bad english...:blush:

It's strange that it works in Nexus but not in game. You could try creating another dummy bone above tank_bone_main. The human units that we have working so far all have an "Adj" bone above the main Civ 5 skeleton - see below - I'm pretty sure I added this for a reason, but I can't remember what exactly.

http://forums.civfanatics.com/attachment.php?attachmentid=272518&stc=1&d=1289729824

I also tried to use the paratrooper animations since the dummy origin has the same name. The animations work, but simply changing the name of the gun bone didnt work because the gun stays laying on the floor. I assigned the gun verticies to the "gun" bone. Or should it be assigned to the Adj2 bone?

The gun should definitely be assigned to the gun bone. The Civ 5 animation keys into bones by name so it doesn't know anything about the Adj bones - that is why they are useful to making adjustments to positions and rotations.

I do want to work on some more templates soon - but I've been really busy with RL this week. Might get the swordsman done later today.

bernie14
Nov 18, 2010, 02:28 AM
ok good new and bad news.....i am working on a rifleman .blend template based on the minuteman....the bones r similar enough where i think i am pretty close to acheiving success (see pic) i think i only need to rotate a couple of bones and i will be there (i also what to clean up the art files so we get a really pretty unit).....MY PROBLEM is that i SUCK at XML stuff....im sure that once i get the hang of it, it will be no prob, but i would really appreciate some help/guidance in which xmls i need to work on, and what exactly i need to do to these files....my goal is just to create flavor units at this time, no new unit classes or abilities (yet), just start getting some ethnic flavor units. in an ideal world, i would like to be able to make these with mod buddy but it seems like chinese to me right now.....

http://forums.civfanatics.com/attachment.php?attachmentid=272913&stc=1&d=1290068690


ps....GREAT thanks to the masters whom have proivided excellent TUTS, Kael, Deliverator, Lemmy and colonel Blinky (i am promoting you several ranks) as well as danrell and others whom i have been able to get some file structure knowledge....


pss...is there ANY possibility that the NexusBuddy be able to convert gre ---->>fbx...that would be just AWESOME since we could mod civ 5 files directly in blender via fbx

bernie14
Dec 05, 2010, 03:32 AM
ok....just a tease, i am working on the longswordsman "template"....i think i got him down with the templar, but also plan to do the old maceman, as well as changing some weapons and heads.....

http://forums.civfanatics.com/attachment.php?attachmentid=274585&stc=1&d=1291541347

@deliverator....how's taht swordsman coming along....got some nice shields i'd like to use :D

Deliverator
Dec 05, 2010, 03:37 AM
@deliverator....how's taht swordsman coming along....got some nice shields i'd like to use :D

I got back into working on Dune Wars, so he's been half-done for a while. I'll see if I can finish him today.

Edit: It won't be today - but sometime this week...

bernie14
Dec 06, 2010, 03:04 AM
I got back into working on Dune Wars, so he's been half-done for a while. I'll see if I can finish him today.

Edit: It won't be today - but sometime this week...

oh, no hurry mate, i'll be working on these longswordsmen for a while....:)

Ekmek
Apr 12, 2011, 12:19 PM
Deliverator,

Are you still making templates? I'm think about making a LH template and would need your help.

Jabberwockxeno
Jul 16, 2012, 09:03 AM
A related question:

How easily could one turn animations using the biped system in 3ds max into usable animations for civ 5?

Or would it be easier to just re-skin a edited civ 5 mesh to the orginal animations? I would be editing the marine/paratrooper models, mostly the surface features.

Jabberwockxeno
Jul 31, 2012, 08:51 AM
A related question:

How easily could one turn animations using the biped system in 3ds max into usable animations for civ 5?

Or would it be easier to just re-skin a edited civ 5 mesh to the orginal animations? I would be editing the marine/paratrooper models, mostly the surface features.

Bump. I just need to replace the rifle the paratrooper uses with a different gun model, and retexture it after, but I can do the latter alone anyways.

Am I reading the OP right that we can only extract two unit animations into a usable format?

Jabberwockxeno
Aug 02, 2012, 08:36 AM
Or, can we not extract the civ 5 animations at all?

Jabberwockxeno
Aug 22, 2012, 12:06 AM
...Guys?

JTitan
Aug 29, 2012, 05:44 PM
I got the unit in game with the graphics and animations working but the unit faces in the opposite direction and runs backwards. How can I make the unit face in the right direction?

Nevermind, I exported the fbx wrong. I forgot to set the axis.

bernie14
Aug 30, 2012, 02:33 AM
Bump. I just need to replace the rifle the paratrooper uses with a different gun model, and retexture it after, but I can do the latter alone anyways.

Am I reading the OP right that we can only extract two unit animations into a usable format?

Or, can we not extract the civ 5 animations at all?

...Guys?

i would use the copy/paste script to change rifles, jugs, head, legs whatever....then join objects, make sure it is properly rigged and assign to one uv and material

Ekmek
Oct 16, 2012, 06:31 PM
Can anyone update this template list. IIRC we have a lot more templates now.


Key - Template Made
Root Name for FBX export given in brackets

UNMOUNTED HUMAN MILITARY - MELEE

Brute
Warrior
Scout
Spearman
Swordsman
Hoplite
Legion
Immortal (Point_WORLD)
Mohawk Warrior
Jaguar (WORLD_BASE)
Pikeman
Longswordsman
Landsknecht
Samurai

UNMOUNTED HUMAN MILITARY - RANGED

Archer (point_WORLD)
Crossbowman
Longbowman
Chu-Ko-Nu

UNMOUNTED HUMAN MILITARY - FIREARMS

Musketman
Musketeer
Minuteman (WORLD_center)
Rifleman (WORLD_center)
Janissary (WORLD_center)
Infantry
Foreign Legion (WORLD_center)
Paratrooper

MOUNTED

Horseman
Chariot Archer
War Chariot
Companion Cavalry
War Elephant
Knight
Mandekalu Cavalry
Camel Archer
Naresuan's Elephant
Lancer
Cavalry
Sipahi
Cossack

CIVILIAN

Settler
Worker

SIEGE

Catapult
Ballista
Trebuchet
Cannon
Artillery
Rocket Artillery

AIRCRAFT

Fighter
Bomber
Zero
B-17
Atomic Bomb
Helicopter Gunship
Jet Fighter
Stealth Bomber
Nuclear Missile
Guided Missile

VEHICLES

Anti-Tank Gun
AA Battery
Tank
Panzer
Modern Armor
Mechanized Infantry
Mobile SAM
Giant Death Robot

SHIPS

Work Boat
Trireme
Galley
Caravel
Frigate
Ship of the Line
Ironclad
Destroyer
Battleship
Submarine
Carrier
Nuclear Submarine
Missile Cruiser

GREAT PEOPLE

Great General
Great Artist
Great Scientist
Great Engineer
Great Merchant

SHIP PARTS

SS Booster
SS Cockpit
SS Engine
SS Stasis Chamber

DLC for completeness

Bowman
Keshik
Khan

Mahandar
Dec 02, 2012, 05:09 PM
Hey Deliverator. I've been combing through your tutorials doing everything step by step and so far everything was going smoothly but now I can't seem to load your copy/paste script for blender. :( The export FBX works but when I look for the copy/paste one nothing shows up in scripts > object.(I did place it in the Blender Foundation\Blender\scripts\object fyi)

Ekmek
Dec 04, 2012, 06:31 PM
that script never worked for me. you may want to go to the blender foundation. I usualy just export and import everything

Mahandar
Dec 04, 2012, 07:40 PM
that script never worked for me. you may want to go to the blender foundation. I usualy just export and import everything
Does it work to just import/export normally without too much problems?

Also, can someone help me out with the nifs since I can't seem to get some of Bakeul's units into blender without some error regarding the BIPs. :confused:

Deliverator
May 06, 2013, 05:30 PM
Sorry about long delay! In relation to the new GR2 -> blend process this thread becomes more relevant again.

Does it work to just import/export normally without too much problems?

Yes, importing the NIF into a Blender instance that already has the template Civ 5 unit should work just as well - although I'm going to test out the copy/paste technique to see if it still works.

Also, can someone help me out with the nifs since I can't seem to get some of Bakeul's units into blender without some error regarding the BIPs. :confused:

If you point me in the direction of the problem NIFs I can take a look although its been a couple of years since I did much with Nifskope. I have found Bakuel's units have a really non-standard structure so they often work import into Blender out of the box.

Edecon
Oct 07, 2013, 10:32 AM
exist any method to convert civV units to civIV? tnks.:)

Ekmek
Oct 07, 2013, 02:31 PM
if you extract the civ5 unit to blender than rig to civ4 that'll do it. watch the polycount though

Edecon
Oct 08, 2013, 08:18 AM
that step I've done, but the unit appears huge in niftools, and by combining the unit with one of civ 4, I get sideways.

Ekmek
Oct 08, 2013, 01:50 PM
in blender you should extract the civ5 mesh then export it as something else. then clearing blender import your civ4 unit import the extract civ5 mesh then resize it and rig it then export to nif. then view in nifskope.

I think you missed a step.