View Full Version : graphic problem: Flag is white in the game


cool3a2
Jul 18, 2007, 06:51 AM
I am sure this is a well known problem: the flag in my mod appears white in the game. I have Civ 4 installed on two machines: a laptop and a desktop pc. Firstly it looked as it should only on the laptop (it as white on the desktop pc). So I have done a search for this problem and I found a thread were this problem was describted. The flags picture file has to be saved with special preferences. The problem is, that I can not find this options mentioned there in the two programs I have. I am using DXTBmp where I can not find any of this options (I don't like this program, I had always problems with the result it creates: blurry pictures etc...) and DDS Converter 2 (which closes itself often when clicking on a file to select it for converting). In DDS Converter 2 I found some options that sound similar to the ones mentioned in the thread, so I tried it. The result was that the flag looks like it should on the desktop pc, but it is white on the laptop now. I don't want to upload to different versions of the mod, there has to be an other solution... I think there is a file including nv* in its name mentioned in the readme of DDS Converter 2. Maybe it is related with nvidia graphic cards. Maybe that's why it works on my desktop pc, because I have a GeForce 4 in it (I know: it's a peace of sh**). Would be nice if anyone could give me a link to a program or a plugin for a program that works without any bugs and is easy to use... A link to a thread would also help. An answer right here in this thread would be perfect of course... :king:

