iggymnrr
Deity
- Joined
- May 20, 2003
- Messages
- 2,298
Team-colored and multicolored flags for Civ IV can be done on a Mac. This tutorial is designed to get artwork you have or have in mind onto the flags/banners each unit carries in vanilla Civ IV and Warlords. Flags use the .dds extension and display graphics differently than buttons. A DDS converter like Squish works admirably for buttons but not very well for flags. After some searching I found Aorta 2.0, available here: http://sourceforge.net/projects/aorta, that got my flags working. It's an alpha release of a project currently in beta development. Availability may change in the future but as of today, 3-27-2009, you can still get it in Windows and Mac OSX versions. However, it comes with no documentation. A curious byproduct of this tutorial is that you may come away with a better idea of an alpha channel even though we won't use one.
Aorta watch: The download has moved forward to Aorta 2.0aWe will make 6 flags in this tutorial. That's a lot of ground to cover so I will make the graphics quickly. My intent is to help you get your artwork to .dds format so that your flags work not to help create artwork. You may simply read over the next three paragraphs as I will make more graphics than is necessary. (This is the part of a tutorial where only the author completes in full.
) I will use a number of Mac applications and pick file formats at random to demonstrate multiple ways of making flags. Take note that I am creating a number of seemingly useless WHITE or BLACK graphics. Final assembly of all 6 flags will take place using Aorta after the graphics have been created. As a preliminary step I create a "tutorial" folder on my desktop to collect my flag graphics. Then I create two subfolders inside this for the finished flags, one for "team-color" and the other for "multicolor."
Link: Detailed artwork creation and making flags in Windows How to Create Flags for Civ4Photoshop: I will make the pieces (3 total) for 2 simple team-colored flags, the default color scheme in Civ IV. There are the only two colors to use for team-colored flags, black and white. On an RGB color palette that would be 0,0,0 and 255,255,255. Open a new 128 X 128 document with a WHITE background. Immediately save this new document as a bitmap, naming it white.bmp, into the tutorial folder. Now select a paintbrush, 20 pixels or so, and draw the letter "C" -- for Civilization -- in BLACK on the canvas. Choose "Save as" (not "Save") from the file menu and name this c_alpha1.bmp. Now from the Select menu, select "All" and go to the Image menu/Adjustments menu and select Invert. The white and black on the canvas swap. Now "Save as" c_alpha2.bmp. Close Photoshop.
Tip: Use only black-and-white artwork for team-colored flags.Gimp: I will make the pieces (4 total) for 2 multicolored flags. Open a new 128 X 128 document with a WHITE background. I really want BLACK but that is not an option. So select "All" from the Select menu, over to the Colors menu and select "Invert." Good, a BLACK square. Now select "Save as" from the File menu, name it black_alpha.jpg, click on "File Type" and select JPEG. Save this in the tutorial folder. Now select "Save as" again, repeat the process to save black_alpha.jpg as a black_alpha.png. Navigating in Gimp is tricky. I close this document from the File menu and open a US flag I got off the internet. Then I rotate it 90 degrees, crop a square -- crop tool is in the Transform Tools under the Tools menu, scaled it to 128 X 128 and saved it as us_flag.jpg. Next, I did the same thing for a Union Jack flag saving it as union_jack.png. Close Gimp and X11.
iPhoto and Photoshop Elements: I will make the pieces (3 total) for the last 2 multicolored flags. I used iPhoto '08, found 2 photos, edited them and cropped a square portion from them. While using the crop tool, I checked "Constrain" and, from the menu next to that box, selected "Square." This made it easy to get a square but after iPhoto saved my changes I hit the info button and the dimensions were off by 1 pixel (1131 X 1130). Hmmm. Then, in the main window with all the pictures showing, I selected each of the 2 pictures in turn and exported them as TIFFs to my tutorial folder. They were named julius_doe.tif and sphinx.tif. iPhoto automatically scaled them to 128 X 128 on export. (This option is found in the export pane by selecting "custom" in the "Size" option -- set max dimension to 128.) Photoshop Elements was on standby by just in case the exported TIFFS were off by a pixel. Then I used Elements to create a black_alpha.tif using the same technique for my black_alphas in Gimp. Close iPhoto and Elements.
Reminder: Flag graphics have to be 128 X 128.TEAM-COLORED FLAGS: Launch Aorta 2.0. You will see a number of buttons and 2 white boxes. Click the "Load Normal" button, navigate to white.bmp and open it. Next click the "Load Mask" button, navigate to c_alpha1.bmp and open it. You should see something like this:
Before hitting the "Save as" button, I wish to emphasis the box on the right. For each of the 6 flags we make, the graphic we load there will have the the word alpha in it. Now click the "Save as" button, rename it c.dds, navigate to the "team-color" folder, hit save and you see DDS Options. Make sure the DXTC box is checked but not the Mipmaps box. Click ok. We'll finish the other team-colored flag after we make a multicolored flag.
MULTICOLORED FLAGS: Now click the "Load Normal" button again, navigate to us_flag.jpg and open it. Next click the "Load mask" button, navigate to black_alpha.jpg and open it. You should see something like this:
Again, notice the right box. There's no color. (Black or white don't count.) If you were to make these flags in a program that used RGBA --and could convert directly to dds-- what would you guess the alpha channel would look like? The box on the right in Aorta. We haven't used any alpha channels while making our flag graphics. However, in the DDS files we've created, an alpha channel may exist. Depending on a computer's graphics capabilities, our flags may not work. This might not be a problem on the Macintosh platform. My old mac, an original mini, has no problems despite the fact that its not supposed to even run Civ IV but does anyways. However, if you plan on publishing a mod, you may encounter this problem. Consult with other modders who have tackled this. Now click "Save as" button and put us_flag.dds in the "multicolor" folder. Finish the other 4 flags using this list -- don't forget to save:
We will try out these new flags momentarily. Notice, however, that I've matched graphic formats in the list above. This may not be necessary using Aorta but it illustrates one thing. All we have really done to make our flags is split an RGBA graphic into two pieces. We've had to do this in order to convert to DDS.
Quick Guide for Making Flags with Aorta:
My primary color is green and my secondary color is blue. I like the second flag better. I really didn't have to create a second piece of artwork to get this flag either. One look at the first flag and I'd go back to the original and invert the colors, save normally and remake the flag.
Tip: To swap the colors of your team-colored flags, invert the colors of your artwork.
To get the multicolored flags to work, I go my mod, locate the CIV4ArtDefines_Civilizations.xml, find my civilization and change the 0 to a 1 on this line: <bWhiteFlag>1</bWhiteFlag>. Its like flipping a switch, going from team-colored mode to multicolored mode. (There may be another way to do this -- globally, for all civs at once and not just one.) Now let's test our 4 multicolored flags. As you can see in the picture above, the flags turned out well. The first photo flag was selected as an example of what not to do when choosing a photo -- too busy. I named it julius_doe since it is the place where Julius Caesar was assassinated. You might be able to make out some columns, a stone flooring and steps with modern Rome growing up around it. The sphinx-pyramid flag brings back memories of a Civ inspired vacation.
Tip: To change from team-colored mode to multicolored mode "flip the switch" in your mod's CIV4ArtDefines_Civilization.xml.
Question: Can you now make flags on your Mac?
Answer: I know what your thinking, "Did he use 6 Mac apps or only 5." To tell you the truth, in all this writing I kind of lost track myself. But being as this is Civilization, the most powerful computer game in the world, whose fascinating strategies will blow your head clean off, you've got to ask yourself one question, "Do I feel lackadaisical?"




