jamo wrote:So that means, each colour team has different bmp images: that's very interesting. You are making sides. That's wonderful. Could you show me the details. I would like to add different bmp images for all coloured sides in Warhead. I'm still working on it.
It isn't that each side has its own units, it is that the single unit icon can be created in such a way that it looks different for different teams. Basically, it works like this:
Color in Defcon is subtractive. By default, each unit has an icon, in the form of a .bmp image, that is composed of a white unit on a black background. When Defcon goes to put that unit into the game, it subtracts color values from it to give it the right color. For instance, if I am on the red team, then Defcon will subtract all of the blue and green from the icon to create a red unit (actually, it only takes out most of the blue and green, but you get the idea). If you know how different wavelengths of light create color, this is pretty easy to understand, so, a refresher.
There are three primary colors of light: red, green, and blue. If you look very closely at a CRT monitor, you can see that every pixel is made up of three little lights: a red one, a green one, and a blue one. To make other colors, you combine red, green, and blue (R, G, B, respectively) to create new colors. Let us say that each value can go from 0 to 7. Black is the color R0 G0 B0 (that is, zero for each color), while white is the color R7 G7 B7. Yellow is made by combining red and green, so is given by R7 G7 B0.
Okay, so suppose that you have a white pixel (R7 G7 B7) and you want it to be red. Well, you need to subtract out everything that is not red. So, you subtract cyan (R0 G7 B7). White minus cyan equals red (consider the color designation to be a 1x3 matrix, and subtract as you would normally subtract a matrix). But, what happens if I have a pixel that is the color R3 G7 B2, and I subtract cyan? First off, we don't deal with negative numbers -- if a subtraction comes out negative, we just set it to zero. So, when we subtract cyan, we get R3 G0 B0, which is a dark red color.
Now, how does this help us? Let us say that we have only two possible teams -- red and blue. In order to make red, we subtract out blue and green; and in order to make blue, we subtract out red and green. So, if a pixel is the color R7 G0 B7 (magenta), and the unit is on the red team, then we end up with red. If, on the other hand, we have the same pixel, but the unit is on the blue team, then we subtract the red, and end up with blue.
If you have a unit icon that includes pixels that are magenta, blue, and red, then the magenta pixels will show up for both teams, the red pixels will show up only for the red team, and the blue pixels will show up only for the blue team. In the Star Wars sprite above, notice that the tie fighter is in red, and the x-wing fighter is in blue. The places where they overlap are cyan(ish -- they are actually white, but you could do a better job of editing the image to get it right). Thus, it looks like a tie fighter on the red team, and an x-wing fighter on the blue team.
One image, but it looks different depending on the team. With an appropriate image editor you can do the same. However, there are pitfalls. There are teams that use more than one primary color (the yellow, orange, and teal/cyan teams). Thus in the x-wing/tie fighter sprite above, the overlapping portions (the cyan bits) will be cyan on the cyan team, while the blue bits will be blue (see the image of all of the units, lower-right corner). This can lead to confusing or ugly units. Also, you have no guarantee that you will stick with one color throughout the game. Thus, all of your tie fighters might magically transform into x-wing fighters in the middle of the game, which would be weird.
Thus, playing with the colors of the sprites can give some interesting results, but most of us dismissed it as an interesting but useless exercise several years ago. You are welcome to experiment, and I encourage you to do so, but, in practice, it doesn't work very well.
xander