Support for age of empires palletes?

Started by CatmanFS, August 21, 2021, 09:49:05 PM

Previous topic - Next topic

CatmanFS

Hi, I really like your program and it has already helped me with graphics mods for age of empires games. The older games used indexed palettes in the same format as jasc .pal, but the newer ones also utilize a modified version of the jasc palette that includes alpha values as well as regular rgb values.

I saw that you had posted some code that could be used as a template that helped others with similar problems and I have just copied the jasc template but dont know how to call the value for the alpha value. rgb.a doesn't seem to work. i included an example of the jasc .palx file....

the only difference is that there is a single value defined like this $ALPHA 170 but i dont even know what that does atm and can just add that in manually.


being able to save to this format would greatly aid in my work as I am using another program SLX studio to edit the games sprite animations files and it has added functionality using palettes and such and there is a convert using palette that can change the graphics from one palette to another and is very useful for recoloring the slp animations. using this method is almost essential as there are thousands of frames per animation and would otherwise be impossible.


tamilsonglyrics.org

Richard Moss

Hello,

Thanks for the suggestion, this is interesting. I haven't really looked at adding alpha support to the editor before as most palette formats don't support it, so I've deliberately hidden the alpha editors in the program.

It wouldn't be too much effort to enable these and allow for the use of alpha palettes (and given this is a basic text format, it would be simple to add this format to the editor as well), except that ideally I need to know how the $ALPHA header is calculated otherwise I can't guarantee the program will create valid palettes in the format and given the sample uses 192 and you have put 170 there must be some sort of logic behind it.

Regards;
Richard Moss
Read "Before You Post" before posting (https://forums.cyotek.com/cyotek-webcopy/before-you-post/). Do not send me private messages. Do not expect instant replies.

All responses are hand crafted. No AI involved. Possibly no I either.

CatmanFS

It is indeed used by the engine but not needed for what I am trying to do. Using your program I can more easily create palettes that can be used for color swapping operations in the editing program that was made to edit the game's graphics. It can simply be omitted as I do not know what advantage using different palettes in the game would have, and the editor does not need it.

CatmanFS

One question, you said that Cyotek can open and deal with palettes with alpha values and it just ignores them. Is this a safe operation? And do saved palettes still contain the original unchanged alpha data? Also would you be willing to show how to edit a template to allow editing of these palettes? The variable at the beginning would remain unchanged and and is set to a specific value as each of the originals are different and only editing of the colors of those palettes would be needed.

Richard Moss

Hello,

The value is preserved, but not if the colour is edited - at this point it will be reset to 255.

I haven't yet added a format to handle the X versions; although I hope to get onto that this week. While

The following template could be used to create a PALX file, but I'm not sure of how much use it would be given the fact that editing a colour will reset the alpha (plus templates are output only, I have some ideas for creating input templates but they aren't planned in yet)

JASC-PAL
0100
{{count}}
$ALPHA 192
{%- for rgb in rgbcolors -%}
{{rgb.R}} {{rgb.G}} {{rgb.B}} {{rgb.A}}
{%- endfor -%}


Regards;
Richard Moss
Read "Before You Post" before posting (https://forums.cyotek.com/cyotek-webcopy/before-you-post/). Do not send me private messages. Do not expect instant replies.

All responses are hand crafted. No AI involved. Possibly no I either.

CatmanFS

I see, yeah your program is one of the few out there left these days that makes working with larger palettes possible, and the sorting, arranging and other functions have been very useful already. If it supported doing a few (basic) operations with the alpha values or just preserve them, that would be even better as I do not know of anything else out there off hand that would be able to do that.