iPhoto and Photoshop Elements: I will make the pieces (3 total) for the last 2 multicolored flags. I used iPhoto '08, found 2 photos, edited them and cropped a square portion from them. While using the crop tool, I checked "Constrain" and, from the menu next to that box, selected "Square." This made it easy to get a square but after iPhoto saved my changes I hit the info button and the dimensions were off by 1 pixel (1131 X 1130). Hmmm. Then, in the main window with all the pictures showing, I selected each of the 2 pictures in turn and exported them as TIFFs to my tutorial folder. They were named julius_doe.tif and sphinx.tif. iPhoto automatically scaled them to 128 X 128 on export. (This option is found in the export pane by selecting "custom" in the "Size" option -- set max dimension to 128.) Photoshop Elements was on standby by just in case the exported TIFFS were off by a pixel. Then I used Elements to create a black_alpha.tif using the same technique for my black_alphas in Gimp. Close iPhoto and Elements.

Before hitting the "Save as" button, I wish to emphasis the box on the right. For each of the 6 flags we make, the graphic we load there will have the the word alpha in it. Now click the "Save as" button, rename it c.dds, navigate to the "team-color" folder, hit save and you see DDS Options. Make sure the DXTC box is checked but not the Mipmaps box. Click ok. We'll finish the other team-colored flag after we make a multicolored flag.
MULTICOLORED FLAGS: Now click the "Load Normal" button again, navigate to us_flag.jpg and open it. Next click the "Load mask" button, navigate to black_alpha.jpg and open it. You should see something like this:
Again, notice the right box. There's no color. (Black or white don't count.) If you were to make these flags in a program that used RGBA --and could convert directly to dds-- what would you guess the alpha channel would look like? The box on the right in Aorta. We haven't used any alpha channels while making our flag graphics. However, in the DDS files we've created, an alpha channel may exist. Depending on a computer's graphics capabilities, our flags may not work. This might not be a problem on the Macintosh platform. My old mac, an original mini, has no problems despite the fact that its not supposed to even run Civ IV but does anyways. However, if you plan on publishing a mod, you may encounter this problem. Consult with other modders who have tackled this. Now click "Save as" button and put us_flag.dds in the "multicolor" folder. Finish the other 4 flags using this list -- don't forget to save:
- "Load normal" white.bmp, "Load mask" c_inverted.bmp (team-colored)
- "Load normal" union_jack.png, "Load mask" black_alpha.png (multicolored)
- "Load normal" julius_doe.tif, "Load mask" black_alpha.tif (multicolored)
- "Load normal" sphinx.tif, "Load mask" black_alpha.tif (multicolored)
We will try out these new flags momentarily. Notice, however, that I've matched graphic formats in the list above. This may not be necessary using Aorta but it illustrates one thing. All we have really done to make our flags is split an RGBA graphic into two pieces. We've had to do this in order to convert to DDS.

