How to create flags for civ4 - for dummys :)

Just a short thought (I only have some minutes): I had this problem if I tried to add a multicolour flag, but having 0 as value of the <bWhiteFlag> tag (see tutorial). Try to set it to 1.
 
Tried that already-though cheers. I think I will endeavour to figure out how to get the GIMP plug in plugged in and then if it works then at least i know it's probably the DDS converter. And if the GIMP plug in doesn't work then probably i have gone wrong somewhere. If that makes sense? Anyway thanks:)
 
As far as I remember I had no problems with installing the plugin for GIMP. I could come back to that tomorrow and try to give you some hints about how to install it. Besides of this you could post your xml or at least the parts that are of interest here. These files would be CIV4ArtDefines_Civilization.xml, CIV4PlayerColorInfos.xml and CIV4CivilizationInfos.xml. I'd like to take a look at them. You may be right that it is a Vista specific problem, on the other side such effects can be caused by mistakes in the xml's as well. Just like to exclude some possibilities. At the moment I also can't think of a good reason why a flag file shouldn't work with Vista... Hmm... need to think about that. If the xml's are fine and you aren't able to fix the problem by using GIMP, you could post this problem in the main Civ4 Creation and Customization section. There more people may notice your problem. If you do so, it would be a good idea if you would refer to this thread in your post. This way the other users can read what we have already discussed here which would save you and him time. Also, it would be cool to collect more information about flags here. I don't know if we'll find a solution for this, but at least I could list this as known problem, so others won't wonder if they get the same problem.
 
Hi just found your reply and thanks for the excellent feedback. Here are the XML files from the modular civ that i made.

<Civ4ArtDefines xmlns="x-schema:Thule_CIV4ArtDefinesSchema.xml">
<CivilizationArtInfos>
<CivilizationArtInfo>
<Type>ART_DEF_CIVILIZATION_THULE</Type>
<Button>Modules/Custom Civilizations/Thule/BTN_Tribal_5.dds</Button>
<Path>Modules/Custom Civilizations/Thule/Flag_Decal_Thule.dds</Path>
<bWhiteFlag>1</bWhiteFlag>
</CivilizationArtInfo>
</CivilizationArtInfos>
</Civ4ArtDefines>

<Civ4ColorVals xmlns="x-schema:Thule_CIV4InterfaceSchema.xml">
<ColorVals>
<ColorVal>
<Type>COLOR_X_BLUE</Type>
<fRed>0.53</fRed>
<fGreen>0.81</fGreen>
<fBlue>0.98</fBlue>
<fAlpha>1.00</fAlpha>
</ColorVal>
<ColorVal>
<Type>COLOR_PLAYER_DARK_YELLOW</Type>
<fRed>0.97</fRed>
<fGreen>0.75</fGreen>
<fBlue>0.0</fBlue>
<fAlpha>1.00</fAlpha>
</ColorVal>
</ColorVals>
</Civ4ColorVals>

<Civ4PlayerColorInfos xmlns="x-schema:Thule_CIV4InterfaceSchema.xml">
<PlayerColorInfos>
<PlayerColorInfo>
<Type>PLAYERCOLOR_THULE</Type>
<ColorTypePrimary>COLOR_DARK_YELLOW</ColorTypePrimary>
<ColorTypeSecondary>COLOR_X_BLUE</ColorTypeSecondary>
<TextColorType>COLOR_DARK_YELLOW</TextColorType>
</PlayerColorInfo>
</PlayerColorInfos>
</Civ4PlayerColorInfos>

Not sure if this will help but please take a look yet I think my paths are correct.

I think you are right I should start my own thread on this issue if it is indeed a vista issue.
 
Hmm... that looks okay to me. If you are refering to PLAYERCOLOR_THULE in your CIV4CivilizationInfos.xml then there should be no problem with the xml. As you wrote that your flag is plain blue in civ4 and as blue is one of the colours you are using for your civ, I guess the reference in CIV4CivilizationInfos.xml is correct, too. You could upload your flag. I could try it out with my copy of civ4 under XP and check it for alpha channel problems. Unfortunately I think it will work for me and thus you would be right with assuming it is a Vista related problem. Then all you could do is writing that post I mentioned last time and / or using a bicolour / teamflag. Latter should work as you haven't reported any problems with the default civ4 flags (which are teamcolour flags). A tutorial describing the creation of such flags will be posted here soon.
 
Ok that's sound advice. I can't attach dds files from my computer to this thread but i have attached two flags each saved with different alpha channel settings like you advised in the initial tutorial. Please take a look and if thay don't work for you then i know it's me going wrong. I do keep saying this but i am not great on computers! Lol. I'll look out for any of your other tutorials too my custom civs would be so much better with custom flags. Thanks for your great feedback again.:)
 

Attachments

