• Civilization 7 has been announced. For more info please check the forum here .

HOW TO: Export Civ 4 graphics to Civ 5

poncratias

Prince
Joined
Feb 9, 2010
Messages
336
If you want to use graphics from Civ IV for you mods, here's how you can get them over.
Thanks to Deliverator & Jaythekiller !


1.Find the Civ4 art files you want to export.

Most of them are under the Civ 4/Assets/Art folder.
If you can't find what you need, maybe you'll have to unpack the .fpk files under Civ 4/Assets first.
Use the tool "PakBuild" to do so:
http://www.civfanatics.net/downloads/civ4/utility/PakBuild.zip
Art files:
.nif = 3d model (mesh)
.dds = texture
.kf = Keyframe file (animation)


2.Download and Install in this order (it's not as much as it seems) :

1. Python
2. PyFFI
3. Blender
4.
Blender Nif-Scripts



3.Convert the files from .nif to .fbx


Import Civ4 NIF and animation KF files one by one into Blender and export them as FBX files. This will have to be done individual for each animation so if the unit has 25 you have to do it 25 times.

In Blender,Click "File",then "Import",then "Nettimerse Gamebryo files (nif,kf,kfm)"

It opens a file browser,select the art file you want to import (something like "warrior_FX.nif)
Click on "Import Nif"

In the "texture path" field,give him the path to your .dds texture (Let's say warrior128.dds)
in the "Keyframe File" field select a .kf file (let's say "warrior_md_run.kf")
click on "use the force" button
click "OK"

then select your warrior by right-clicking on it (the edges will be pink if you select it)

Then click on "file","export","Autodesk(FBX)" (be carefull,there are two Autodesk types)
Now just click on "export"

Select the name for your .fbx file,click on "export"


4. Convert from .fbx to .gr2

Note: right now Nexus doesn't work properly, so until it is fixed,
use the IndieStone Nexus Buddy !

check out this tutorial on HOWTO: New Units the easy way


also check out this one
http://forums.civfanatics.com/showthread.php?t=392705



I hope this may help some others to get into it, and hopefully we will se LOTS of new stuff soon! :)
 
Edit: See more detailed guide here.

Good work poncratias, you've got the basic process down.

Reposting here:

I got two problem with my model
It only shows the model,not his gun and the bomb
Secondly, I got black ray appearing some times on the screen when i load the game and select my unit
I probably do something wrong but don't know what
I can upload my fbx or an other file if it helps

These types of issues sound familiar...

Having lots of problems though with the Blender FBX export - doesn't seem to be very reliable. Often my meshes turn out a bit mangled once they are converted to GR2. This seems to be more common if I have a model with multiple meshes in it - the Housecarl has a body, an axe and a shield. Often only the body is visible - probably because the Axe (for example) is just a child of the BIP Hand node rather than actually being rigged to it.

If I combine all the bits into a single mesh it seems that most of the time the FBX comes out looking more or less OK, but then I have to combine the textures into a single texture and fiddle with the UV mapping, etc. If this is the only way to get things to work then getting any unit with props (i.e. most of them) is going to be more work.

Overall, my main priority is trying to come up with a reliable and robust conversion process for Civ4 units - I'll then write up a tutorial - then the units can roll. At the moment, I haven't figured out a reliable enough method - there is a lot of trial and error in Nifskope and Blender to get a NIF -> FBX -> GR2 that is not mangled and animates OK.

It may be that we need to play with the FBX export options - switch off optimization, etc. It could be that the optimization is mistakenly removing vital bits of the mesh.

Also, I have seen one or two fixes to export_fbx.py posted around other forums - might be worth a try. If anyone understands Blender scripting and Python perhaps they can make the script more reliable and robust.
 
Indeed, but maybe this is connected with the bug I read about elsewhere, that you may only use up to max. 32 polygons?

Sadly I'm a too big 3D noob to dig any further...
 
Indeed, but maybe this is connected with the bug I read about elsewhere, that you may only use up to max. 32 polygons?

Sadly I'm a too big 3D noob to dig any further...

I think that 32 was the restriction on the number of bones in a unit imposed by the unit shader used in Civ 5. I think most Civ 4 units are under that. I'm having FBX export issues on units with under 32 bones anyway.
 
Surprisingly The result is worst if i combine all objects in one mesh
I tried to combine the all scene, i get an invisible unit and black rays on screen
I tried also with just the Great Spy body and his gun,i get the same result
I'm totally confused
 
Surprisingly The result is worst if i combine all objects in one mesh
I tried to combine the all scene, i get an invisible unit and black rays on screen
I tried also with just the Great Spy body and his gun,i get the same result
I'm totally confused

Have you tried changing the FBX export options, optimization, etc from the defaults? It could make a difference.

I'm going to keep researching this weekend.
 
I think i've tried many of them (maybe not all possibilities)
All i can say is when i import only one mesh it works fine,(whatever are the export options)
But when i try with multiple meshes,i get those black rays and the unit is partially or totally invisible :(
 
Looking at the documentation for the export script here. The following note jumps out:

"Do not used skinned meshes as children of other objects (except their own armature) This doesnt work reliably"

Funnily enough, the swords, guns, other weapons and tools used in Civ 4 units are skinned meshes that are children of other objects (BIP nodes) that do not have their own armature. Hence they are not supported by the FBX export script that ships with Blender and the model gets mangled if you have any weapons with the unit you are trying to export.

One workaround is to make the whole unit including weapons into a single mesh and then rigging the weapons, but it is going to take time and screenshots to explain how to do this. Can't do it right now unfortunately.

At least this seems to be confirmation of what is causing the problem. It's a bit of a pain because it is going to make the conversion process more complex than it's already going to be.
 
That's funny : I've gone on this page earlier today and noticed that too.
I thought i could solve the problem by importing nif without textures,but it didn't work :)
 
OK, making everything into a single mesh and a single material plus rigging weapons to bones seems to do the trick. My Total Realism Housecarls are now looking OK in game. The Idle animation is a bit jumpy so I'm going to see if I can fix that then port the other animations.

 
Good,do you know where i can find a good tutorial about rigging weapons to bones?

I'll explain how soon, but in the meantime you could look in the Civ4 tutorial section for Blender tutorials or watch Super3boy's Blender tutorials on YouTube - probably the best way to learn Blender. I want to focus on completely porting my first unit before writing a tutorial on how to do it for obvious reasons.

Here's a better shot of the Housecarls. It would be really good if someone could make a interface to allow you zoom in more and rotate the camera.

 
It would be really good if someone could make a interface to allow you zoom in more and rotate the camera.

Not sure if you know,but you can go into config.ini and set the maximum zoom level up from 11.0 to 4.0
 
Jaythekiller said:
Not sure if you know,but you can go into config.ini and set the maximum zoom level up from 11.0 to 4.0

Thanks, I didn't know that. Now we can see that the better quality homemade Civ4 units are going to look just fine alongside Civ5 units...



Another good thing I've realised is that we should only have to convert each Civ4 animation set once and then we should be able to reuse it. For example, once I'm done with these Housecarls which use the Swordsman set, it should be much quicker to convert other units which use those animations. All you should need to do it convert the model to GR2 - you'll already have all the animations in GR2 already.

lemmy101 said:
I'll look into adding a NIF importer to Nexus Buddy at some point. Not probably for a while though it's probably a decent amount of work...

That would be very cool, especially given that we don't know if we'll even be able to rig custom meshes to Civ5 skeletons and animations.
 
Also, I have seen one or two fixes to export_fbx.py posted around other forums - might be worth a try. If anyone understands Blender scripting and Python perhaps they can make the script more reliable and robust.

Where did you find those fixes? Is there any of them valuable for what we want to do?
 
Following the insturctions. I found the dds. There's several dds's, and one nif in the folder. And no KR files.

If there's no KR file, do you just omit that step? And if so, I don't see a "use the force" button after that.
 
Following the insturctions. I found the dds. There's several dds's, and one nif in the folder. And no KR files.

If there's no KR file, do you just omit that step? And if so, I don't see a "use the force" button after that.

_which unit is it?
_It's not KR but KF files you re looking for
_the use the force button is visible once you select the nif and click on "export" if you don't see it,maybe you re not using the same version
 
Top Bottom