Getting Civ 4 Units into Civ 5

OK after quite a bit of testing I figured out most of the issues I was having before. I managed to finally get the shield and sword into the game.

Spoiler :


Yes the sword is in his side and the shield is only shielding the sun from him but this is progress lol.

It seems when you have diff versions of PyFFI and Blender NIF scripts you get diff results when doing this. I couldn't get the animations to work unless I used the force. When I reinstalled I took the version Deliverator was using(this took away those letters I was getting) but then I ran into more problems when loading different .nif's in blender(even civ4 vanilla units), i deleted the controller's using nifskope and that let me load them but without the Stage 1 info and my lack of knowledge I returned to the version I was using before.

Seeing how I was able to get the unit in the game before just lacking the shield/sword I looked to the tutorial part where you assign the vertex group, I wasn't using the material slider to set that up properly, seems that is the only way to go about it. Selecting the sword and the armatures going into pose mode and trying to parent the sword to BIP R Hand but that didn't work.

Now my two problems are when I join the meshs together and then assign them their vertex group it moves the sword/shield see above pic. the other problem is I am trying to assign the shield to a different material group (right now I have 2, 1 for the body and the other is for the shield and the sword.) right now both the sword and shield are assigned to the BIP R Hand vertex.

All in all though things are moving along great considering. I will play around with all this more. I'm thinking I might need to do all this before I join the sword and shield to the body but that still won't fix the flying shield and sword issue.

Again, thanks Deliverator for your help and guide.

Edit:
Spoiler :


:D:D:D:D:D First thing i did was added materials, assigned 1 to sword other to sheild. Then joined them all. assigned vertex groups and moved/rotated the shield/swords :D

This unit is also from the Total Realism mod. I figured I posted it enough around here people might wanna know. My thanks to them for making a nice looking highlander.

Deliverator how did you go about having the different shields/hair color in the same unit?

Edit Nvm I found
Spoiler :
Code:
<UnitArtInfo>
<Type>ART_DEF_UNIT_HOUSECARL_C</Type>
<Formation>Warrior</Formation>
&#8722;
<UnitMemberArt>
<MemberType>ART_DEF_UNIT_MEMBER_HOUSECARL_A</MemberType>
<MemberCount>2</MemberCount>
</UnitMemberArt>
&#8722;
<UnitMemberArt>
<MemberType>ART_DEF_UNIT_MEMBER_HOUSECARL_B</MemberType>
<MemberCount>3</MemberCount>
</UnitMemberArt>
&#8722;
<UnitMemberArt>
<MemberType>ART_DEF_UNIT_MEMBER_HOUSECARL_C</MemberType>
<MemberCount>2</MemberCount>
</UnitMemberArt>
</UnitArtInfo>
</UnitArtInfos>
 
Well done LG, it's great that you've been able to get so far so quickly and fix your own issues. I've been working with Blender and Nifskope for 18 months, so if I can pass what I've learnt on quickly like this I happy. :)

Using the material select method is just an easy way of selecting the components of the model. You could equally well lasso select the vertices you want in the 3D View or select the parts you need to assign to vertex groups in any other way.

moved/rotated the shield/swords

Glad, you figured this out yourself.

The high level approach in Stage 2 is this:

A) Load the NIF without animations.
B) In the case of the Zulu I used the club and shield are already in the right positions relative to the body and skeleton. This means when I Join them (Ctrl-J) to the body they are in the correct position for animation already.
C) Make your single texture using the Bake Texture method.
D) Assign weapons, etc to bone Vertex Groups. This is what is meant by "rigging".
E) Export to NIF and check everything looks OK.
F) Re-import exported NIF with an animation and export as FBX. Repeat for each animation you want to convert.

Note for step B, If you're weapons aren't in the correct position you can use G to Move and R to Rotate them in the 3D View - I find it easier to do this in Edit Mode (TAB).

Deliverator how did you go about having the different shields/hair color in the same unit?

I see you've figured this out. Total Realism has quite a few units (including the Highlander) that includes texture or model variations. The texture ones are easier because you can just load the same FBX into NexusBuddy and point to the different DDS texture before you export to make your variations.
 
I'm facing a problem:

The unit i want to import (marine from CivIV), has a weapon divided into multiple meshes

I moved the weapon to the right position

Then joined every meshes one after one to the body and assigned the materials