Those files are strange indeed. I don't know if this is what you did, but you simply could rename your flag files from *.dds to *.bmp and then upload them here. This way the files will pass the civfanatics' "file check". After downloading your files I could then rename them back to dds. However, I took a look at your files with dds converter and GIMP, finally I included them into my mod and tried them out in civ4. Dds converter was unable to display the images at all, but at least it didn't crash. GIMP opens both files without problems. That sounds good, but actually it isn't if those files were meant to be dds files with alpha channel. In this case GIMP should have imported something weird (because the import script isn't working perfectly I think). In GIMP both of your files look identically. Both contain an alpha channel, which is good. But the alpha channel is white in the channel view (should be black there) and in the alpha threshold menu the threshold value is 127. There, you should set it to 255 and export it to dds. All your channels should become black then and the image itself will turn into a grey-white squared plain, that's normal. That's why I wrote you should make a bmp backup of your file first for the case you'd like to make changes to your flag later. Also, it may be that your system wants to have the file without alpha channel. In this case you could later open the bmp backup, simply remove the alpha channel if there is any and then export it as dds. Just to have it complete: currently your flags both appear plain white in the game. As my secondary colour is white, that could be the same effect you have encountered on your system. It would also make sense as in case of bicolour flags the alpha channel controls which parts of the flag should be painted in the primary and which should be painted in the secondary colour. It does that by assigning either a white or a black alpha channel to the pixels making the complete alpha channel consisting of black and white areas only. If the alpha channel is completely white, it could be that the secondary colour is assigned to the complete flag, ignoring the original image informations of your flag.
If these files weren't your final flags and you think your dds should be fine, please upload them again (using the trick I mentioned above) and I'll have a second look at them.

If you still have problems with the dds plugin for GIMP, let me know. Then I'll have a look at this in order to help you installing them. I hope the plugin is Vista compatible...

I also had a small search for Civilization 4 under Vista. I found a civfanatics thread with a bunch of Vista problems, but more related with starting the game at all. However, if there is still a problem with your files, you could try to update the drivers of your video card. I could imagine that its Vista driver is buggy. But in this case you are taking the risk that civ4 doesn't work for you at all anymore as it seems that can happen easily under Vista.

BTW: If you want I can fix the flag for you, but it would be in your interest if you would learn the procedure for the case you are makin another mod in future (of course this suggestion is only of interest if your dds are really buggy).

EDIT: If you found something is unclear in the tutorial, or even confusing, just let me know. I'll then do my best to correct this.
 
The fact that both my flags are identical is very puzzling because they were not meant to be. When i went back to my GIMP files i reloaded them both and yes they were the same? I re did the whole process and i soon realised that after i was using the threshold layer put to 255 everything as predicted turned black after i press "OK". I then have to save it as a BMP and then as a dds with dds converter 2.1.

When i go back in to GIMP, the art files are identical? Am I doing something wrong because why are they identical after i have added an alpha channel plus threshold alpha to 255? It doesn't want to save these changes or i am missing something.

I had earlier assumed that the dds converter may be at fault but i now think it could be GIMP (or maybe me!).
 
I tried renaming these files but that isn't working, by default it is calling these files "Flag_Decal_Thule.bmp.dds" so therefore even after i rename it it is not uploading. Your feedback has been helpful you seem to be taking everything in to consideration appreciate that but as yet i do not have the GIMP plug in. When i do will it make a difference? Not sure, if it doesn't i'll get hold of paint shop possibly. Currently on my easter break won't have much time from Monday to worry about stuff like this (unfortunately) but you have definately giving me a lot of food for thought on this issue.
 
You could then zip your files. Zip is an allowed filetype on civfanatics. I don't know if paint shop (pro?) would help you (probably doesn't support dds files), Photoshop would (also only with a plugin). If you used dds conveter so far, I wonder that it created such files. Maybe a vista compatibility problem. If you'd try GIMP, you'd have a step-by-step guide about how to create a flag at least. That would make things a bit easier, I think. Also, I'll have a look at the plugin issue of GIMP tomorrow. I'll try to write something about its installation.

EDIT: Missed your first post. I am pretty sure that your problem is, that you save your files as bmp. This makes your changes disappear, possibly because they are not supported by the bmp format. Actually I wondered that there was an alpha channel at all after loading your bmps. Alpha channels are related with transparency (which is why the options about the alpha can be found under transperency in GIMP) and it would be something new to me if bmp's support transparency, thus no need for an alpha channel. On the other side dds converter should be able to convert bmp's to dds correctly, no matter if there is an alpha channel or not. I never had problems with that functionality of dds converter... Maybe you could post some screenshots with your settings in dds converter.
 
