1. We have added a Gift Upgrades feature that allows you to gift an account upgrade to another member, just in time for the holiday season. You can see the gift option when going to the Account Upgrades screen, or on any user profile screen.
    Dismiss Notice

[Tutorial] Damage States for Custom Units with 3DS MAX

Discussion in 'Civ4 - Modding Tutorials & Reference' started by Refar, Aug 29, 2007.

  1. Refar

    Refar Deity

    Joined:
    Apr 10, 2005
    Messages:
    4,608
    The tutorial about damage states for custom CivIV units. Since this subject seems not to be covered here in the forums, i decided to explore it.

    It covers:
    - Applying damage texture and animating its UV coordinates
    - Adding ATTACHABLES (for smoke, sparks and other effects)
    - Damaging geometry (only as side note)
    - Taging DS animations for export
    - The Event Codes needed.

    The information is missing in Shariks excellent "Complete Guide to Creating Units in 3ds Max" and was puzzled together using the "Getting your units in Civilization IV" guide, the Tank example files, and the CivIV stock units damage animation files.

    Now when i know how, it is rather easy, and i believe i managed to make the important steps clear. But i do not cover any basics, so before reading this, you should be familiar with the general process of creating, animating and exporting custom units for civ4.

    Damage States Tutorial as PDF
     
  2. woodelf

    woodelf Bard Retired Moderator

    Joined:
    Jun 12, 2003
    Messages:
    15,036
    Location:
    Gallery
    Thanks! A very nice job. To the Index it goes!
     
  3. Civmansam

    Civmansam King

    Joined:
    Jan 15, 2006
    Messages:
    909
    Looks good! :thumbsup:
     
  4. asioasioasio

    asioasioasio Fallout Scrubber

    Joined:
    Mar 4, 2006
    Messages:
    3,058
    Location:
    Poland, EU
    Awesome!:D :goodjob: :woohoo:
    I love 3DS Tutorials for Civ4 :) - i tried to make damage states but it didn't worked in game - now i know why :) Seems pritty dificult, but with yours tutorial i would be able to work it out :)

    I also tried to make own units with gloss and teamcolour but i found two problems depending on the method:
    - if i have stack of units my second,third, etc. are red in places where shoould be teamcoloured - i used setup like in sharicks screenshots (or firaxis pretorian or chokonu have). - probably it's fault of this teamcolour.bmp
    - using tank as my base for texture (it doesn't contain teamcolour.bmp) i noticed that my unit is dissapearing for the moment - the team colour works fine, the glow shines, but units fade in and fade out like plane :(

    Could you give me a hint in this matter or even expand tutorial - it would be great :mischief:
     
  5. Refar

    Refar Deity

    Joined:
    Apr 10, 2005
    Messages:
    4,608
    Happy to hear that :D And i am hoping to see more damaged units soon :D

    If you have any question, or something is not presented in a clean manner in the tutorial, just ask, i will try to explain better.

    I had similar problems underway, not exactly the same however. I strongly suspect, that this is caused, by incomplete assignment of animation sequences (E.g. the unit changes to a wrong state/animation loop, because a needed sequence is missed/misreferenced)

    I did not actually pinpointed the cause, but all this went away, as soon as the animation set was complete.

    At least i hope it went away - have you tried my Akula Sub ? I not have any problems with it, but who know's graphicals problems tend to be Hardware/Driver dependant on occasions.

    I made a reference sheet regarding the settings for FX and non-FX material both having team color. I might extend the tutorial later, after i got more exprience (i.e. more people tested my units and not had any problems, so i can be sure the stuff does actually always work as expected).

    What i do is basycly this:

    1) Make a NonShader Version of the material first.
    Use the settings in the reference sheet below.
    TCiv4MechNonShader with only the
    Detail (Main Texture) Map and the
    Decal (Damage) Map.

    Dont forget to click "Apply" after changing the custom shader.

    If you are not doing damage, use a map having all black alpha chanel for decal. Or try putting your Main Texture in the Decall slot instead of Detail, like it is done in Praetorina/Chukonu.
    Leaving the Decal slot empty with Mechanic Units (i.e. Units that have damage states) allways caused some kind of weird problem for me.

    2) Drag&Drop your maps in separate Meterial Editor slots and choose "Instance".

    3) Do all the animating, tweaking, damage and export the NonShader version first. It will have team color, wich you will see in NifViewer as blue areas on the model.

    If everything went right you can move on to the FX version.

    4) Make a new Civ4 material.
    Choose TCiv4MechShaderGloss as custom shader, then click Apply. Make sure Viewer and Export Technique are set to "Best Avaiable for Hardware"

    5) Drag and drop your Detail and Decal maps to the according slots, and Choose "Instance" (it is important you use actually the same map, not just a copy, since you have animated it for damage.)

    6) Add a Gloss and a Glow map, if you have them. If using Civ4's "Enviroment_FX_Whatever.dds" you need a copy of it in your working folder for export, but you not need to deliver it with your unit - it comes from the shared art folder.

    Assign the new material to your model and export the FX version.

    If you want to deliver both the Normal and the FX version with your unit, Export the NonFX first, copy the nif and the animations into another folder, then export the FX version using the same name. (This, to prevent the animations to be referenced to a renamed version...). Now rename the .nif to _FX.nif and add it to the folder, where you already have put the non FX nif and the animations. This way both the FX and the normal Nif will use the same animations.

    This should do it, at least it does for me.

    The only open qeustions i have for now, are about non mechanical units. Those i did not figured out yet. (I suspect, that we could just export them using the same settings like with mechanical ones, but i did not tired it out yet)

    And here are the settings i used for materials at one glance.
     
  6. asioasioasio

    asioasioasio Fallout Scrubber

    Joined:
    Mar 4, 2006
    Messages:
    3,058
    Location:
    Poland, EU
    Thjank you this is very helpfull - watching the screenshots and reading your text i know what i might doing wrong - hopefully it'll be ok now - this weekend will be test :)

    I just don't understand this operation
    All my materials are rounded - balls what i should make to make the way you've made - as separate maps - decal, detail, gloss and glow connected to just one ball (in fact two balls one with nonshader and second with shader)?

    Yup this dissapearing might be caused by animations - tough a little bit weird cause i used standard tank animation that firaxis gave.

    And thx for help and explanation :)
     
  7. Refar

    Refar Deity

    Joined:
    Apr 10, 2005
    Messages:
    4,608
    Material Editors slots can display maps as well as materials - maps will be displayed flat.

    If you have a material selected, put your mouse pointer over one of the maps - lats say Detail - now can click and hold the button pressed - now you can drag and drop you map to a empty meaterial editor slot, and release it there. A dialog will appear, asking if you want to copy (clone actually) the map, or make a instance (then changes to one of the instances, will affect the other instance as well). Instance is waht we want, if the same map will be used in multiple materials.
     
  8. asioasioasio

    asioasioasio Fallout Scrubber

    Joined:
    Mar 4, 2006
    Messages:
    3,058
    Location:
    Poland, EU
    OK Thank you :)
    I know how to this now :)
     
  9. Refar

    Refar Deity

    Joined:
    Apr 10, 2005
    Messages:
    4,608
    File Reuploaded...
     
  10. GeneralMatt

    GeneralMatt Emperor

    Joined:
    Jul 10, 2005
    Messages:
    1,980
    Location:
    Canada
    Oh perfect, thank you!
     

Share This Page