Shiggs713
Jul 18, 2007, 10:46 AM
I use DXTBmp for only 1 reason. Making flags. The way I have gotten it to work correctly is get a flag picture, get it down to 96*128. Then scale the width up 25%, making the image 128*128 pixels. I use Gimp (http://www.gimp.org/) to do this. I think you will need to get the .dds plugin for it as well. It is free and pretty good. Save it as a .dds DXT 3 with mipmaps. It MUST be in this format. Then open it up with DXTBmp, open the alpha channel and bucket paint the entire thing black. Works like a charm. Hope that helps. ;)

theres probably 1 program out there that does all of this, and probably other ways, but this is the way I use, and it works great.

cool3a2
Jul 18, 2007, 11:15 AM
Okay, thanks. I will try that. :goodjob:

cool3a2
Jul 19, 2007, 03:35 AM
Okay, I tried it. Firstly I have to say that I found a plugin for my favorite graphic program. There I could create a alpha channel for the image, paint it black and save it as .dds. In DXTBmp I had always the problem that it didn't save the alpha channel. When reloading it, the channel was white again. So it works on the laptop again now, but is white on my desktop pc. Any ideas? :confused:

cool3a2
Jul 19, 2007, 03:36 AM
BTW: I saved it WITH mimmaps, but it became blurry in the game. So I saved it without it and it looked good, but only on the laptop.

Shiggs713
Jul 19, 2007, 08:18 AM
strange. when you change the alpha, you should just double click it, it'll open the alpha in mspaint or whatever, just bucket paint, and then save, then refresh alpha and save then entire .dds. It has worked great for me doing it this way. There is some white flag problems with some machines though I have heard.

NikNaks
Jul 19, 2007, 08:47 AM
Can you post the XML you're using? It sounds like you're having problems with the Shader files.

cool3a2
Jul 19, 2007, 08:51 AM
when you change the alpha, you should just double click it, it'll open the alpha in mspaint or whatever, just bucket paint, and then save, then refresh alpha and save then entire .dds.
Thats exactly what I did...

There is some white flag problems with some machines though I have heard.
Maybe, but why does it work when I convert the file with dds converter? And why does it not work on the laptop then? On the other hand the mod exists since a long time now and nobody seemed to had a problem with this...

All I can think of is converting the dds (that works on the laptop) with dds converter in dds. When converting to dds when it worked with the desktop pc I converted a bmp. I ignored the alpha channel totally...

cool3a2
Jul 19, 2007, 11:23 AM
Sorry, NikNaks 93, somehow I didn't notice that you have answered my post last time. I think you are right: must be some xml problem. If so, then it is at least not my mistake. I have only overtaken the mod from an other guy and I didn't change anything related to the flag. I have tried out what I have written in my last post, result: it works now on the desktop pc, but not on the laptop.

So thats what is written in civ4artdefines_civilization.xml:

<CivilizationArtInfo>
<Type>ART_DEF_CIVILIZATION_MAGYAR</Type>
<Button>,ACR-Magyar/Art/Interface/Buttons/Civilizations/Magyar.dds,ACR-Magyar/Art/Interface/Buttons/buttons_magyar.dds,1,1</Button>
<Path>ACR-Magyar/Art/Interface/TeamColor/FlagDECAL_Magyar.dds</Path>
<bWhiteFlag>1</bWhiteFlag>
</CivilizationArtInfo>

I have already changed <bWhiteFlag> to 0 without any success. Same situation. Strange that it worked before although white flag was on (at least if I got that tag right). But I can't see any tag that could say something about shader. Must be in an other file or missing. If it is in an other file, could yoe tell me in which, please?

NikNaks
Jul 19, 2007, 12:40 PM
Well it sounds like your graphics card isn't up to scratch...

cool3a2
Jul 19, 2007, 12:49 PM
Sorry, that's hard to believe. It's true: I only have a GeForce 4, but if I convert the file with dds converter it works, but not on the laptop. If I convert it with the plugin it runs on the laptop, but not on the desktop pc. So it must be an xml problem...

NikNaks
Jul 19, 2007, 12:59 PM
Well there's absolutely nothing wrong with the XML...

Shiggs713
Jul 19, 2007, 02:32 PM
you dont need the ACR-Magyar/ for the button or the flag. Not sure if it hurts what you've done though.

actually on second thought, unless your folder structure is not standard, it probably does mess things up. everything reads from the assets folder of whatever mod you are running. so to call a icon you only need /Art/Interface/TeamColor/FlagDECAL_Magyar.dds cause there is probably no ACR-Magyar folder inside your assets folder. That is unless you have done some crazy folder structure.

The way you call the icon and the folder structure have to be identical.

cool3a2
Jul 19, 2007, 03:49 PM
I know that the structure of the mod isn't standart as well. That's also a relict of the original modder. I will ty that, but I am not very optimistic. That doesn't explain why it works when I replace the dds file...

cool3a2
Jul 19, 2007, 04:07 PM
Ok, after replacing the 1 with 0 in the xml-file as shown in one of the posts above, I started the game on the desktop pc with the flags image that was included in the previous version of my mod. I have not changed the structure of my mod. The flag is totally green now. That's logical somehow, because the flag should be red-white-GREEN with the hungarian coat of arms in the center. This supports the theory of an xml problem (in my opinion). Like I already read about that problem somewhere... Does this say anything to you?

Shiggs713
Jul 19, 2007, 05:20 PM
I dont know, you should check the tutorials on how to make flags, thats how I learned. I got a few flags working with minimal xml work, but who knows.

cool3a2
Jul 25, 2007, 11:17 AM
Okay, I have done some more work on this. This is what I found out:
Firstly: the <bWhiteFlag> needs to be 1, because I want to make a flag that is independent from the player colour. This is sincerly no secret. Secondly: I think the problem is the alpha channel. When examining the image file that works on my desktop pc with dds converter it writes that the file has no Alpha channel, the second file, that works on the laptop, seems to have one. Before I found that out I saved my image always with alpha channel in Photoshop and it only worked on the laptop. Now I tried to save it without alpha channel and, tata!, it works on the desktop pc. DDS Converter seems to drop the alpha although the "save alpha (if any)" option is switched on. Now this problem is not that serious. I will simply include two files. But now I updated the mod for warlords and I have trouble again. And again on my desktop pc that doesn't like alphas. The problem now is, that the parts of the flag that should be white are yellow now. I can not imagine where this colour comes from. I already checked my xml files but I couldn't find that my predecessor made any changes on something related. And I am sure that I did not. Player colour is green (I think this is why the flag was green once, although the players green appears to be lighter)... Any ideas?

Shiggs713
Jul 25, 2007, 11:40 AM
What civ were you? if you were Inca or Egypt, it would explain everything. That is why you always bucket paint the alpha channel black. I keep the image a 1 layer bmp until I have it the exact size and such I need it to create mipmaps (has to be at the power of 2), flags being 128*128, once the bmp is exactly how I want it, I save it as dds DXT 3 w/ mipmaps. The easiest program that I know of for this is GIMP, I have photoshop elements 5 and GIMP is better at a few things still. Once the flag is ready and in dds format, open up DXTBmp, open the dds and open alpha by double clicking. Bucket paint black and save alpha, then refresh alpha and save the dds. If you follow these instructions and still can't get it to work, then I can't help you.

AThousandYoung
Jul 25, 2007, 01:39 PM
Are you playing the French?

cool3a2
Jul 25, 2007, 05:42 PM
I play Hungary, this is what my mod is about. It adds Hungary as playable civ. As I have written in one of my previous posts the flag is totally white after saving it with dxtbmp. If this has something to do with egypt then I don't know why. If I save it with dds converter or without alpha in photoshop it works perfectly in the mod for vanilla civ on my desktop pc. In the warlords version the white parts of the hungarian flag are yellow, all other colours are alright. It's totally white on the laptop in both versions of the mod. If I use dxtbmp or photoshop (with saving the alpha) it is white on the desktop pc, no matter which version I run, but it is alright on my laptop (both versions, no yellow). So I can do anything I want with dxtbmp, it will never work on my desktop pc. I found a white flag patch for one of asioasioasios mods. It simply replaces the image file. I guess he had the same problems with white flags like I have. But I believe this a totally different problem like I have with my partly yellow flag.

Shiggs713
Jul 25, 2007, 07:09 PM
it is strange, I've never had any problems like that. BTW did asio's patch work for you?

cool3a2
Jul 26, 2007, 04:17 AM
Okay, I made some screenshots to show you the problem. And I think I know what the problem is. As you can see I tried it with an other flag too. It should be the french flag from asioasioasios white flag patch (there he only replaces the graphics files and there is an xml called civ4PlayerColorInfos.xml). In this flag it seems that other colours are also not alright. In my mod there is no civ4PlayerColorInfos.xml (Anima Croatorum, who started this mod, didn't include it and in the vanilla civ 4 mod it seems to be unnecessary). I took a look in my Civ4CivilizationInfos.xml and it saysthat the player colour is PLAYERCOLOR_DARK_GREEN. So I looked in warlords civ4PlayerColorInfos.xml and for this colour it writes:
<PlayerColorInfo>
<Type>PLAYERCOLOR_DARK_GREEN</Type>
<ColorTypePrimary>COLOR_PLAYER_DARK_GREEN</ColorTypePrimary>
<ColorTypeSecondary>COLOR_PLAYER_YELLOW</ColorTypeSecondary>
<TextColorType>COLOR_PLAYER_DARK_GREEN_TEXT</TextColorType>
</PlayerColorInfo>
In vanilla civs civ4PlayerColorInfos.xml the entry for the colour looks like this:
<PlayerColorInfo>
<Type>PLAYERCOLOR_DARK_GREEN</Type>
<ColorTypePrimary>COLOR_PLAYER_DARK_GREEN</ColorTypePrimary>
<ColorTypeSecondary>COLOR_PLAYER_WHITE</ColorTypeSecondary>
<TextColorType>COLOR_PLAYER_DARK_GREEN_TEXT</TextColorType>
</PlayerColorInfo>
I seems that firaxis has changed the file in walords. I guees the game uses the secondary colour, because there is no alpha saved in the image. I will try that... I read about a file called CIV4ColorVals.xml. It is also not included in my mod. Is it necessary?

cool3a2
Jul 26, 2007, 04:30 AM
I incuded the CIV4PlayerColorInfos.xml in my mod, added the colour COOL_COLOUR and made CIV4CivilizationInfos.xml pointing to that. And tata!

Shiggs713
Jul 26, 2007, 11:32 AM
good to hear you have it resolved.