When i export the file and read it into nifskope,i can see the AK-47 loader flying aside my unit (and it tells me : The following controlled nodes were not found : "Polymesh")
Besides that, weapon main body is in the good position

There are four materials in the original nif :

_ Marine : The whole unit
_ Poly mesh : weapon loader (assigned to "Bip01 hand L" vertex group)
_ Editable Poly@#0 : weapon main body (assigned to " Bip01 hand R")
_ Editable Poly : surprisingly,it looks like "Poly mesh" (assigned to "Bip01 hand L")

Please help me understand what goes wrong with my unit
(If you want, i can upload some files)
 
(If you want, i can upload some files)

If you can do that I might have time to look at it later. Hard to know what the issue is without the files.
 
Can the same process be used for buildings, say... the parthenon?

Yes, I'm sure it will work fine. The problem is that there is no way to get any custom buildings to work in a mod at the moment. See this thread.
 
First of all thank you for this tutorial :worship:

Now I wonder:
1) how to migrate ranged units (like javelineers, archers, gun-powered) in order to generate the right projectile effect anims?
2) can Civ5 manage ethnic units concept?
3) can we share converted anims among different units using the same set?
 
It would be nicer if I could just load my FBX files one by one into NexusBuddy without having to worry about the frame numbers. I prefer my method because although it is repetitive, I don't have to think as much which is bonus when converting units.

Good idea. I'll look into this.
 
@ Deliverator: do you need a .kf file ?

No, it's just the standard Civ 4 Marine right? I have everything unpacked already.

One limitation of this conversion process is that we can't have elements where the visibility turns on and off. Everything has to be visible all the time. For the Marine we'll have to get rid of the second rifle cartridge used by the reload animation otherwise both cartridges will show all the time. So I'd just delete the second cartridge and not worry about it. The fidget reload animation can just be left out when you make your fxsxml.

ambrox62 said:
1) how to migrate ranged units (like javelineers, archers, gun-powered) in order to generate the right projectile effect anims?

Good question. There are two possible solutions.

A) We find a way to rig custom meshes to Civ 5 animations

This would be great anyway because there are many more animations required for each unit in Civ 5 than in Civ 4 and the end result would be smoother. Unfortunately, you come up against the fact that GR2 is a proprietary format and cannot be imported into Blender or Max. This is a blocker on rigging units to the vanilla game skeletons and animations which is how almost all community Civ 4 units were made.

I have done some initial investigation on a workaround for this.
i) If you import and then save a vanilla Civ 5 .gr2 unit file using NexusBuddy you can view the skeleton structure and bone names using Granny Viewer.
ii) I tried renaming all the bone names in a Civ 4 NIF unit to be the same as the Civ 5 ones.
iii) Then exporting the unit with the renamed bones as an FBX I can use NexusBuddy to make a .gr2.
iv) Viewing this .gr2 in Granny Viewer it now has a near identical skeleton structure with the same names bones.
v) Tested loading an fxsxml with my own .gr2 but using the vanilla Civ5 .gr2 animations into Nexus 3D View but the model didn't respond to the animation.

Theoretically, this approach should work but something is not quite right yet. I can post some screenshots of the Granny Viewer stuff if people are interested.

Perhaps lemmy101 and CaptainBinky with their amazing knowledge can help figure this out.

B) We find a way to add effects, projectiles and sounds to ported Civ 4 units

Possibly more likely than (A). If we can get the migrated unit so show its animations in the Animation Triggers view in Nexus (see this thread) potentially we can hook up effects and projectiles. I guess you would need a named bone node in your model for the arrow or muzzle flash to eminate from.

ambrox62 said:
2) can Civ5 manage ethnic units concept?

I guess so. Whether you can achieve this as elegantly as with CIV4UnitArtStyleTypeInfos.xml I haven't looked into yet. I guess CIV5ArtStyleTypes.xml is something to do with it.

ambrox62 said:
3) can we share converted anims among different units using the same set?

Again, a theoretical yes. I had some problems with doing this with the Swordsman anims used by the Housecarl unit, but the rigging of that unit was a bit odd, so I'm going to try again with the Zulu Impi I'm working on which uses the Civ 4 Aztec Jaguar anims.

lemmy101 said:
Good idea. I'll look into this.

