Page 1 of 2 12 LastLast
Results 1 to 20 of 26

Thread: The Uniform Tutorial

  1. #1
    Aanker's Avatar Concordant
    Join Date
    Apr 2009
    Location
    Sweden
    Posts
    7,072

    Default The Uniform Tutorial

    The Uniform Creation Tutorial


    This tutorial, created on request by a fellow TWC member, will feature the basic steps required to assign a uniform to a unit, to edit the uniform, and finally to edit the textures of the variant (uniform) parts.

    The tutorial will be broken down into four sections; it currently features the two first, but more are coming:

    I. Introduction (done)
    II. Giving a unit a uniform (done)
    III. Assigning parts to the uniform
    IV. Editing textures


    I. Introduction

    This tutorial will give a basic look on how to create properuniforms for units in N:TW. It requires basic knowledge on how to handle the PFM, how to create a unit (without a uniform), and, of course, how to handle an image editing program, such as GIMP.

    Required Tools
    For the sake of simplicity, I have below provided links to the various tools you will need. I am using GIMP, an open-source, free, and, most importantly, easy-to-handle image editor that does
    precisely what we want it to do.

    PFM 1.5.9 - this is a tool you should be familiar with, since it is absolutely necessary in almost every area of N:TW modding.
    http://www.twcenter.net/forums/showthread.php?t=346400

    Modmanager - a simple tool used for enabling and disabling .packs in your data folder, meaning that you won't have to constantly trot off to the scripts folder every time you want to test new .packs.
    http://www.twcenter.net/forums/showthread.php?t=344757

    GIMP - GIMP is an open-source, free, image editor. It's not as complete as Photoshop, but works fine when editing textures.
    http://www.gimp.org/

    GIMP .DDS Plugin - Fourth Part Only - .dds is the format used for N:TW and E:TW unit textures. This plugin (installation instructions provided with the download) will enable you to open .dds files in GIMP.
    http://code.google.com/p/gimp-dds/

    Photoshop nVidia .DDS Plugin - Fourth Part Only - as said above, .dds is a format that you will often work with while editing uniforms. This plugin will enable you to open .dds files in Photoshop.
    http://developer.nvidia.com/object/p...s_plugins.html


    II. Giving a Unit a Uniform
    In this step, we'll take a look at how to assign a uniform to a unit. This is the simplest part, and involves only a few, quick steps.

    1. Create a unit with the appropriate entries in the unit_stats_land, units, and units_to_exclusive_faction_permissions tables. In the latter, remember which faction(s) you assign the unit to, since this will become important later.
    Spoiler for Image



    Note how this .pack has been saved in the "mod" format. This is so that you can easily turn it on/off with Modmanager. The only .packs that require saving in the "movie" format are those that contain localization files, which is not the case with this .pack.

    2. Now it's time to retrieve the files we need: all the relevant .packs are found in

    C:\Program Files\Steam\SteamApps\common\napoleon total war\data

    First off, we need two DB tables that link our unit (my_inf in this case) to a uniform, and we also need a table that gives the uniform of our unit a colour theme. The uniforms table does the first. Extract the uniforms table to the directory of your mod .pack, along with the uniforms_to_faction_colours table.

    Spoiler for Image




    NOTE: the uniforms_to_faction_colours table isn't actually necessary when giving a uniform to a unit. Without it, the basic faction colours are simply loaded on top of the uniform.

    Secondly, we need to bring along a few .unit_variant files to base our unit on. The .unit_variant files specify which parts make up a uniform.

    They come in a range of varieties, including .musician.unit_variant (the musician's uniform), .officer.unit_variant (the officer's uniform), .soldier.unit_variant (the average soldier's uniform) and .standard_beared.unit_variant (the standard bearer's uniform). These files are openeable with PFM, give them a quick glance, and note how each directory (hats, legs, torsos, etc.) contains several rows - these are the variations within a unit - and each row has model, and texture, file path entries. For now, let's simply extract the variants we need for our unit: since it actually does have a standard bearer, a musician, some soldiers and an officer (adjustable in the unit_stats_land, although both of the latter are necessary), all four different .unit_variant types are needed.

    NOTE: try to extract .unit_variant files from the same unit (in the picture below, inf_line_british_foot, that is, the average British Foot Infantry). Unless you want to make things more complicated for yourself than necessary, do not extract .unit_variants with different prefixes (austria_inf_[...], britain_cav_[...], etc.), for reasons that will be explained later.

    Spoiler for Image




    3. We now have all the files we need extracted. It is thus time to add them to the mod .pack. Add all the files you extracted to your pack, so that it looks something like this:

    Spoiler for Image




    4. Now take a look at the uniforms_table. It should appear like this:

    Spoiler for Image




    The first column is the Uniform ID Reference. The entry here is only used within the DB tables, similar to how the Projectile ID Ref of the unit_stats_land table is used as a reference in the projectiles_table, and so forth. We will be using this entry later. The second column is the Faction ID. It specifies for which faction a certain .unit_variant file is loaded. Therefore, if we were to allow the my_inf unit for both the French and British, we could actually give it different uniforms depending on factions! This is how generic infantry for the various minor factions in vanilla N:TW all have so different uniforms, even though the unit is, in fact, the same.

    The third column (named 'uniform variant') is the link to the .unit_variant file itself, while the fourth column is the ID of the unit, in this case, it should be my_inf.

    For the sake of making the first stage of the tutorial simple, we'll go ahead and delete all entries except the one that links to the .unit_variant we imported into the .pack. In this example, that would be the Britain_Inf_Line_British_Foot (variant) / Inf_Line_British_Foot (unit) entry. We rename the unit ID to 'my_unit': our soldiers have now been linked to a uniform, namely that of the vanilla Foot infantry:

    Spoiler for Image




    5. Since we might not want the British Foot infantry to share the same uniform as our my_inf unit, we'll have to 'create' a new .unit_variant and link it to the my_inf unit in the uniforms table. Since we can't save in the .unit_variant format, the simplest way to go about this is to rename the existing, imported .unit_variant files to something new. Before we can do this, however, we need to take into consideration the way .unit_variant naming works.

    Spoiler for Image




    In the example, we've taken a look at...

    britain_inf_line_british_foot.soldier.unit_variant

    Only the text before the first 'dot' (bold) is used in the uniforms table, but it might still be a good idea to keep track on which type of .unit_variant you're actually editing (common soldiers all wearing drummer uniforms would look somewhat strange).

    'britain_' (blue) is in fact a prefix. It declares which atlas file the .unit_variant belongs to. We'll delve deeper into atlas files later, but for now, the most important thing to know is that every .unit_variant file needs an appropriate such atlas prefix. Check the uniforms table for these; and note how the atlas files are named after which faction they belong to (france_, austria_, and so forth).

    Surprisingly, 'Inf_' (red) is also a prefix. It denotes the type of unit involved, ranging from Art_, to Cav_ and Inf_. Failing to include this prefix will make the game load the weapon and equipment atlas instead, turning your infantry into a texture mayhem.

    'line_british_foot' (green) is the 'real' name of the .unit_variant, and may be edited into whatever suits you best.

    In this case, I've named the .unit_variant files to britain_inf_my_inf[...], keeping the current atlas and unit type prefixes. Note how you also have to edit the uniforms table's link to the .unit_variant file:

    Spoiler for Image




    Renamed, and link edited.

    NOTE: Between steps 4-5 I decided to capitalize the initial letters in the name of the unit (from my_inf to My_Inf). As long as all entries are the same in this respect (so that the unit name is spelled exactly the same way in unit_stats_land as in the uniforms table), capitalization of initial letters does not matter.

    6. If we want to give the uniform some new colours, we need to give it another Uniform ID. Simply change the uniforms table's Uniform ID Ref to something appropriate, prefertably to the same name as the Uniform Variant entry (Britain_inf_my_inf), like below:

    Spoiler for Image




    7. Now off to the uniform_to_faction_colours table:

    Spoiler for Image




    The uniform_to_faction_colours table defines the colours of a unit's main, leg, and detail uniform colour, in the RGB format. The first set of colour values (R1, G1, B1) is for the main colour, the second set (R2, G2, B2) is for the leg colour, and, finally, the third set (R3, G3, B3) determines the detail colour.

    The first column of the table is actually misnamed - the PFM says 'Unit ID' - in fact, it's the Uniform ID Ref, linking a uniform to its colours.

    The second column determines for which faction a specific set of colours are loaded: similar to how the uniforms table worked, this means that we can give a unit different uniform colours depending on which country it is recruited from, while keeping the uniform itself (hats, legs, torsos etc.).

    Rename an entry of choice in the first column of the table to the same Uniform ID Ref that you used in the uniforms table, and delete the rest of the rows, like below:

    Spoiler for Image




    8. Since it's hard to know exactly which RGB combinations correspond to a specific colour, the best option is often to start up GIMP, and open the colour selection panel. You do this by left-clicking the palette (Photoshop works similarily).

    Spoiler for Image




    The values you are looking for appear to the right of the colour selection field. This makes it relatively easy to pick a colour that looks good (in this case silly) and get the proper values for it. Note, however, that map lighting in N:TW can make colours look very odd, this is especially the case with Grassy Flatlands, and other, darker, maps. Homestead is a well-lit map suitable for colour testing.

    9. Enter the colour values you retrieved from your image editor, I chose some odd (but noticeable) colours.

    Spoiler for Image




    10. Finally, save the .pack, and copy it into your data folder. Run Modmanager, tick your mod file (here named tutorial.pack), move it up above any other mod files with the arrows to the right, and launch.

    Spoiler for Image




    The result we recieve:



    The first two parts of this tutorial are now over. I'll continue working on the third and fourth parts, but for now, please feel free to point out any fallacies that I may have made here, and ask questions if there's something you don't understand.

    Thank You,
    Aanker

    Also, below is the first .pack (inside the .zip) attached, for your viewing pleasure:
    Last edited by Aanker; February 24, 2011 at 01:34 PM.

    Quote Originally Posted by Adar View Post
    Russia have managed to weaponize the loneliest and saddest people on the internet by providing them with (sometimes barechested) father figures whom they can adhere to in order to justify their hatred for the current establishment and the society that rejects them.

    UNDER THE PROUD PATRONAGE OF ABBEWS
    According to this poll, 80%* of TGW fans agree that "The mod team is devilishly handsome" *as of 12/10

  2. #2
    Inevitability won
    Patrician Citizen

    Join Date
    Mar 2010
    Posts
    9,594

    Default Re: The Uniform Tutorial

    Extremely comprehensive Aanker!

    A tutorial from one of the best in the business too. Great work.

  3. #3
    Aanker's Avatar Concordant
    Join Date
    Apr 2009
    Location
    Sweden
    Posts
    7,072

    Default Re: The Uniform Tutorial

    Thanks Mitch!

    Quote Originally Posted by Adar View Post
    Russia have managed to weaponize the loneliest and saddest people on the internet by providing them with (sometimes barechested) father figures whom they can adhere to in order to justify their hatred for the current establishment and the society that rejects them.

    UNDER THE PROUD PATRONAGE OF ABBEWS
    According to this poll, 80%* of TGW fans agree that "The mod team is devilishly handsome" *as of 12/10

  4. #4
    KDK's Avatar Pro Rege Et Grege
    Join Date
    Feb 2009
    Location
    Denmark
    Posts
    1,368

    Default Re: The Uniform Tutorial

    Great work, mate!

  5. #5

    Default Re: The Uniform Tutorial

    great!!!

  6. #6

    Default Re: The Uniform Tutorial

    I wish this was around 6 months ago! great work mate
    Check out my brand new British and Prussian units and much much more in Marshall Beale's new masterpiece!


  7. #7
    mattebubben's Avatar Senator
    Join Date
    Aug 2010
    Location
    Sweden
    Posts
    1,043

    Default Re: The Uniform Tutorial

    i cant get the DDS plugin to work =P other then that thank you for this Thread

  8. #8
    Aanker's Avatar Concordant
    Join Date
    Apr 2009
    Location
    Sweden
    Posts
    7,072

    Default Re: The Uniform Tutorial

    Quote Originally Posted by mattebubben View Post
    i cant get the DDS plugin to work =P other then that thank you for this Thread
    Thanks!

    For which program - PS or GIMP?

    Quote Originally Posted by Adar View Post
    Russia have managed to weaponize the loneliest and saddest people on the internet by providing them with (sometimes barechested) father figures whom they can adhere to in order to justify their hatred for the current establishment and the society that rejects them.

    UNDER THE PROUD PATRONAGE OF ABBEWS
    According to this poll, 80%* of TGW fans agree that "The mod team is devilishly handsome" *as of 12/10

  9. #9

    Default Re: The Uniform Tutorial

    Awesome effort Aanker! This is by far the best organised, strategised and comprehensive tutorial for dummies like me. A big thanx for making life a whole lot easier for us who have the passion but lack the technical know-hows to realise our dream mods. I sign up especially just to commend you for a job well done.

    This is a huge undertaking- Please please keep up the good work mate!!!

  10. #10

  11. #11

    Default Re: The Uniform Tutorial

    Great tutorial!

    When you say editing textures, do you mean to show how to actually make good textures, or merely the actual process of editing? Though tbh, if the later includes a description of how to add new textures to the atlas, I would be more than glad.
    Developer of The Great War | Leader of WW2: Sandstorm | Under the Woolen Patronage of Mitch | King of All

    Quote Originally Posted by Admiral Van Tromp View Post
    History has always been a bit of the State's slut.

  12. #12
    Aanker's Avatar Concordant
    Join Date
    Apr 2009
    Location
    Sweden
    Posts
    7,072

    Default Re: The Uniform Tutorial

    I think I might be able to add atlas pieces, though that's pretty advanced stuff given the nature of the atlas file (fractions etc.).

    As for texture editing, I'll mostly go through the different texture files, and then delve deeper into some areas (such as normal maps).

    Quote Originally Posted by Adar View Post
    Russia have managed to weaponize the loneliest and saddest people on the internet by providing them with (sometimes barechested) father figures whom they can adhere to in order to justify their hatred for the current establishment and the society that rejects them.

    UNDER THE PROUD PATRONAGE OF ABBEWS
    According to this poll, 80%* of TGW fans agree that "The mod team is devilishly handsome" *as of 12/10

  13. #13
    ♔Oggie♔'s Avatar Senator
    Join Date
    Nov 2008
    Location
    The Netherlands
    Posts
    1,471

    Default Re: The Uniform Tutorial

    Wow many thanks mate! + rep
    I was looking for such a tutorial! I managed to do some stuff myself, but that takes a heck of a long time before you got one thing right
    Thanks again and I'm looking forward to the other parts of your tutorial.

  14. #14

    Default Re: The Uniform Tutorial

    Quote Originally Posted by Aanker View Post
    I think I might be able to add atlas pieces, though that's pretty advanced stuff given the nature of the atlas file (fractions etc.).

    As for texture editing, I'll mostly go through the different texture files, and then delve deeper into some areas (such as normal maps).
    Looking forward to it
    Developer of The Great War | Leader of WW2: Sandstorm | Under the Woolen Patronage of Mitch | King of All

    Quote Originally Posted by Admiral Van Tromp View Post
    History has always been a bit of the State's slut.

  15. #15
    Aanker's Avatar Concordant
    Join Date
    Apr 2009
    Location
    Sweden
    Posts
    7,072

    Default Re: The Uniform Tutorial

    Now it's just a matter of getting into the mood to make the last parts.

    And thanks everyone!

    Quote Originally Posted by Adar View Post
    Russia have managed to weaponize the loneliest and saddest people on the internet by providing them with (sometimes barechested) father figures whom they can adhere to in order to justify their hatred for the current establishment and the society that rejects them.

    UNDER THE PROUD PATRONAGE OF ABBEWS
    According to this poll, 80%* of TGW fans agree that "The mod team is devilishly handsome" *as of 12/10

  16. #16
    Derpy Hooves's Avatar Bombs for Muffins
    Join Date
    Jun 2010
    Location
    My flagship, the Litany of Truth, spreading DESPAIR across the galaxy
    Posts
    13,399

    Default Re: The Uniform Tutorial

    For a while I have been thinking of creating my own unit for ETW and NTW, the problem that I thought I would run into is how horrid my art skills are. It seems to me, all you have to do is tell the program which color is which, which excites me (that is alot of which). However, would it be possible to use a body that has a breast plate for line infantry? If so, how easy would that be?
    Also would it be as simple as this tutorial to port the new unit into TGW? And not just have it as a Napoleonic unit, but as a TGW unit. I would greatly like to use my custom unit in my favorite NTW mod.



  17. #17
    Aanker's Avatar Concordant
    Join Date
    Apr 2009
    Location
    Sweden
    Posts
    7,072

    Default Re: The Uniform Tutorial

    Quote Originally Posted by swordofjanak View Post
    For a while I have been thinking of creating my own unit for ETW and NTW, the problem that I thought I would run into is how horrid my art skills are. It seems to me, all you have to do is tell the program which color is which, which excites me (that is alot of which). However, would it be possible to use a body that has a breast plate for line infantry? If so, how easy would that be?
    Yes, that is possible, but there are a number of limitations and steps which I might have to go through in detail in the next tutorial section (I just need to get off the ground and start working on it). For instance, if no iron breastplate exists on the atlas of the nation you want to add the unit to, things get more complicated; especially if two parts exist on two different atlases.

    Also would it be as simple as this tutorial to port the new unit into TGW? And not just have it as a Napoleonic unit, but as a TGW unit. I would greatly like to use my custom unit in my favorite NTW mod.
    If you want to use the new uniforms in TGW 5.0 for your unit, you will have to wait until the new mod version is released so you can use the provided atlas file, from which all necessary textures are loaded. If you believe that vanilla resources will be sufficient (or if you have made an entirely new atlas), however, you can add your new unit .pack to the data folder and things should work fine alongside TGW.

    Quote Originally Posted by Adar View Post
    Russia have managed to weaponize the loneliest and saddest people on the internet by providing them with (sometimes barechested) father figures whom they can adhere to in order to justify their hatred for the current establishment and the society that rejects them.

    UNDER THE PROUD PATRONAGE OF ABBEWS
    According to this poll, 80%* of TGW fans agree that "The mod team is devilishly handsome" *as of 12/10

  18. #18

    Default Re: The Uniform Tutorial

    Quote Originally Posted by swordofjanak View Post
    For a while I have been thinking of creating my own unit for ETW and NTW, the problem that I thought I would run into is how horrid my art skills are. It seems to me, all you have to do is tell the program which color is which, which excites me (that is alot of which). However, would it be possible to use a body that has a breast plate for line infantry? If so, how easy would that be?
    Also would it be as simple as this tutorial to port the new unit into TGW? And not just have it as a Napoleonic unit, but as a TGW unit. I would greatly like to use my custom unit in my favorite NTW mod.
    Go ahead, thats how I started out Its really not difficult, especially if you have this tutorial and the atlas Josst made for TGW.

    @Aanker
    When you get to writing on the adding files to an atlas, you could include simple instructions on how to use the atlas to .tsv converter and back, I'm sure it would be helpful to people, based off my own experiences...
    Developer of The Great War | Leader of WW2: Sandstorm | Under the Woolen Patronage of Mitch | King of All

    Quote Originally Posted by Admiral Van Tromp View Post
    History has always been a bit of the State's slut.

  19. #19

    Default Re: The Uniform Tutorial

    I don't have Adobe Photoshop, do i have to download it also besides the Photoshop nVidia .DDS Plugin? And if i do, which version it's the most up to date one?

  20. #20

    Default Re: The Uniform Tutorial

    Great

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •