Skip to content

Posts from Changing the hero icon.

No ratings yet — be the first to rate!
5 years ago
Auto-translated
I think the title says it all. I want to change the icon for, say, the Duggal, maybe even just retexture it, but when I retexture it, the game shows something completely different instead of the icon. What could be the problem? I remember changing unit icons before, and it seemed to work fine.
User Avatar
5 years ago
Auto-translated
Are you modifying the DDS file? If so, you need to make sure you save it in the same format as it is in the game. For example, there are DXT1, DXT3, and TF8888 formats. The format code is contained in the XDB file, which describes the image. But I usually don't look there. Because if the weight of the saved file is correct (the same as the old icon in your case), then most likely, everything is fine.
In reply to Ment
5 years ago
Auto-translated
Yes, I've already fixed that, but now there's a new issue: when I save, the transparent background (empty spaces) turns white. I've tried all the formats. Could you provide more details about where the format is specified in the xdb file? Is this line: `TF_8888` the one? I just couldn't find the TF-8888 format.
In reply to Dorg
User Avatar
5 years ago
Auto-translated
Dorg
Yes, I've already fixed that, but now there's a new problem: when I save, the transparent background (empty spaces) turns white. I've tried all the formats. Could you provide more details about where the format is specified in the xdb file?*
TF_8888 - is this the line? I couldn't find the TF-8888 format.
Hello. I have a guide in my signature: How to create your own hero?. It discusses, among other things, adding an icon.
In reply to Dorg
User Avatar
5 years ago
Auto-translated
Dorg
Yes, I've already fixed it, but now there's a new problem: when I save, the transparent background (empty spaces) turns white. I've tried all the formats. Could you please provide more details about where the format is specified in the xdb file?*
TF_8888 - is this the line? I just couldn't find the TF-8888 format.
Good day. The white background is related to the fact that you either don't have an alpha channel or it's not configured.

In the Channels section, add a new channel and paint white the areas that should be visible, and black the areas that should be transparent, then save. Then everything will work correctly!

Here is the result of the screenshots above:
User Avatar
5 years ago
Auto-translated
Good day. The white background is related to the fact that you either don't have or haven't configured the alpha channel.
As I understand it, this is more of a bug with different colors of transparent alpha, rather than the fact that it's missing. Transparent pixels in the TF_8888 format should be black, and partial transparency is not supported. White transparent pixels will be displayed as white, not transparent. This can be fixed in a photo editor, but I also struggled with it at one time.
In reply to Waterfall_13
5 years ago
Auto-translated
Waterfall_13
Good day. The white background is related to the fact that you either don't have an alpha channel or it's not configured.

In the Channels section, add a new channel and paint white the areas that should be visible, black the areas that should be transparent, and save. Then everything will work correctly!

Here is the result of the screenshots above:
Thank you very much, your method really helped me! I knew the problem was with the alpha channel, but I didn't know how to fix it.

