Unit32 and palette

Steph

Multi Many Tasks man
Retired Moderator
Joined
Sep 1, 2002
Messages
18,162
Location
Pont de l'Arn, FRANCE
I've just realized the Unit32 for my mod is not very nice, as when I copied unit32 file from Sandris into it, as the palette are not the same, it gets a little ugly...

First, the standard unit32 file seems to have mostly red colours, and very little blue.

Second, Sandris used "blue" as civ colour instead of red in his unit 32.

I was wondering how you handle this.

Do you keep the default palette of the unit32? Do you make another one with more colour so copy & pasting various unit32 into it works better?

Or do you change the individual unit32 before copying them into the big one?

Do you try to have civ coloured unit32 or forget about it?
 
I don't really bother with Unit32 but if I did, I would handle it as I handle my resources.pcx:

I manage a 'master' resources file in full RGB colors. When I need to generate a new resources.pcx for one mod/scenario, I hide the resource I don't need (there are several layers in the master file), I decrease the colors to 256 (with magenta and green as the last colors) and save it as PCX. Like this, I always have the maximum colors I can have for all resources used.

For the civ-colors problems.. Perhaps you could put every Sandris unit32 in the same layer and replace blue with red on this layer only. There is probably a way to keep the gradient of colors intact (color to alpha with a red background behind in GIMP ?).
 
If the unit32 had no civ colour, it would probably work well, I could make a RGB large palette for copy & paste, and then reduce it later. But as some indexes are used for civ colour, I cannot do a simple colour reduction.
 
I don't know how many slot are reserved for Civ-colors in the palette. Let's say it's the last 14: You'll have to reduce your 'master' file to 240 (256 - 14 - 2 for magenta/green). The last 16 slots, you can probably import them from another unit32 palette.
 
What are the civ colour in ther unit32? Only the first 15? Is there somewhere a unit 32 palette available with the civ colour correctly in place, and a lot of other colours (blue, green, yellow, etc). A kind of "fits all" palette?
 
I've created my own "Sandris pallette" for Paintshop Pro. I load it into the Sandris units prior to adding it to my units32 and it changes the blue into red. Simples!!
 
Steph... Change the individual Unit images before pasting them on to the Main units_32.pcx file.
yes, always use the Civ Specific colors because most units use them.

IF the CIV Specific colors were changed to Blues (Top 4 Rows in PSP), you may be able to simply apply the Normal Red units_32 color palette and Maintain Indexes. After that, you can copy and paste the images on to your Normal Red units_32.pcx file.
...IF other colors were changed in addition to the Civ Specific colors, you could make a new palette.

More difficult to write than to do but here goes.
Series of steps:

1. Place all of the Original unit images that originally used the same Blue Civ Specific Color Palette on their own separate file. Set the File to 16 Million Colors before pasting the images on to it. (Do Not Use the images that were copied and pasted on to your units_32 file because those images were no doubt changed in that process of using a different color palette.)

2. Place all of the Original unit images that used the "Normal" Red Civ Specific Color Palette on their own separate file. Set the File to 16 Million Colors before pasting the images on to it.

Now you have Two files of All unit images that appear as they were first made.

4. IF the CIV Specific colors were change to Blues for #1 above, first apply the Original Blue units_32 color palette they use. (Apply the palette to "Nearest Color matching")... then apply the Normal Red units_32.pcx color palette and Maintain Indexes. That should correct all images to the RED Civ Specific Color Palette. Save this File as "Original Blue" or what ever you want to name it... just as a Back Up File.

5. Apply the Normal Red units_32 color palette to #2 file above and (Apply the palette to "Nearest Color matching"). Save this File as "Original Red" or what ever you want to name it... just as a Back Up File.

6. Copy Both #1 and #2 Files onto One File with the same Red units_32 Color Palette and save the File for use later. Name it "File One" or what ever you prefer. You will be using this file again after making a new palette.

7. Open the color palette for "File One" and Change all of the CIV Specific Colors, the Frame Line Color and Background color to Black. (Top 4 Rows and Bottom last 2 Color Slots in PSP). This will remove the CIV Specific Colors from all images, leaving Only the Other Colors used. Save that Palette as "No Civ Color" or what ever you want to call it.

8. Reduce the Colors to 190 Colors.

9. Open the Palette so you see it on screen and Take a Screen Shot Alt+ Print Screen.

10. Close the On Screen Palette and Press Ctrl+C to have a New Image of that Palette and Save that Image as "New 32 Colors" or what ever you prefer to call it. Save this image as a .bmp because that provides most accurate colors.

11. Open Pedit Palette Editor and Open the Original CIV Game Red "units_32.pcx" Palette. Open the "New 32 Colors" .bmp image you saved and Copy all 190 Colors to the Palette starting after the Top 4 Rows of Civ Specific Colors.
...This will leave all Civ Specific Colors and the Last 2 Colors on that Palette.
...Save this Palette as "New_units_32" or what ever you prefer to call it.

12. Open the "File One" from step #6 above and apply the New Palette to it. Use "Nearest Color Matching" when applying the palette.

Just so you know...The Last 2 Color Slots are for the Background and Frame Lines and are Transparant.