Aha, i have managed to workout how install to the GIMP plug in. Have not had chance to use it yet though. Anyway I have also been on the DDS converter forums and i spoke to someone in the know apparently. DDS converter (any version) is NOT compatible with VISTA. Also (and this i didn't know but I'm sure other people on the CIv forum do) Vista is to be superseded by Windows 2007 in October i think. However my source might be wrong. On the dds converter forum it was decsribed as the BETA max of computing (very reassuring?) althought that is just opinion. I will also get back with my progress on the flag situation using the GIMP plug in and your last reply made a lot of sense as regards to the saving issue. Hopefully all of this should be ironed out soon. Thanks:)
 
After all my ramblings and your sound advice I have at last managed to make a custom flag that works in game! The problem was the DDS converter after all. Gimp plug in works a treat. Do you think however that I should start a thread in the main creation forum warning Vista users not to download DDS converter? I can now make civs with at least some artistic input from myself- cool. Thanks:)
 
I don't see any reason why you should start a thread only to warn other vista users from downloading dds converter. After a short time your thread will "disappear" anyways, because it got pushed down the list by more up-to-date threads. Instead I'll mention that problem in my tutorial with the next update. I thought about a section about known issues and alternative programs anyways.

Your source is right about Windows 7, although I don't know when exactly it will be published, but it'll probably this year. It looks like he was also right about dds converter.
 
With another delay of a week I finished the non-decal flag part and the appendix. I also corrected the usage of the terms decal and non-decal. Maybe I'll upload two more screenshots tomorrow, I'll see.

Also, I added a hint to the appendix that dds converter isn't Vista compatible.

Feel free to comment, to give suggestions for improvements and error corrections.
 
Hi cool3a2,
I'm trying to create my first flag, a decal one, and this is my problem (sorry if my terminology is not accurate):
following your guide and painting something with the Paintbrush Tool of Gimp, everything is ok.
But if I copy-and-paste a picture (totally white with trasparent background) from another image file (i.e. a .psd file), I do something wrong and the primary color (trasparency) of the resulting flag appears black in the game. I think it is so because I don't paste only the painted pixels, I paste the whole layer on it (in other words I paste the trasparency too). I don't know how to prevent this; I've tried to select only the painted pixels (using the Fuzzy Selection Tool) and then to paste them but it doesn't work: the pasted picture is always a squared layer and if this layer is smaller than the 128x128 Alpha Channel, Gimp returns me error messages when I try to save the picture as .dds:

DDS: It appears your image may be a volume map, but not all layers are the same size, thus a volume map cannot be written.

and when I select the compression format (DXT3):

DDS: Cannot compress images whose dimensions are not multiples of 4. Saved image will not be compressed.

I have attached here the source picture (.psd); maybe it can be useful; I use Windows XP SP2, Gimp 2.4.7 and Photoshop 5.5 for first step editing (I know it's a very old version..)

Thank you for your help!
10lire
 

Attachments

That's a bit weird in deed, but I found a solution. The reason is similar to what you have assumed it to be: when you copied the selection into your prepared picture, your selection was smaller then 128x128 pixels. That's why you got those rectangles in the game. The inner rectangle is the pasted image. When you saved the image the content of the pasted selection got lost. This is also why GIMP is throwing the size error at you. Seems like GIMP knows the image itself (in your case 128x128 as you said) and its layers (in your case not 128x128). For our purposes they all need to have the same size and I guess it is better to reduce the layers to one as last step. To solve the problem you have to...
a) make the pasted selection have the right size, either by making the backround picture smaller or the selection bigger (by resizing or by filling the surounding area)
b) combine all layers to one

Do the following: open the psd. You'll see two layers in the layer view and in the main window a smaller "selection" (it's actually not, it's the layer) inside the picture. Right-click on one of the layers in the layer view and select merge visible layers. In the opening window I checked "discard invisible layers" but you may try to skip this. Click on okay, there should be only one layer now. Now we get the pasted images size to 128x128. Right-click on the layer again, this time click Layer to image size. That's all. Hope that helps.
 
Yeah, dds converter showed the same, but I think it should be plain white there. Maybe something with the alpha channel... I'll take a look at that when I come home.
 
Okay, I think I found the solution. I guess the problem was that either the colour of the image itself (transparent backround in the "finished" file) was black or that the alpha treshold was set incorrectly. Anyway, to fix your image, do the followng:
- create a new file, plain white, size 128x128
- proceed with valid alpha channel creation - see tutorial: create alpha channel, set threshold (push the bar in the threshold window to the right -> the complete image should turn transparent)
- change to your buggy flag (I used the dds, import worked without problems), with the fuzzy selection tool select the parts of the head and copy the selection (CTRL+C on your keyboard)
- change back to the new flag and paste the head via CTRL+V
- reduce layer count to one: in the layer view you should see an ordinary layer and a "floating selection (pasted layer)", right-click on the floating selection and select anchor layer
- save the new file

I had no time to try the file with the game, but with dds converter it looked valid. I would wonder if it wouldn't work.
 
Back
Top Bottom