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

Add a new building and improvement with 3D model

Discussion in 'Civ5 - Graphics modpacks' started by danrell, Oct 8, 2012.

  1. danrell

    danrell Warlord

    Joined:
    Jan 5, 2007
    Messages:
    291
    Location:
    Hong Kong
    Request by Ekmek



    Civ5 Test Improvement - Airfield
    Download
    --------------------------------------------------------------------------------------------------------------------------



    Civ5 Test Wonder - Temple of Heaven
    Download
    --------------------------------------------------------------------------------------------------------------------------
    I will try to write the tutorial to explain how to add the 3D model with my bad english... :(
     
     
  2. danrell

    danrell Warlord

    Joined:
    Jan 5, 2007
    Messages:
    291
    Location:
    Hong Kong
    Ok, I write the tutorial, please don't mind my bad english...

    Frist, you need some tools and some blender's skill, then download the Civ5 3DModel Edit Toolpacks and install in this order :

    01. Python 2.6.6
    02. PyFFI 2.1.9
    03. Blender 2.49b
    04. Blender NIF Scripts 2.5.7.12
    05. Blender Scripts PY Files
    06. Indie Stone Nexus Buddy 0.5a
    07. IndieStoneMaterialMaker
    08. NifSkope 1.0.22
    09. Gr2 Viewer 2.8.44.0
    10. Adobe Photoshop DDS Plugin / another edit DDS program

    *1-7 indispensable

    Civ5 3DModel Edit Toolpacks
    --- Part1 ---
    --- Part2 ---
    --- Part3 ---
    --- Part4 ---
    --- Part5 ---
    --- Part6 ---
     
     
     

    Attached Files:

  3. danrell

    danrell Warlord

    Joined:
    Jan 5, 2007
    Messages:
    291
    Location:
    Hong Kong
    Now download the "Civ5 Test Improvement - Airfield" and "Civ5 Test Wonder - Temple of Heaven", unpack and put it into :
    C:\Program Files (x86)\Steam\steamapps\common\sid meier's civilization v\Assets\DLC\Expansion\DLC\Expansion <------ add a new folder, must not be wrong

    you can open the game and test it (not in mod), I set the prereq tech is AGRICULTURE, so you can test it when in turn 1.

    1) 3D Model
    Let me edit it, go to
    C:\Program Files (x86)\Steam\steamapps\common\sid meier's civilization v\Assets\DLC\Expansion\DLC\Expansion\Test_Improvement\Airfield_Model
    there are 2 era and 3 state improvements, 6 models, you need understand what is HB, PL, it's the name used of the 3D model's states
    UnderConstruction=HB
    Constructed=n\a
    Pillaged=PL

    Use these for template, create\convert a new model to replace it, for the example, I used the Factory.nif in attach files.

    Open the Factory.nif with Nifskope, then export to .obj file


    open the Airfield_Era1.blend and import the .obj file


    make the proper position and scale it, like this


    add the texture


    then right click the airport and delete it


    export to .FBX


    export setting


    Open Indie Stone Nexus Buddy 0.5a and import the .FBX file
    press the add, chosse BuildingShader



    following the next pic then press save gr2


    change the name to "Factory_Era1" after save, we can open the Factory_Era1.gr2 with the gr2 viewer


    find the "Airfield_Era1.fxsxml" rename it to "Factory_Era1.fxsxml" then open it with notes
    and change this :
    <Mesh file="Airfield_Era1.gr2" source="Max" /> ---> Factory_Era1.gr2

    It's a simply and a quick way, you also can add the landmark, etc...
    Now you can create the Factory_HB, Factory_PL, Era1, Era2, Era3..... and different angles, different art types, different civ types... This easier than make a unit.
    I created 6 factories's model for next part, Era1_HB, Era1, Era1_PL, Era2_HB, Era2, Era2_PL.
    (The wonder's step is same of the improvement.)

    2) XML
    I modified 5 XML files for improvement \ 3 XML files for Wonder,
    you can use another way (SQL?) when you understand what I change.

    improvement changed :
    Civ5ArtDefines_Landmarks_Expansion.xml
    Civ5ArtDefines_LandmarkTypes_Expansion.xml
    CIV5Builds_Expansion.xml
    CIV5Improvements_Expansion.xml
    CIV5Units.xml

    Wonder changed :
    Civ5ArtDefines_Expansion_Wonders.xml
    CIVBuildingClasses_Expansion.xml
    CIV5Buildings_Expansion.xml

    Open the files and search "test" , you can see what I changed.
    In this case, you need change all "Airfield" to "Factory".

    Explain some xml, open my Civ5ArtDefines_Landmarks_Expansion.xml

    <LandmarkArtInfo>
    <ImprovementType>ART_DEF_IMPROVEMENT_AIRFIELD</ImprovementType>
    <ResourceType>ART_DEF_RESOURCE_ALL</ResourceType>
    <Era>Ancient</Era>controlled the Era
    <State>UnderConstruction</State>This controlled the States, 3 types and "any", so we can make 3 models to use this, but the wonder haven't this tag so I can't make the wonder have "under construction" states.
    <fScale>1.0</fScale>
    <FXSXML>Airfield_Era1_HB.fxsxml</FXSXML>This your 3D model name
    <LayoutHandler>SNAPSHOT</LayoutHandler>There will be appear different types if set "RANDOM" e.g. BARBARIAN_CAMP, you can make different angles, different art types to use that.
    <bTerrainContour>False</bTerrainContour>
    </LandmarkArtInfo>

    open my Civ5ArtDefines_Expansion_Wonders.xml

    <WonderArtInfo>
    <Type>TEMPLE OF HEAVEN</Type>
    <WonderArtState state="Any">
    <fScale>0.05</fScale>
    <Granny>Temple_Of_Heaven.fxsxml</Granny>
    </WonderArtState>
    </WonderArtInfo>
    It's very simply, only scale and the filename, I tried change the state="Any">, but nothing to change, so I think the wonder's state maybe controlled in 3D model...

    I don't know whether to be detailed enough, if someone known more, welcome to completion it, thank you :)
    &#12288;
    &#12288;
     

    Attached Files:

  4. xxhe

    xxhe Prince

    Joined:
    Mar 10, 2008
    Messages:
    361
    Location:
    IN.
    Unbelievable! Awesome! Really looking forward to the tutorial
     
  5. Horem

    Horem Emperor

    Joined:
    Apr 1, 2010
    Messages:
    1,720
    Location:
    Wales, UK
    ^^ This.
     
  6. Ekmek

    Ekmek on steam: ekmek_e

    Joined:
    Aug 7, 2002
    Messages:
    6,047
    Location:
    San Diego, California
    SWEET we finally cracked the code!!!!!!!!!!!


    MANY MANY Thanks to you danrell for figuring this out!
     
  7. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,150
    Location:
    France
    now Civ5 modding can take off :goodjob:
     
  8. Pazyryk

    Pazyryk Deity

    Joined:
    Jun 13, 2008
    Messages:
    3,584
    Yes!!!

    One thing I want to do in my mod is to use some existing wonder art as plot improvements. It works except the "under construction"/"constructed" states are all messed up. I hope your tutorial will help me understand the states a little better.
     
  9. danrell

    danrell Warlord

    Joined:
    Jan 5, 2007
    Messages:
    291
    Location:
    Hong Kong
    The improvements's "under construction"/"constructed" states are controlled in XML.
    But the wonder's state is controlled in 3D model :confused:("under construction"/"constructed" states are in the same 3D model). I can't make the wonder have "under construction" states at this moment because I can't import the original .gr2 files.
     
  10. Pazyryk

    Pazyryk Deity

    Joined:
    Jun 13, 2008
    Messages:
    3,584
    Thanks. So if I understand correctly, they can't be converted but have to be "made from scratch".
     
  11. isnorden

    isnorden Amnesiac Modder

    Joined:
    Jul 6, 2012
    Messages:
    608
    Location:
    Madison, Wisconsin, USA
    Looks like the first steps I had wanted to take: I can't do original 3D/animated work to save my life, although I've wanted to "mod in" several structures that don't fit the existing artdefines. Here's hoping your tutorial becomes avaiable soon. and that a graphics-newbie on a tight budget can use it reasonably well!
     
  12. Ekmek

    Ekmek on steam: ekmek_e

    Joined:
    Aug 7, 2002
    Messages:
    6,047
    Location:
    San Diego, California
    when I looked at it a long long time ago it looked like the models were on top of each other but they had bones and somehow the animation turned one off when it needed to.
     
  13. Pazyryk

    Pazyryk Deity

    Joined:
    Jun 13, 2008
    Messages:
    3,584
    So perhaps an expert could "dissect' the existing art asset and rebuild as an improvement? If I wasn't busy coding Lua (and soon C++) I'd try to learn this 3D art stuff.
     
  14. Ekmek

    Ekmek on steam: ekmek_e

    Joined:
    Aug 7, 2002
    Messages:
    6,047
    Location:
    San Diego, California
    Its fairly easy to extract the models from grany viewer. But I'd have to see if the textures aren't encrypted.

    Which Wonders are you looking at adding?
     
  15. Pazyryk

    Pazyryk Deity

    Joined:
    Jun 13, 2008
    Messages:
    3,584
    Eventually I'll use almost all of the pre-Industrial ones for my Éa mod. If I had to prioritize a few I'd say Stonehenge, Oracle and Mausoleum of Halicarnassus.
     
  16. Ekmek

    Ekmek on steam: ekmek_e

    Joined:
    Aug 7, 2002
    Messages:
    6,047
    Location:
    San Diego, California
    Ok, and I'll do the windmill too. But I'm hoping danrell gets the rest of the tut out soon.
     
  17. Gedemon

    Gedemon Modder Moderator

    Joined:
    Oct 4, 2004
    Messages:
    9,150
    Location:
    France
    Moderator Action: Thread made sticky here, as it is both a tutorial and a graphics pack.
     
  18. danrell

    danrell Warlord

    Joined:
    Jan 5, 2007
    Messages:
    291
    Location:
    Hong Kong
    OK, I updated it...
     
  19. Ekmek

    Ekmek on steam: ekmek_e

    Joined:
    Aug 7, 2002
    Messages:
    6,047
    Location:
    San Diego, California
    Is it obj file or FBX? I didn't see obj mentioed before

    Also the pictures aren't showing. I particularly need the one for building shader. I don't recall the option before :/
     
  20. danrell

    danrell Warlord

    Joined:
    Jan 5, 2007
    Messages:
    291
    Location:
    Hong Kong
    fbx, sry, reupload the pics.
     

Share This Page