Note: IF you get CIV Specific Colors mixing in where they should not be, you will need to make 2 palettes from your "New_units_32" palette. One with just the 4 Rows of CIV Specific Colors and last 2 color slots on it and another with No Civ Specific Colors. You would use the same "File One" file for separate procedures.

By applying the Palette with only the Civ Specific Colors and last 2 color slots on it (other colors changed to Magenta Background Color), (apply the palette using Maintain Indexes) you will have a file with only the Civ Specific Colors, Frame Lines and Background. You can save that File to copy and paste later.

The second palette with No Civ Specific Colors (other colors changed to Pure Green Color that is not found in any of the images), would be applied to "File One" and use "Nearest Color Matching". This will be a file with No Civ Specific Colors.

... you then load your Finished "New_units_32" Palette, that has the CIV Specific Colors on it, using "Nearest Color Matching", then Copy and Paste the Civ Specific Colors back on to these file images from the file you made that Only has the Civ Specific Colors on it.
The frame Lines allow you to match exactly where to place the Civ Specific images when pasting them over the other images on the file. In Paint Shop Pro, I use a Floating Image when pasting that allows moving the floating image around before pasting it. Ctrl+Shift+E. Can Copy Large areas at one time and paste accurately by using the Frame Lines. I set the Magenta Background as the Transparent color so it does not copy and paste. Only the Other Colors copy for pasting.
Hope this all makes sense :)
 
Does it mean that for the unit32, the first 4 rows are civ colour?
Steph... Basically Yes, as seen in Paint Shop Pro for example but other Graphics programs such as Gimp reverse the palette so keep that in mind.

The Colors that change on the Palette to the point of seeing a change for each Civ are the Ones I colored Green in this Image. (Not the one Green Colored slot on the Bottom, I removed that color because it is invisible in game and I do not use it).
So you could simply leave the other colors but to keep this as direct and simple as possible it is best to deal with all 4 Rows of CIV Colors.

This particular palette is what I use to check CIV Specific Colors. When applied using "maintain Indexes, it colors all Civ Specific Colors Green so I can see if there are any Civ Specific Colors where I do not want them and also to see if the Civ Specific Colored areas are all Civ Specific Colors. This is all in my Old Tutorial...

Zulu's Thread:
Tutorial: Making a units_32 pic
here

My Tutorial:CIV_Specific_units_32_pcx_files, End of Page One, Post #20
My Examples of Corrected units_32 images: Page Two, Post #21
 

Attachments

  • CivColors.png
    CivColors.png
    3.9 KB · Views: 138
I have two Units_32 palette files: one with the standard Red civ colors and one with the Blue civ colors... I could even make them with others, but since most makers (including myself) usually use either red or blue for civ coloring, those are the only two I use....

When converting full-color bitmaps of my blue-civ-colored units to units_32 pallettes, I have PsP load the Units32_Blue.pal and "Match using nearest color".... Then I load the Units32.pal (the default one) but this time have it "Maintain Indexes" so that all the civ colored slots will now be Red....

Hope this helped (I can even upload the two palettes if you want)....
 
Hikaro Takayama... Yes, That is what I was saying could be done IF no other Colors were change other than the Blue Civ Specific Colors top of Post #8.
I have no way to know without seeing all of the units_32 images Steph has but IF other Colors were also changed, a new Palette should be made.
 
Steph... IF you already have the Blue units_32.pcx Palette, you can simply use the Normal Red units_32.pcx Palette and load it to your Blue File and Maintain indexes. That is IF no other colors were changed but you can compare the two palettes yourself to see :)
 
Well, I'm not sure I will use it. As the main colour contains little yellow or green, I'm afraid it could somehow reduce the quality. I'm wondering if it wouldn't be better to just create a unit32 in full colour, and then reduce the colour to 160, and create a palette with the colours actually remaining... And without any civ colour at all.

As most of my units are flavour units anyway, I'm not sure it would be such a big loss.
 
Steph... Well, you could make a new palette with the Colors you need and if you are going to reduce the colors to 160, you could add the CIV Specific colors.

Personally, I do not care much for CIV Specific colors on units as the different colors ruin the unit appearance but if the same unit is used for more than one CIV, it is a needed indicator.

In the end, best to please yourself :)
 
Vuldacon: I could make units_32.pal files for every possible civ color... All you need to do is to make a dummy unit storyboard, load the default units_32.pal, and then use Flicster to re-export pcx files with each different color.....
 
Vuldacon: I could make units_32.pal files for every possible civ color... All you need to do is to make a dummy unit storyboard, load the default units_32.pal, and then use Flicster to re-export pcx files with each different color.....
Hikaro Takayama... yes, anyone can do that easy enough with Flicster but If the non Civ Colors were also changed that would not work. Again, I would have to see the actual original images and palettes used.
If only the Civ Specific colors were changed then very easy to change just the Civ Colors.

Example: If the units_32.pcx that uses the Blue Civ Colors also has other Colors changed in that palette and it is desired to combine both the Original Red units_32 and the Blue units_32.pcx, a new palette would have to be made to combine those other colors for both palettes.

Here are .bmp images of the Red units_32.pcx and Blue units_32.pcx palettes. Both palettes use the same original other palette colors.
 

Attachments

Back
Top Bottom