- Team-colored flags: Black-and-white artwork on the right, white graphic on the left.
- Multicolored flags: Artwork on the left, black graphic on the right.
My primary color is green and my secondary color is blue. I like the second flag better. I really didn't have to create a second piece of artwork to get this flag either. One look at the first flag and I'd go back to the original and invert the colors, save normally and remake the flag.

To get the multicolored flags to work, I go my mod, locate the CIV4ArtDefines_Civilizations.xml, find my civilization and change the 0 to a 1 on this line: <bWhiteFlag>1</bWhiteFlag>. Its like flipping a switch, going from team-colored mode to multicolored mode. (There may be another way to do this -- globally, for all civs at once and not just one.) Now let's test our 4 multicolored flags. As you can see in the picture above, the flags turned out well. The first photo flag was selected as an example of what not to do when choosing a photo -- too busy. I named it julius_doe since it is the place where Julius Caesar was assassinated. You might be able to make out some columns, a stone flooring and steps with modern Rome growing up around it. The sphinx-pyramid flag brings back memories of a Civ inspired vacation.

Question: Can you now make flags on your Mac?
Answer: I know what your thinking, "Did he use 6 Mac apps or only 5." To tell you the truth, in all this writing I kind of lost track myself. But being as this is Civilization, the most powerful computer game in the world, whose fascinating strategies will blow your head clean off, you've got to ask yourself one question, "Do I feel lackadaisical?"