R
Rabbit, White
Guest
With the release of Civ4 Plugins for 3dsmax 6 and 7 we can start making new models for
. Unfortunately, all we got are the plugins and a nif viewer, with no tutorials, documentation or any instructions at all. Some people have been able to figure things out, some have not. In this tutorial I will attempt to provide some guidelines for properly exporting models from 3ds max and using them in game.
Please keep in mind, that like everyone else I am just starting to explore the possibilities, and doing it pretty much blindfolded, so there might be some errors or omissions, and this is definitely not the "Complete Guide to Creating New Models for Civilization IV"
. If you know of a better way to do something, or have a solution to a problem I did not address, I encourage you to post your findings here.
UPDATE: Well the documentation for properly exporting models have been released. I recommend reading it first since it has a lot of useful information and especially directions for how to properly set up a model for export. Having said that, I don't think it makes this tutorial obsolete, it all depends on what exactly you want to do.
On to the tutorial...
What you will need
You will need to have 3D Studio MAX 6 or 7, there is a 30-day demo available.
You will need the Civ4 plugins, for 3ds max 6, or 3ds max 7. To install the plugin, simply unzip the contents of the file into the 3ds max installation folder.
You will need the NIF viewer. It comes with the plugin, it's the SceneViewer.exe file, also note the BoundShape.nif and BoundShape.tga files that come in the zip as well - you will, you guessed it, need them
.
In order to use the NIF viewer you might need the mfc71.dll file, you can get it here, instructions on how to install it are in the zip.
Finally, you will need some luck
Preparing the model for export
I will use my P-51 model throughout this tutorial, and will occasionally reference the F-15 model, both are found in my sig.
I'm also assuming basic knowledge of 3ds max.
While Civ 4 can display very high-poly models it is recommended you stick to models with about 800-1000 triangles for multi-model units (e.g. most land units), and no more than 2000 triangles for single-model units (e.g. air/naval units). In general though, consider the scale of the units and don't use more detail than needed. For example the F-15 model I used is 1045 polygons, while the P-51 model is ~1400 polygons, and I don't see a reason to add any more detail, in fact I could cut another 200-250 polygons from the P-51 and most people will not notice it.
When creating models for Civ4, it's best to use the specific material made for it, called CivilizationIV XPLatform Material. Although I was able to export models just fine by using the default material, if there's one specifically designed for it, why not use it.
Said material allows you to choose between Next-gen XBox material (we don't need that), and PC/Generic material, and that's what we'll use. You can simply edit that material directly, but to keep things nicely organized I pointed to a material I already made, called p51_texture. The material is fairly simple and the screenshot is self-explanatory.

Note the glossmap part. By adjusting the Specular Level and Glossiness values I was able to give the plane a shiny look but I don't think that glossmap had any effect on the position and strength of the effect. Either I'm not using the right material property, or I'm missing something more.
Exporting
The export dialog is fairly simple.
Convert - uncheck Cameras and Lights, we don't need those.
Textures - select Original Images, that way the nif file simply uses a reference to the texture, and you can modify the image without touching the model, just like regular skinning.
Process Script - I find that the default script always works, the Stripped/NotStripped options refer to, I believe, the way model is handled by the engine (strip of triangles or a list). Once again, as long as the default one works there's no need to touch these.
File Export Script - you should use the default script if you're not exporting any animations. Personally I was unable to create animations that the exporter recognized and always ended up getting an error when trying to export them.
Leave rest of the options on default.
The only errors I got when exporting were when I tried to export animations. If you're exporting a static model using default script and having errors, I'm sorry but I can't help you with that.
Using the model in Civ 4
If everything went well then you should be able to use the nif file you just created in the game. The only thing of note here is that in the CIV4ArtDefines_Unit.xml file you will need to modify two entries, NIF and SHADERNIF, like so:
It appears that some people were able to get away with modifying only the NIF entry, but that hasn't been my case.
Using the model this way will give you static unit in Civ 4 with non-complete sounds, and no team colors (I couldn't figure out how to fix this). However, it will (well, should) work fine in every other way.
If you wish to add limited sounds, effects and animations to the model keep reading, but a friendly warning: from here on it gets more technical, complicated and in general less pleasant.
![Civ4 [civ4] [civ4]](/images/smilies/civ4.gif)
Please keep in mind, that like everyone else I am just starting to explore the possibilities, and doing it pretty much blindfolded, so there might be some errors or omissions, and this is definitely not the "Complete Guide to Creating New Models for Civilization IV"

UPDATE: Well the documentation for properly exporting models have been released. I recommend reading it first since it has a lot of useful information and especially directions for how to properly set up a model for export. Having said that, I don't think it makes this tutorial obsolete, it all depends on what exactly you want to do.
On to the tutorial...
What you will need
You will need to have 3D Studio MAX 6 or 7, there is a 30-day demo available.
You will need the Civ4 plugins, for 3ds max 6, or 3ds max 7. To install the plugin, simply unzip the contents of the file into the 3ds max installation folder.
You will need the NIF viewer. It comes with the plugin, it's the SceneViewer.exe file, also note the BoundShape.nif and BoundShape.tga files that come in the zip as well - you will, you guessed it, need them

In order to use the NIF viewer you might need the mfc71.dll file, you can get it here, instructions on how to install it are in the zip.
Finally, you will need some luck

Preparing the model for export
I will use my P-51 model throughout this tutorial, and will occasionally reference the F-15 model, both are found in my sig.
I'm also assuming basic knowledge of 3ds max.
While Civ 4 can display very high-poly models it is recommended you stick to models with about 800-1000 triangles for multi-model units (e.g. most land units), and no more than 2000 triangles for single-model units (e.g. air/naval units). In general though, consider the scale of the units and don't use more detail than needed. For example the F-15 model I used is 1045 polygons, while the P-51 model is ~1400 polygons, and I don't see a reason to add any more detail, in fact I could cut another 200-250 polygons from the P-51 and most people will not notice it.
When creating models for Civ4, it's best to use the specific material made for it, called CivilizationIV XPLatform Material. Although I was able to export models just fine by using the default material, if there's one specifically designed for it, why not use it.

Said material allows you to choose between Next-gen XBox material (we don't need that), and PC/Generic material, and that's what we'll use. You can simply edit that material directly, but to keep things nicely organized I pointed to a material I already made, called p51_texture. The material is fairly simple and the screenshot is self-explanatory.

Note the glossmap part. By adjusting the Specular Level and Glossiness values I was able to give the plane a shiny look but I don't think that glossmap had any effect on the position and strength of the effect. Either I'm not using the right material property, or I'm missing something more.
Exporting
The export dialog is fairly simple.

Convert - uncheck Cameras and Lights, we don't need those.
Textures - select Original Images, that way the nif file simply uses a reference to the texture, and you can modify the image without touching the model, just like regular skinning.
Process Script - I find that the default script always works, the Stripped/NotStripped options refer to, I believe, the way model is handled by the engine (strip of triangles or a list). Once again, as long as the default one works there's no need to touch these.
File Export Script - you should use the default script if you're not exporting any animations. Personally I was unable to create animations that the exporter recognized and always ended up getting an error when trying to export them.
Leave rest of the options on default.
The only errors I got when exporting were when I tried to export animations. If you're exporting a static model using default script and having errors, I'm sorry but I can't help you with that.
Using the model in Civ 4
If everything went well then you should be able to use the nif file you just created in the game. The only thing of note here is that in the CIV4ArtDefines_Unit.xml file you will need to modify two entries, NIF and SHADERNIF, like so:
Code:
<UnitArtInfo>
<Type>ART_DEF_UNIT_P51</Type>
<fScale>0.5</fScale>
<fInterfaceScale>1.0</fInterfaceScale>
<NIF>Art/Units/p51mustang/p51mustang.nif</NIF>
<KFM>Art/Units/Fighter/Fighter.kfm</KFM>
<SHADERNIF>Art/Units/p51mustang/p51mustang.nif</SHADERNIF>
<ShadowDef>
<ShadowNIF>Art/Units/01_UnitShadows/FighterShadow.nif</ShadowNIF>
<ShadowAttachNode>BIP Pelvis</ShadowAttachNode>
<fShadowScale>0.75</fShadowScale>
</ShadowDef>
<iDamageStates>4</iDamageStates>
<fBattleDistance>0.35</fBattleDistance>
<fRangedDeathTime>0.31</fRangedDeathTime>
<bSmoothMove>1</bSmoothMove>
<bActAsRanged>0</bActAsRanged>
<TrainSound>AS2D_UNIT_BUILD_UNIT</TrainSound>
<AudioRunSounds>
<AudioRunTypeLoop/>
<AudioRunTypeEnd/>
</AudioRunSounds>
<PatrolSound>AS3D_UN_FIGHTER_PATROL</PatrolSound>
<SelectionSound>AS3D_UN_FIGHTER_COMMAND_PATROL</SelectionSound>
<ActionSound>AS3D_UN_FIGHTER_COMMAND_PATROL</ActionSound>
</UnitArtInfo>
Using the model this way will give you static unit in Civ 4 with non-complete sounds, and no team colors (I couldn't figure out how to fix this). However, it will (well, should) work fine in every other way.
If you wish to add limited sounds, effects and animations to the model keep reading, but a friendly warning: from here on it gets more technical, complicated and in general less pleasant.
