Aller au contenu

Photo

Changing Default Armor Tints


  • Veuillez vous connecter pour répondre
5 réponses à ce sujet

#1
PuakaFace

PuakaFace
  • Members
  • 38 messages
I'm quite sick of all the different ways i get stuck with pink armor in this game and want to go in and edit the tints. I've looked up a bunch of tutorials but they all cater to those who don't want to override the default ones. I'm pretty new at all this and need someone to hold my hand through the process.
Could someone point me to a tutorial that will help me replace the nasty default tints or even better just walk me through it in this post?
I'll just hold my breath while I wait for a response.

Modifié par PuakaFace, 15 janvier 2010 - 06:24 .


#2
DarthParametric

DarthParametric
  • Members
  • 1 409 messages
If you want a quick edit to change all armour tints to a normal metal colour then that is pretty straightforward. Customising the colours will take a little more effort however. I’ll show you how to do the former and leave you to experiment with the latter.

The first thing is to open materialtypes.xls located in <install directory>\tools\Source\2DA\rules\ Change to the materialtypes tab. Here you’ll see all the armour and weapon material types and their associated tints. For metal armour, the ones you are interested in are right at the top of the list, rows 4 to 10:
Armor, Iron			T3_ARM_IRN.tnt
Armor, Gray Iron		T3_ARM_LST.tnt
Armor, Silverite			T3_ARM_HST.tnt
Armor, Veridium		T3_ARM_IBK.tnt
Armor, Red Steel		T3_ARM_RST.tnt
Armor, Dragonbone		T3_ARM_DRB.tnt
Armor, Steel			T3_ARM_STL.tnt
Red Steel is obviously going to be the major offender in terms of pink/red coloured armour, but we’ll extract them all just to be safe. In the toolset directory, run ErfEditor.exe. Go to File->Open File and navigate to <install directory>\packages\core\data\ and select tints.erf and click Open. You’ll see all the game’s tint files. The files we want are all prefaced T3_ARM_, so scroll down until you get to them. Select (CTRL + left click) the 7 files we want, then right click and choose Extract Resource. In the pop-up folder browser, just choose somewhere easy to find like the Desktop and click OK.

Now what we are going to do is choose one tint file that looks appropriately metal-y and overwrite the others with copies of it. Before we do that though we need to see what colours each tint file has. Open the toolset. Go to File->New->Material. This is the material editor. Right click on the Root object and choose Insert->Insert New Tint Library. Right click on the new tint library and choose Insert->Insert New Tint Object. Click on the new tint object and then in the Object Inspector (if it isn’t already open go to View->Other Windows->Object Inspector) look for the Import TNT File line and click the button to the right. Navigate to where you extracted the armour tints and load one.

You’ll see in the Object Inspector a whole series of colours, labelled diffuse and specular for the red, green and blue channels. Diffuse is the actual base colour, and specular is the highlights. The channels it is referring to is of the tint map image. This has 4 channels (RGB plus Alpha), each of which is a greyscale image that is used to define the area its related tint colour is applied. The way tints work is a bit like black magic though, so I won't go into it any further here. Have a look at some of the other posts on the topic if you want to experiment with custom colours.

If you load all the tint files in turn, you’ll see a number of them have reddish colours. There are two which are probably what you are looking for. The first is T3_ARM_HST, Silverite. The second is T3_ARM_STL, Steel. Both have bluish grey colours for the most part. What you want to do is select one of those and make 4 copies, then rename them to replace the Iron, Grey Iron, Red Steel and Dragonbone tints. Additionally, you may also choose to overwrite Veridium, which is a greenish tint, if that is not to your taste. Once that is done, create a new folder in My Documents\BioWare\Dragon Age\packages\core\override\ and call it something appropriate (Armour Tint Mod for example). Place your tint files in there. Load up the game and try out a formally pink suit of armour. You should get something like this:

Posted Image

You can see there that Alistair has gone from the default red armour to a proper metal colour.

There are also some additional tints that you may want to look at. If you peruse the rest of materialtypes.xls you'll see that Templar armour uses T3_ARM_TMP.tnt and the king's armour uses T3_ARM_GLD.tnt. You'll also see that there are all the tints for the metal shields and weapons which you'll probably want to replace in the same manner as you did for the body armour.

Modifié par DarthParametric, 13 janvier 2010 - 12:55 .


#3
PuakaFace

PuakaFace
  • Members
  • 38 messages
Holy! Thank you! You are my new hero. This really did help.

I have one more question.

-Let's say I want the dragon bone armor to be brown or tan or something bonish like that. So I go in and find the dragon bone file and then change the tints. What would I do to save them. I'm sure i'm just confusing myself more than i need to but i can't figure it out.