Added 40 seconds ago
}{0TT@6bI4
Hello. I have a guide in my signature: How to create your own hero?. It also discusses adding an icon.
Thank you, I will definitely check it out. I think the skill of creating new heroes in general will be useful to me!

Added 31 seconds ago
Thank you very much to everyone who responded! I thought I would be ignored and no one would answer, but there are so many responsive people here that it's a little awkward :)

Added 51 minutes ago
Damn, a new problem has arisen, I'm inserting a picture, and it seems like I'm doing it as described above, but white spots are visible on the character's avatar. For example, Faramir has white highlights near his hair, everywhere a little, I tried adding more white and black, and also cropping the image itself, but it doesn't work.*
https://imgur.com/a/3AhgNVS
User Avatar
5 years ago
Auto-translated
So, these specific pixels are just the wrong color.
It should be noted that in the immediate vicinity of the hero's face, it will still look unattractive, and if not with highlights, then it will be pixelated – therefore, you need to outline the image with a moderately thick black border! It is better to create a new layer under the main one and make this black border in it.
In reply to Ment
5 years ago
Auto-translated
Ment
So, these specific pixels are just the wrong color, that's all.
I should mention that in the immediate vicinity of the hero's face, it will still look bad, and if not with highlights, then it will be pixelated – so you need to outline the image with a moderately thick black border! It's best to create a new layer under the main one and make this black border in it.
Are you referring to the specific pixels on the hero's frame itself, or on the black color that I used as a background for the alpha channel? I've already tried a few things, but nothing seems to change.
User Avatar
5 years ago
Auto-translated
I'll be honest, I've never worked with Photoshop or alpha channels. At the time, the simplest way seemed to be to take an empty icon that I found somewhere in the data.pak file; it's the right size and has the right black transparency. I copy this file, then create a second layer for the image and insert into the second layer what shouldn't be transparent (the visible pixels). And nothing else, so that it doesn't overlap incorrectly and result in incorrect transparency.
This seemed to be the least troublesome method compared to searching for "incorrect" pixels.
Accordingly, the black border can also be drawn on the lower, transparent layer.

Of course, this method works not only with an empty icon, but also with any non-empty icon where all the pixels that you want to be transparent are already transparent. But it's more universal to find an empty one.

Well, if you get suggestions for other methods, that's good; maybe it will be even more convenient.
----
And one more thing, if needed, you can determine the color of a pixel in any editor after the image has been merged, using the eyedropper tool on the desired pixel. There you can see if it's black or white (it seems that it should be transparent in any case).
----
In general, in such a description, it sounds super complicated, but in reality, it's... Simpler. So, if it's still relevant, tomorrow I'll try to make some screenshots in Paint.NET showing how I do it there.
In reply to Ment
5 years ago
Auto-translated
Ment
To be honest, I've never worked with Photoshop or alpha channels. At the time, the simplest method seemed to be taking an empty icon that I found somewhere in data.pak; it's the right size and has the right black transparency. I copy this file, then create a second layer for the image and insert what shouldn't be transparent (visible pixels) into the second layer. And nothing more, so that it doesn't overlap incorrectly and result in incorrect transparency.
This seemed like the least troublesome method compared to searching for "incorrect" pixels.
Accordingly, the black frame can also be drawn on the lower, transparent layer.

Of course, this method works not only with an empty icon but also with any non-empty icon where all the pixels that you want to be transparent are already transparent. But it's more universal to find an empty one.

Well, if you get suggestions for other methods, that's great; maybe it will be even more convenient.)
----
And one more thing, if needed, you can determine the color of a pixel in any editor after merging the image, using the eyedropper tool on the desired pixel. There you can see if it's black or white (it seems that it should be transparent in any case).
----
In general, this description sounds super complicated, but in reality, it's... Simpler. So, if it's still relevant, tomorrow I'll try to make some screenshots in Paint.NET showing how I do it.

That would be great! I would also like to ask for that empty image that you use to overlay the icons on.
I also use Paint.NET, so I think I should be able to understand everything
User Avatar
5 years ago
Auto-translated
Okay, let's take one of the Master maps as an example (simply because icons were recently discussed there) and make an icon for Elva!

1.
Here, we have exported it to the desktop.

Let's check its size in File Explorer -- it shows


Remember this number -- if our final 128x128 icon weighs the same, then we most likely saved it correctly. But I will still attach a screenshot later showing which format I used to save in, so as not to get confused.

2.
If you already have an image template with transparent black color of size 128x128, or if you made it earlier (found, Download from this message: I will attach it as base.dds), then this step can be skipped.

To add transparency to this icon, I suggest creating a new empty 128x128 image in paint.NET



The next sequence of actions is as follows: we set black as the primary color and perform a fill of the image.



Select our (only) background layer, click the wrench icon ("Properties") in the layers panel



and set the layer opacity to 0



Save, close the image, and open it again (the eyedropper just didn't work correctly for me until I closed the image and opened it again).

What format should you save in? At this stage, a simple png with transparency is fine, but if you want to save in the correct dds, see point 5 near the end when we save the final result.

So, let's open our template -- and you are wonderful, it really is black-transparent, just as the game requires! See the eyedropper action in the screenshot.



3.
Let's deal with the elf girl. So, let's open it.



Take an eraser with some reasonable hardness and size, and carefully remove the background. Be especially careful near the ears; Elven Ears are Important!



Take the magic wand and click on one of the transparent areas of the drawing, in this case -- on the left. Adjust the magic wand sensitivity so that this entire area is selected, but it doesn't overlap our elf girl (borderline semi-transparent pixels should not be included in the selection).



Hold Ctrl and click with the magic wand now on the right area of the elf.



Now go to the "Edit" menu and invert the selection.



We ended up with only the elf girl selected and nothing extra.



Press Ctrl+C. Open our base.dds template from point 2. Press Ctrl+Shift+V in it.
The most important part is done!

4.
So, we have a modified base.dds image with two layers: the bottom one is transparent, and the top one is the elf girl.
Go to the bottom layer and draw a black border under the elf girl, about two pixels thick or slightly thicker. I did this with a brush. It's possible it might turn out neater if you use the "Line / Curve" tool; in that case, you should draw curved lines specifically. But here is my result:



Final touches. Take the "shapes" drawing tool, select "rectangle" and "fill only". Primary color -- black.



And draw rectangles on the top layer (where the elf girl is) in those places where the elf girl touches the edge of the image. Exactly two pixels thick.



When you are finished with this, the layers can be merged. Result:



5.
Save the image as dds (Direct Draw Surface). For icons -- here is the format I used to save in:



You won't ruin the base, but it's better to save to a new file.
Also, at the time, I only made 128x128 icons. The game can scale various 64x64 and 32x32 ones from the large version itself; however, I don't know about the quality -- perhaps it's not worth it. And yet, the developers of the "Tribes of the East" expansion use only large icons in their files.

[spoiler=Result in game:][/spoiler]

Now, like in a school lesson -- where did the teacher make a mistake? Who can spot it on the screenshot?
Correct,I initially forgot the black line on the upper border of the elf girl. According to the game authors' standard, black lines should be everywhere: top, bottom, and sides, if the portrait touches them.


That seems to be everything.

Attaching the result and the base (template) in the archive elf + base.zip
User Avatar
5 years ago
Auto-translated
Interesting method. There's another option: carefully select the elf (with ears) using the lasso tool, copy it; then select the entire canvas and press Backspace. The transparent background is ready. Copy the elf there, outline it in black, save it as a TGA file, and export it to the map through the editor. As an alternative.
User Avatar
5 years ago
Auto-translated
You can use a lasso, but it will be more difficult to create semi-transparent pixels on the border with a lasso. Exporting as TGA – well, you can try that, yes, if the editor itself corrects the transparency during export, replacing white with black. I haven't tried it, but it's possible.
In reply to Ment
5 years ago
Auto-translated
Ment
Okay, let's take one of the Master maps as an example (simply because icons were recently discussed there) and make an icon for Elva!

1.
Here, we've exported it to the desktop.

Check its size in File Explorer -- it shows



Remember this number -- if our final 128x128 icon weighs the same, then we most likely saved it correctly. But I will still attach a screenshot later of the format I used to save it, just so there's no confusion.

2.
If you already have an image template with transparent black color sized 128x128, or if you made one earlier (found and Downloaded from this post: I will attach it as base.dds), then you can skip this step.

To add transparency to this icon, I suggest creating a new empty 128x128 image in paint.NET



The next sequence of actions is as follows: we set black as the primary color and perform a fill of the image.



Select our (only) background layer, click the wrench icon ("Properties") in the layers panel



and set the layer opacity to 0


Save, close the image, and open it again (simply because my eyedropper tool didn't work correctly until I closed the image and reopened it).

What format should you save in? At this stage, a simple png with transparency is fine, but if you want to save in the correct dds, see point 5 near the end when we save the final result.

So, open our template -- and voila, it's indeed black-transparent, just as the game requires! See the eyedropper action in the screenshot.


3.
Let's deal with the elf girl. So, opening it now.



Take an eraser with a reasonable hardness and size, and carefully remove the background. Be especially careful near the ears; Elven Ears are Important!


Take the magic wand tool and click on one of the transparent areas of the drawing, in this case -- on the left. Adjust the magic wand sensitivity so that this entire area is selected, but it doesn't overlap our elf girl (borderline semi-transparent pixels should not be included in the selection).


Hold Ctrl and click with the magic wand now on the right area of the elf.


Now go to the "Edit" menu and invert the selection.


Now only the elf girl is selected, and nothing extra.


Press Ctrl+C. Open our base.dds template from point 2. Press Ctrl+Shift+V in it.
The main part is done!

4.
So, we have a modified base.dds image with two layers: the bottom one is transparent, and the top one is the elf girl.
Go to the bottom layer and draw a black border under the elf girl, about two pixels thick or slightly thicker. I did this with a brush. It's possible it might turn out neater if you use the "Line / Curve" tool; in that case, you should draw curved lines. But here is my result:


Final touches. Take the "shapes" drawing tool, select "rectangle" and "fill only". Primary color -- black.


And draw rectangles on the top layer (where the elf girl is) in places where she touches the edge of the image. Exactly two pixels thick.


When you're finished with this, the layers can be merged. Result:


5.
Save the image as dds (Direct Draw Surface). For icons -- this is the format I used to save:


You won't ruin the base, but it's better to save to a new file.
Also, in my time, I only made 128x128 icons. The game can scale 64x64 and 32x32 from the large version itself; however, I don't know about the quality -- perhaps it's not worth it. Even so, the developers of the "Tribes of the East" expansion use only large icons in their files.

[spoiler=Result in game:][/spoiler]

Now, like in a school lesson -- where did the teacher make a mistake? Who can spot it in the screenshot?
Correct,I initially forgot the black line on the top border of the elf girl. According to the game authors' standard, black lines should be everywhere: top, bottom, and sides if the portrait touches them.


That seems to be all.

Attaching the result and the base (template) in the archive elf + base.zip


Thank you very much, I can't believe you took the time to do all this
I basically did the same thing, but I didn't think to make a frame to separate the image; now I probably will
Thanks again!

Statistics

Welcome our newest member: recijeb

Users Online 2 users 1279 guests