Tutorial for creation of shaded Leaderheads

Ploeperpengel

academic precarity
Joined
Feb 2, 2006
Messages
4,748
Location
Berlin
In FFH most models get produced with Blender but some abilities like making shaded models is currently only doable with expensive programs like 3Ds max. In the FFH team I often get nice models from C.Roland who is blendering solely and do some minor tweaks in in order to have a product that fully uses the abilities of civs graphics engine. For this tutorial I got such a model that was created in Blender. For how to see C.Rolands nice tutorial "HOW TO import/modify export Leaderheads"
http://forums.civfanatics.com/showthread.php?t=183742

This tutorial should explain about everything

However to create a shadermodel you'll need 3Ds max and the niftools plugin:
http://sourceforge.net/project/showfiles.php?group_id=149157&package_id=195073

Make sure you also got the texporterplugin:
http://www.cuneytozdas.com/software/3dsmax/

For the second part of the tutorial you will also need Nifscope:
http://sourceforge.net/project/showfiles.php?group_id=149157&package_id=170735



Step 1:


Import the model.



I usually uncheck the autosmooth mesh option because this sometimes get weird. We will apply a smoothmodifier to the model later again.



As you notice the model's bones are displaced. Unfortunatly the importscripts don't work reliable but that's nothing we have to worry about now. We only care about the mesh itself now and fix our export with nifscope later.

EDIT: Of course you don't need to create a model in Blender and import it. It's possible to create entirely new models in Max and get them into the game as described here(or any other program that can export to fileformats that can be imported in Max). In this case you'll have to make sure it has the same bonestructure as vanilla LHs or you will have to create your own animations. Check the appendix for animationsettings. Basically all you need from vanilla models (as long no Leaderhead SDK gets released) is the camera and the lights which you attach to the nif with nifscope.

Step 2:


Press "m" to open the material editor. Select the pipette(pick material from object) and press "h" to choose the mesh. Rename the Material to something meaningfull so you don't get cofused in the process.



Switch to the next material box and select the next mesh. Do this repeatly until you got a material assigned to all meshes. The last two meshes (here Teeth lower and Teeth upper use the same material so just pick teeth lower selct teeth upper and assign material to selection-third button from the left in the material editor).



Now we have 4 materials in the editor. You'll see they show all white - this is again a problem of our importscripts which fail to import the material settings.


Step 3:


We start setting up the first material. First thing I allways do is change the emissive color to black so the meshes can actually produce good render results in max and we can see what the model roughly will look like.



Dido is based upon Isabella so what we should do is check the material of the original model via nifsceneviewer (how to use that program is detailed in Rabbit Whites tutorials found on this forum). The nifviewer can tell us exactly how we need to set up the material if we want to stay true to the original (we still might change some settings to our liking though depending on what we want).

Doubleclick the editable poly beneath the ninode "isabella_eyes". The nifviewer shows the type of Shader we're going to apply in the geometrie rollout. Open up Niproperties and doubleclick NiAlphaproperty.



Now apply those settings to our Eyesmaterial: switch on alpha testing, no sorter, testmode greater go down to custom shader select TLeaderheadshader_20 and hit apply. Btw I have no idea what that stuff about the alphasettings really is about but experience tells us it's better to do what Firaxis does.



Also you might have noticed there isnt a stencil property so you might uncheck vertexcolors as well(again no idea what that is about but I had problems with vertex colors earlier- the model showed entirely black- so I usuall tend to switch them off).

Now doubleclick NiTexturingProperty in Nifviewer to learn what maps we use on this material. In max below the Shader opened another Rollout "TLeaderHeadShader_20 custom attributes".



Select "NormalMap" and choose "Bitmap", go to the path where you stored the dds files and select isabella_norm.dds, for SpecularIntensity select isabella_spec.dds, for EnvironmentIntensity select isabella_env_msk.dds and for the last spot isabella_eyes_env.dds - note the sequence is in another order in the nifviewer. Whatever there is to read about Shader Map 0 - 3 the order you apply maps in max should allways be:

_Norm
_Spec
_ENV_MASK
_ENV



Do the same now for the other meshes checking every time the refering editable mesh/poly in the sceneviewer for maptypes and materialsettings.

Optional:
If you want to use specularmaps to have some reflection on Leaderheadmeshes - Isabella only uses specularmaps for her jewelry but most vanilla LHs have a specular light a little above 200(color) with a shininess of a little above 90(95 mostly) - you got to alter the settings shown below:




Step 4:


If the material is set up we apply a smoothmodifier to each of the meshes else the model will look like a work of picasso after export.(should be covered in sharicks tutorials somewhere already this point)


Step 5:


Export and use Nifscope to complete the rest. Remember to hide the bones! Don't worry about the LH export showing all black in the nifviewer now. That's because we don't have lights in our scene yet and of course we changed the emissive color to black once we get lights from other firaxian LH files in this will also display in the sceneviewer.
Now it will get complicated if you want to follow the procedure of making the maxexport work and polish it for the game you can download the exported model as attachment(you can use vanilla textures of isabella for it);)

EDIT: It's allways a good idea to apply some animation even if you want to stick to vanilla animations(check appendix below post 3 for animationsettings) just in order to create a non-accum node. Just assign a couple of animationkeys and define an animationsequence, then export nif and single kf. It's not needed since you can fix this with nifscope but just might be less grunt work later.

C.R. it's your turn:p
 

Attachments

  • Dido.zip
    281.4 KB · Views: 289
When you have your freshly exported leader, the next step is quite simple. In fact, it’s the same process that you may have used to have your noshader LH in this tutorial.