Okay forget that question. I'm changing it. When i save any changes to the tints they all seem to come out looking like there is no tints to them at all. just silver. Better than pink but  I would like the dragon bone armors to be dark. Am I doing something wrong?

Modifié par PuakaFace, 13 janvier 2010 - 10:54 .


#4
DarthParametric

DarthParametric
  • Members
  • 1 409 messages
As alluded to previously, tint files hold a series of colours that are applied to a model in a manner that is defined by a tint mask. Each channel of the tint mask is used to define a specific area of the parent texture to apply the associated tint. While tint masks have 4 channels (RGB+A), it’s mostly only face textures and related things like hair and tattoos use all 4. Everything else tends just to use the RGB channels. As you would have seen, the metal armour tints extracted previously have a pair of colours, diffuse and specular, for each of the three tint mask channels (thus 6 colours in total). The diffuse is what actually colours the base texture, the specular is the “shininess” – the colour of highlights caused by light reflection. A specific type of armour generally shares a single model (well, one model per sex per race, not counting scaled LOD variants). There are usually 4 (occasionally 5) texture variants, and these are diversified further into actual item variations through the use of tints. As an example, I’ll use two texture variants of male medium armour (as with faces, armour models share a common UV map across races, although armour is split into male and female variants, aside from massive armour).

If you haven’t previously unpacked or browsed through the armour textures, you can find them in <install directory>\packages\core\textures\high\texturepack.erf. We’ll use variant A, pm_arm_meda_0d.dds, and variant D, pm_arm_medd_0d.dds. Notice the _0d suffix. This denotes the diffuse (colour) map at the highest, or 0, level of detail (LOD). You’ll see two other textures with the _0dl2 and _0dl3 suffixes. These are the second and third LOD diffuse textures, respectively. LOD0 is the highest resolution (in this case 1024x1024), LOD2 is a quarter of that size (512x512), and LOD3 is a quarter the size again (256x256). You don’t have to worry about this for our current purposes, but just be aware that any time you make physical changes to a diffuse map (or any other map with scaling LOD, like tints) that is going to override the default, you’ll want to make multiple LOD versions. You’ll see a number of associated textures with the same base filename as the diffuse maps. Those with the _0n suffix are the normal maps, those with _0s are the specular maps, and the ones we want, _0t, the tint masks. Extract the two diffuse maps and the two tint masks to a working directory and open them.

You’ll see that the diffuse maps are just bog standard colour textures, albeit a tad dull. The tint masks, at first impression, look to be horrible technicolour nightmares. Change to the channels tab however and you’ll see how they work. Think of each channel as a separate alpha mask. Black is 100% transparency, white is 100% opacity, and shades of grey denote values in between. If we lay out the channels of the tint mask as 3 separate images and compare them to the parent diffuse map, we get the following for the two texture variants:

Posted Image Posted Image

If you look at the first image, variant A, you’ll see that the red channel of the tint mask is confined to areas of metal banding, the green channel to other metal areas like buckles and trim, and the blue channel to areas of leather. Variant D is a similar story, the red and green channels being confined to metal, the blue to leather. Because all three classes of metal armour (medium, heavy, massive) use a universal set of tints based on material type, if you look at the other metal armour tint masks you’ll see that this is the pattern that they all more or less conform to – the red channel is the primary metal area tint, the green channel the secondary metal area tint, the blue channel the leather/cloth/misc area tint (the “misc” mostly refers to the massive armours, which don’t have any leather or cloth and instead use the blue channel for decorative filigree patterns and the like).

Now that we know what each channel of the tint mask does, we can edit our tint file appropriately. As we did previously, load the tint file you want to edit into the material editor. I’ll use the dragonbone tint, T3_ARM_DRB.tnt, for this example. Now when I am working with tints, I only use the material editor to quickly experiment with colours. The whole “Post to Local” process is far too clunky for my tastes, and it can also lead to problems if you have the single player module open (which you have to do in order to be able to export tints in my experience). Instead, I edit the file directly in the GFF editor. You can do this in the toolset (by just going to File->Open and loading the TNT file) but I prefer to use the standalone GFF editor in the toolset directory, GffEditor.exe. You may find it handy to associate this program with all GFF file types so that you can quickly edit a particular file just by double clicking on it. With the TNT file open in the GFF editor, you’ll see something like this:

Posted Image

