Messing with unit palettes/civ color

Nanuk

Warlord
Joined
Jan 12, 2017
Messages
268
Location
USA
I've noticed there's a Palette= line in the unit .ini files. Can this be used to have a unit always use a specific civ color regardless of what civ builds it? Otherwise, what is it for?

I've also noticed I can change the default civ color palette of units using Flicster, but I can't seem to remove the other civ colors. Is it possible to export a .pcx with a certain default civ color, and then rebuild the storyboard using SBB to remove civ color options from the unit?

I'm trying to do this for civilizations that will have unique units, therefore no need for a civ color on the unit, and especially for civilizations with civ colors that can look weird on certain units (white cross on white shield, white coat on white shirt, red sash on red coat, etc...), or otherwise make some details of the unit washed out and very hard to see.
 
If you want to avoid/disable civ-colors, then you must modify the flc's so that they don't use the civ-spcific colors. These colors are: the first 16 indexes (in Gimp's colormap), then the indexes with even numbers up to index 64. You'll have to export to a storyboard, modifying a colormap that replaces the colors mentioned with colors not in use by the unit (for instance 00FF00), and use that to re-index the pcx. The shadows (last 16) and smoke-indexes (the last 16 before shadow-indexes) are tricky, and needs attention. You can use Gimp to re-arrange and manipulating colormaps to suit your needs, but remember to convert them from Gimp's .gpl-format to JASC .pal-format which Flicster uses. Then replace the original .pal file associated with the storyboard with your modified colormap. There is a program gpl2pal (also called gpl2jascpal) which can convert from Gimp to Jasc colormap-format. As you understand, the process of disabling civ-colors are tedious, but possible.

The PALETTE = entry in the unit's .ini-file is unknown to me. I haven't seen it used. Try to enter one of the 32 palette-numbers (form 0 -31) and see if that makes any difference. It can't do any harm, anyway.
 
The Guardian... Here are some Palette Images to show you what the Palette Slots do: ...
Click through to that post. Vuldacon has labelled the images to show which rows do what. With the new search function I wasn't able to quickly track it down, but I seem remember Vuldacon making a tutorial as well.
 
The PALETTE = entry in the unit's .ini-file is unknown to me. I haven't seen it used. Try to enter one of the 32 palette-numbers (form 0 -31) and see if that makes any difference. It can't do any harm, anyway.

I've tried messing with this. Anything entered in that section will crash the game upon loading the scenario if it is not a reference for which file to look into. However, I'm not sure what it does beyond that. I've tried having a .pal file in there, a .flc, a .pcx, etc... It doesn't do anything so far as I have tried.

And this is one quest I may end up abandoning or trying to commission someone else to do. I've spent hours following tutorials and reading posts and I'm getting nothing but messed up images and flcs. Maybe it's because every tutorial I've followed is for swapping palettes completely or removing civ-specific color regions completely. I'm just trying to recolor the civ-specific colors with a certain civ-specific color that blends with the rest of the unit's colors well. I don't want to remove it completely.

Either way. Thanks for the help, both of you. I at least learned how difficult of a task this is.
 
... therefore no need for a civ color on the unit, ...

... I'm just trying to recolor the civ-specific colors with a certain civ-specific color that blends with the rest of the unit's colors well. ...

To convert a unit to one with no civ-color means going through pixel by pixel and replacing the civ-colors with colors from other parts of the unit's palette.

To make a civ-color that blends with a unit's other colors is not done through editing the unit palette. It would be done by changing the color assigned to the specific civ, which is a completely different file.
 
To convert a unit to one with no civ-color means going through pixel by pixel and replacing the civ-colors with colors from other parts of the unit's palette.

To make a civ-color that blends with a unit's other colors is not done through editing the unit palette. It would be done by changing the color assigned to the specific civ, which is a completely different file.

Can this be done without changing the color of the civ's borders? Is it possible for a civ to have one color for borders and one color for units?

For example, is there a way to assign a civ to always use the default civ-specific color of a unit instead of the one assigned to it through the civilization files (0-31)? That way, I can just use Flicster to swap the default civ-specific color of the unit, and let other civs still use the unit and still be able to distinguish them at a glance.
 
Last edited:
Can this be done without changing the color of the civ's borders? Is it possible for a civ to have one color for borders and one color for units?

Yes. The two colors used in the borders are index nr. 64 and 65 (unless my memory is corrupted). You will have to modify the colormap in the ntpxx.pcx file that corresponds with the color-scheme "your" civ is using.

For example, is there a way to assign a civ to always use the default civ-specific color of a unit instead of the one assigned to it through the civilization files (0-31)? That way, I can just use Flicster to swap the default civ-specific color of the unit, and let other civs still use the unit and still be able to distinguish them at a glance.

You can force a certain color to a particular civ by assigning the same color as both default and alternate team color (in the editor). And what Bluemonkey says about changing the colors pixel by pixel is not correct. There are easier ways, but it's still tedious. You'll have to export the storyboard, change it to RGB-mode and back again to indexed, but restrict the number of indexes to 216 (256 - 40). Then you'll have to add the 40 "missing" indexes and use a color not present in the unit on these. Then it's the tedious job to use Gimp to re-arrange the colormap so that the civcolor-indexes are occupied by the "new" 40 colors not present in the unit. Also, the indexes for smoke and shadows has to be placed in the right positions (indexes). I must add that I have never removed civcolors myself, just added them, but I believe it is do-able if you put the time and effort into it.
 
Is there a missing step there? After you've changed modes twice, expanded the index and rearranged the color map wouldn't you need to change the individual colors at the indices which are still the (originally) civ-color visible in the unit in order to have them blend with non-civ-colored parts of the unit? For example, dragging blue around the color map to change indices doesn't remove blue from the unit. Come to think of it, why is the step of changing mode to RGB being done? Why not just change indices and edit colors?
 
If you export the storyboard with forced colormap 0 (the one barbarians use), there will be no blue (or whatever placeholder-colors originally used) on the unit. You can of course export with civcolor 1 (red) if you want the civcolorless unit to appear red, or choose whatever color you like. As long as the colors that were originally assigned to civcolor-indexes are moved elsewhere - and civcolor-indexes are filled with unused colors, you will have gotten rid of the civcolors. Also, if all the original flc-files uses the same colormap, you only need to do the re-arranging once, and afterward re-index with the (saved) colormap you just created. If each flc has it's own unique colormap, you might need to re-arrange the colormap for each file.

By changing to RGB and back, you force Gimp to reduce the palette to only 216 colors. Gimp will choose the best composition of the available "color-slots". It's just way faster to let Gimp do it, compared to manually selecting the available colors and removing the surplus colors (40 colors if the original file used all 256 color-slots). It would probably be too few slots for smoke and shadow, so chances are that the pallette needs to be reduced to less than 216 to keep these 32 indexes "free". As mentioned, it's not straightforward nor easy, but do-able.
 
Last edited:
There are easier ways, but it's still tedious.

As mentioned, it's not straightforward nor easy, but do-able.

So which is it? Easier than the method I suggested? Or not as straightforward or easy as the one you say is wrong? I must be missing something because if both methods (pixel work vs. mode switching, re-indexing and colormap manipulation) are tedious then what is wrong with sticking with the original palette, selecting pixels by color & filling with another color?
 
If he wants a unit WITHOUT civcolors - then the indexes reserved for civcolors must contain a color NOT in use (I hope we agree on this). You can accomplish that by changing civcolor-pixels into non-civcolor-pixels - pixel by pixel in each frame for each direction - and for each flc-file (providing you hav "free" unused indexes). If you on the other hand manipulate the colormap, you dont have to change all these pixels (and it's a LOT of pixels!). The pixels are already defined in the storyboard by their index-position. This means it is far more reliable to select them based on their index rather than their color-match hit in Gimp - with "Select by color-tool" or "fuzzy select". I have used Gimp extensively, and these tools are a good help when ADDING civcolors to a unit (when the civcolor-indexes are to no help at all). When the civcolors already are clearly and unambigious defined, why not take advantage of that information? It's nothing wrong to discard the information that the indexes represent, but you'll probably get the task accomplished much faster with colormap-manipulation. As I said - if you make the colormap-modifications and gets it right, you can use it on the rest of the unit's flc-files. Your method means that you probably will have to do the same pixel-pushing for every 120 (+/-) single frames in every flc-file.

I prefer to have clearly visible civcolors, so I have never removed them. I just try to give advice on what I believe is the easiest way. Not "easy" but "easiest. Still not at all straightforward.
 
There is no need to create " 'free' unused" indices. The point is to replace civ-color with other colors already used in the unit, and these are already present in the color map. After testing on a few frames to find which colors work best the process of swapping colors can be done in larger groups. Some people may find it simpler to use this method.

In other words - as you've said yourself in your most recent post - it's a matter of preference and belief rather than right and wrong.
 
Last edited:
Brilliant! You do it your way. All I said, is that I belive it's easier to do it in an different way than you. I responded to this thread to try to give Solborn an answer. You're the one who hijacked the thread and claimed the ONLY way was through pixel-pushing rather than colormap-manipulation (your post #5). Do whatever you like - I don't really care. Hope Solborn got help despite this fruitless bickering. End of discussion, please.
 
Solborn... Perhaps these Unit Palette Images will help you.

The Unit Palettes use indexes, meaning each Color slot that is applied to each pixel on the Unit from the color slot sections on the Unit Palette are "programed" to do specific things... Civ Specific Colors, Unit Colors, Shadow, Smoke, Fog Translucent colors, Shadow Translucent Colors and the Totally Transparent Color for the Background.

If you want to change the Civ Specific Colors for a Unit so they are Not Civ Specific, Your Unit cannot have any Colors used in the Civ Specific Colors Slots on the Unit Palette. This means going through several procedures to accomplish the task.

In the end, The Civ Specific Colors will be Blocked Out by using a Color that your Unit does Not use such as Pure Green.

The thing to know is that this means the Unit will not have as many colors because your Unit will not be using any Civ Specific Color Slots on the Unit Palette.

You also have to make a New Palette and apply it to all Storyboards then generate the New Flcs.

Unit .Pal Palette.png
 
I've noticed that unit32 files are indexed. I've tried finding if doing something as simple as flipping the image horizontally will mess up what colors get assigned to what pixels. I haven't seen any issues in the game thus far, but I just want to make sure this isn't something that will pop up later in the game like I've heard some people having issues with (unit 32 specifically). Although I've read those issues are mostly due to people not lining up the unit icons properly in the icons.pcx file.
 
The unit32 does use reds for civ colors though, so if you stick an image in there, you may get incorrect civ colors showing for the unit on the city build screen. E.g. if you have a unit wearing red clothes, with blue civ colors, if you simply resize and insert into the unit32, the red clothes will show as the civ colors.

Some programs are easier than others to modify palettes. I use a really old version of photoshop, and TilesetPal (free, for easy palette manipulation), and both of those are pretty easy to use for palettes once you get used to them.
 
The unit32 does use reds for civ colors though, so if you stick an image in there, you may get incorrect civ colors showing for the unit on the city build screen. E.g. if you have a unit wearing red clothes, with blue civ colors, if you simply resize and insert into the unit32, the red clothes will show as the civ colors.

Some programs are easier than others to modify palettes. I use a really old version of photoshop, and TilesetPal (free, for easy palette manipulation), and both of those are pretty easy to use for palettes once you get used to them.

Thanks for the tip. I've mostly copied and pasted the unit32 icons. There's a few units icons that I've flipped horizontally, but that's it. I don't think this has any effects in-game for the couple of civs I've tested it with.
 
Yes. The two colors used in the borders are index nr. 64 and 65 (unless my memory is corrupted). You will have to modify the colormap in the ntpxx.pcx file that corresponds with the color-scheme "your" civ is using.

Do you use something other than Gimp to do this? The ntpxx files all look blank when I open them up.
 
I use Gimp. Remember to activate the colormap-dialog in the toolbox. The ntpxx.pcx-images is only one pixel, but it contains a full 256-color colormap. If you have activated the colormap-dialog in the toolbox, you should be able to inspect the colormap and change the colors in the various indexes - in addition to re-arrange the whole colormap (right-click menu). But beware! Gimp will allow you to exceed 256 colors in the colormap - Civ3 can't use pcx-files with too many indexes.
 
Top Bottom