You only need to do in Nifskope the steps explained in the Import/Modify/Export LH tutorial, but with the vanilla shaded leader and your modified shaded leader instead of the no shaded one.

Here a brief recapitulation.

1. Open you modified shaded LH
2. File/New Window
3. In your new window, open the vanilla shaded LH
4. Right Click on your modified leader (In the block list : Block/Copy Branch)
5. Paste Branch in your new window (the one with the vanilla leader in)
6. Replace the children of the NiNode, change the vanilla NiTriShape for your modifien NiTrishape (On the screenshot, I have to change the child 331 to 334)
7. Remove the vanilla leader, right click on it ( In the block list : Block/Remove Branch)
8. Do a translation to your modified mesh to be sure that the eyes, the teeth, etc. are at the right place
9. Check if all the textures are linked correctly. Normaly, it should be fine if you have linked them correctly in Max
10. Import it in game and have fun …

Here a little comparison between the vanilla Isabella and our brand new Carthaginian queen. I made this model pretty quickly because I do not have a lot of free time and I know the community was impatient to know how to do this, so the model still look like the original, but it’s possible with this technique to create something that look as good as the vanilla LH but really different from the base model.



Because I have changed some of his cloth to skin, the shading makes a clear edge on his skin near his left shoulder. It something that I may fix before I release this LH, but as I already said, this Dido LH was made quickly for the purpose of this tutorial, so I didn’t take the time to fix it before the writing of this tutorial.
 
Appendix

If you want to create custom animations here's a list of eventcodes that will work with the animationscriptpart of the Maxplugins:

_greeting_ec0
_friendly_ec1(loop)
_pleased_ec2(loop)
_cautious_ec3(loop)
_annoyed_ec4(loop)
_furious_ec5(loop)
_negativ_ec6
_affirmative_ec7
 
well so far, it was quite easy to follow, I mean if you want someone to produce something like this with max, then he should be capable of following these easy things like materials and maps...
I think the complicated part is still to follow. Its what I get mad about every time I have to work with something else than Melee Units... its the damn unclean export which has to be fixed by improvisation.

great tutorial :goodjob:
 
Sorry Ploper and all, I didn't find the time to do it. It's the fault of my job (and I have to admit that I just played tennis instead ... :blush: )

I'll try to do it this weekend, sorry again ...
 
edited,.... whatever
great tutorials ;)
 
Edit: whatever.
 
edited,.... whatever
great tutorials ;)

I'm curious to know what this post was :p ...

EDIT : Well, I saw it ... when this thread will move to public forum, they will all know why we all have over 1000 posts ...
 
Check out Important news.
 
Good job, guys :goodjob:

Next step should be "How to create-new or edit-existing .KF animations" :)

I spent a lot of time testing different animations for each LHs. Sometimes they worked fine but most of time they worked wrong. I haven't 3dmax and Nifscope didn't help me :sad:

I hope this tutorial will bring us as many as new LHs soon, but we also need an easy guide to switching, shuffling, edit or create KF animation files :D
 
Good job, guys :goodjob:

Next step should be "How to create-new or edit-existing .KF animations" :)

I spent a lot of time testing different animations for each LHs. Sometimes they worked fine but most of time they worked wrong. I haven't 3dmax and Nifscope didn't help me :sad:

I hope this tutorial will bring us as many as new LHs soon, but we also need an easy guide to switching, shuffling, edit or create KF animation files :D

If you want to see what can be done, all the Final Frontier and FFH : Age of Ice LH are made by me with the help of Ploper using this method.
 
Good job, guys :goodjob:

Next step should be "How to create-new or edit-existing .KF animations" :)

I spent a lot of time testing different animations for each LHs. Sometimes they worked fine but most of time they worked wrong. I haven't 3dmax and Nifscope didn't help me :sad:

I hope this tutorial will bring us as many as new LHs soon, but we also need an easy guide to switching, shuffling, edit or create KF animation files :D

I updated the 3rd post with the eventcodes that are supposed to work with custom leaderanimations. Else than those eventcodes there's no difference to animating a unit which is explained in Firaxis' and sharicks 3D max tutorials.
 
Appendix

If you want to create custom animations here's a list of eventcodes that will work with the animationscriptpart of the Maxplugins:

_greeting_ec0
_friendly_ec1(loop)
_pleased_ec2(loop)
_cautious_ec3(loop)
_annoyed_ec4(loop)
_furious_ec5(loop)
_negativ_ec6
_affirmative_ec7


Hi everybody,

I'm currently busy creating a custom leaderhead, and my big problem is that I'm using 3ds max 9, which can't use the Civ IV MaxTools plugin.

My leaderhead is almost ready but I don't know how to apply those eventcodes which Ploeperpengel mentioned above. I mean, it's just code, right? Is it possible then to copy/paste it from an existing leaderhead and then import it to a maxskript in max 9?
 
Sorry can't help with this. 3D max 9 is currently not supported by firaxis scripts and I doubt you will be able to make custom animations work unless you make those scripts work with the latest maxversion. If you can export your model to nif format with niftools you might get lucky using vanilla animations if you nifedit your model unto a vanilla leaderhead with nifscope though.
 
Ok, I now have 3ds max 8 demo installed, with niftools and MaxTools plugins.

There are several things which I haven't fully understood so far. E.g., the "Getting your units into Civilization 4" tutorial mentions a Animation Flow Chart with different "animation sequences".

Now what exactly are those "animation sequences"? Is each a.s. a different max file for its own, and put together later? Or is an a.s. just a special segment in the animation time line? I always thought it was the second one, but how do you make it clear to the time line where one sequence ends and where the next one begins, so that later you can refer to the different sequences in the MAXScript?
 
Top Bottom