Cool. Could you also default the name of the animation to the name of the loaded FBX file? So when I load, for example, impi_run.fbx, impi_fidget.fbx, impi_run.fbx I get animations called impi_run, impi_fidget, impi_run. Perhaps have a suffix like _anim so they are outputted as impi_run_anim.g2, impi_fidget_anim.g2, impi_run_anim.gr2 to make it easy to see what are animation GR2s and what are mesh GR2s.
 
Perhaps lemmy101 and CaptainBinky with their amazing knowledge can help figure this out.

I'd love if this could happen. I need my archers to have that sexy anim :). I love reading this thread, it seems when I'm away wondering what I could do next, I come here and there is already a post about it :D
 
1) how to migrate ranged units (like javelineers, archers, gun-powered) in order to generate the right projectile effect anims?

At some point I'll create a template for this in Nexus Buddy. It should be pretty straight forward for archers / gunpowder.

You should just need to stick this at the bottom of your generated fxsxml file inside the closing </Asset> tag:

Archers:
Code:
<TimedTrigger file="FX_Triggers_Archer.ftsxml"/>
<BoneUsage>
	<Bone name="point_STRING"/>
	<Bone name="point_HAND"/>
	<Bone name="Point_PROJECTILE"/>
	<Bone name="Base HumanSpine2"/>
	<Bone name="Base HumanLCollarbone"/>
</BoneUsage>

Gunpowder:
Code:
<TimedTrigger file="FX_Triggers_Rifleman.ftsxml"/>
<BoneUsage>
	<Bone name="gun"/>
	<Bone name="Base HumanSpine1"/>
</BoneUsage>

renaming the bones as appropriate (and making sure said bones exist on the model) if you need to know where these bones should be, load the archer from Civ 5 in Nexus and turn on the bone labels.

For javelins though you may need to duplicate the FX_Triggers_Archer and edit it, or find a more suitable alternative.
 
Cheers lemmy. Any thoughts on the process described under A) in my previous post? Does it sound like something that should work?
 
Cheers lemmy. Any thoughts on the process described under A) in my previous post? Does it sound like something that should work?

Yeah sounds fine to me. :) I'm a fan of 'as few clicks as possible' myself so the more I can cut the process down for you guys the better.

Sorry I'm being a bit slow with this version, got a bit sidetracked with leader and real life stuff :D
 
Great news! lemmy101 you da man! No worries about the delay man, life happens. I'm stoked about this animation news :D Now to try and implement it!
 
@deliverator: Got a new problem :(
My unit animate well in Nifskope but when reimporting it in blender ,
the mesh doesn't match the skeleton position so want to apply a modifier but then, my unit is on the ground like rigged to right foot bone of the skeleton
If i replace it correctly and try to run the animation ,only the skeleton moves (smoothly and nice :))
So what am i doing wrong?
 
Jay did you try exporting it and seeing how it acts in game? I ask cause if it animates good in nifskope then its probably going to in game. It might still work, when I was converting the highlander and I loaded up the run kf there was no mesh that showed up just the bones but it showed up well in nifskope. I exported it to .fbx then to .gr2 and works fine in game.

Also when I did my marine idle convert I didn't bother saving the .nif(it caused a prob i think) I just imported it, assigned the gun to a new material as well as the clip, joined them to body. add the vertex group, dragged and rotated em to fit properly and then export it to .fbx and you know the rest of the process.

got this end result
Spoiler :
 
@deliverator: Got a new problem :(
My unit animate well in Nifskope but when reimporting it in blender ,
the mesh doesn't match the skeleton position so want to apply a modifier but then, my unit is on the ground like rigged to right foot bone of the skeleton
If i replace it correctly and try to run the animation ,only the skeleton moves (smoothly and nice :))
So what am i doing wrong?

Sounds like you might not have done this bit from the tutorial - namely setting the Armature modifier for the mesh:

---

You'll probably find that the mesh isn't matching the pose of the skeleton. Easily solved. Select the mesh using right click and click "Add Modifier". Pick the option Armature and then type "Scene Root" next to the "OB:". The model should snap to the skeleton pose.



---

It might not be "Scene Root" you need to enter in some cases. What you actually need to type as the Armature modifier is the name of the skeleton. You can get this by right-clicking on the skeleton. Use Z to switch between Solid and Wireframe view if that helps. The name of the skeleton should be in the bottom left when you selected it (from memory).

Another potentially useful feature for Nexus Buddy would be a ability to rename Bone Nodes if that is possible, although you can do that in Nifskope or Blender prior to FBX export.
 
Top Bottom