Although it’s confusing at first, you’ll see it’s conveying the same basic information as that in the material editor, just in a more concise (and less visually intuitive) format. The thing to note is that you have a series of numbers, each in what is known as a vector 4 array. For each set of 4 numbers, the first 3 are RGB values. Rather than the usual 0-255 value, the RGB is on a scale of 0 to 1 (i.e. a percentage). So, for instance, a V4 RGB value of 1,1,1 is the same as 255,255,255 (white). The 4th number in a V4 array is presumably an alpha value, but playing with it doesn’t seem to yield much in the way of results, so leave it at 1 which is what most tint files seem to use. However, to complicate matters, there’s also an “intensity” value for each colour that is on a scale of 0.1-10. In the material editor you’ll notice that original tint file had the intensity of diffuse tints set to 1 but had pretty high intensities of 5.22 and 3.8 for the Red and Green channel speculars respectively. There’s no row for intensity in the GFF editor though, so where are these values? Well if you go back and look at the specular values for the Red and Green channel, you’ll see the RGB values are all above 1. What it is doing is multiplying each of the RGB values (between 0 and 1) by the intensity value. So you can see the GFF editor shows the Red channel specular V4 is 3.06,3.78,5.22,1 but the material editor says the RGB is 0.59,0.72,1.00. If you multiply the RGB values by the intensity (5.22) you get the same as in the GFF editor (well more or less anyway). I assume it is deriving the 4 unknowns (RGB + intensity) with simultaneous equations, but I’m a biologist not a mathematician, so I’ll leave that discussion to someone else.

Getting back to the more general overview, you’ll see the file is laid out firstly with the diffuse values for the tint mask’s RGB channels, then the specular values for the RGB channels. Diffuse and specular for the tint mask’s Alpha channel is next, but as I said earlier this is not normally used, so in most cases both diffuse and specular will be set to 1,1,1,1. Finally, you have the opacity for both the diffuse and specular tints. Here the V4 is a set of opacity values for each channel of the tint mask, RGBA. This time it’s on a scale of 0 to 2. Generally though, most tints stick to values of 1 and below. As before, the Alpha channel isn’t always used, so in those cases it’s set to 0.

Now let’s look at the tint file in the material editor. We’ll use this to tweak the colours to our liking, then copy the values across to the file in the GFF editor. If you click on each colour you’ll get a button on the right that pops up a colour picker for easy tweaking. If you are using the dragonbone tint file from earlier, it will be using the colour values from the silverite or steel tints, which are bluish grey. I don’t know what colour dragonbone is supposed to be, but for this example I’ll change it to some brownish colours, as follows:

Posted Image

So now we have our set of colours. You’ll see next to the little colour square, the material editor gives you the RGB V4 values. We need to copy and paste these into the appropriate rows in the GFF editor, remembering to append a 1 to the end. So for example the Red channel value of 0.75,0.74,0.44 gets pasted as 0.75,0.74,0.44,1. If you try and paste just the 3 values, the editor will complain about it not being a proper V4 array. Based on our exploration of the tint masks earlier, we know that the Red and Green channels are for metal, so these get the boney colour we want along with a fairly bright colour for specular. Given that this is supposed to be bone and not metal, I probably should have used a darker colour instead which would give a flatter specular highlight, as opposed to the sharp, close to white, specular highly reflective materials like metal have. However the fact that the intensity value is being reduced to 1 (by just pasting the RGB values directly) should counteract this. The Blue channel gets a darkish brown with a dark specular, as that is for any leather and cloth. Save the TNT file and we are ready to test it in the game. Reusing the example scene from the original tint override:

Posted Image

OK, so not exactly the most thrilling tint in the world, but hopefully it demonstrates the principle. In particular, notice the reduction in the specular highlights between the two tints as a result of dropping the intensity. If you are trying to make a shiny metal then crank the intensity up, if making cloth, leather or some other flat, dull material (bone?) then crank it down. Adjust your specular colours to suit as well. The higher the intensity, the closer to white it should be.

An additional note for those that wish to only use the material editor. As I said, it seems to only want to export tints when in the single player module. You could try a module that extends the single player campaign as I haven’t done that, but it definitely doesn’t work in a standalone module. You have to save the material file (*.MATPROJ) somewhere, then you can do a Post to Local to export the TNT. I would strongly advise not leaving the single player module set as the active module. You can potentially screw your game doing so – you have been warned.

Modifié par DarthParametric, 14 janvier 2010 - 10:02 .


#5
PuakaFace

PuakaFace
  • Members
  • 38 messages

DarthParametric wrote...

but I’m a biologist not a mathematician, so I’ll leave that discussion to someone else.


Hey, I'm a video game artist myself and this stuff is almost completely foreign to me.

But anyhow, This is brilliant! Once i'm done fixing the default tints i'm going to come back and see if I can change the title of this post so that more people who are looking to do the same thing can find it easier. Thank's again.

#6
Azag977

Azag977
  • Members
  • 5 messages
It has been a long time since this original post. However, I followed the "Creating Recolors of existing items" tutorial. When I select the tint override for a particular item, I do not see the colors in the item view window. As a matter of fact, all of the default tints, including the custom I just created, show up as a dull gray tint.



Any ideas?