Author Topic: making a new palette 4 xcom1 & 2 (hex stuff) plz help?  (Read 3435 times)

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
making a new palette 4 xcom1 & 2 (hex stuff) plz help?
« on: August 19, 2015, 03:32:26 am »
Long story short I am working on a new PALETTE.DAT set for XCOM1/XCOM2 using Hex editing and Photoshop.


Can anyone explain to me PALETTE.DAT in more depth. On UFOPAEDIA wiki says 768 bytes is 1 palette but I found that is actually 778 and first color is always transparent.

Also seems palettes use 3 bytes instead of 4. How do I calculate what color am I dealing with from 3 bytes to 4?

Also I noticed some things are hardcoded for ex menus in XCOM1/XCOM2 use certain colors. Where is this menu color area and is it constant between the two games?

I mean essentially I am trying to make a palette for XCOM2 based on XCOM1 . Some areas of the hardcoded palette may not corespond. What areas are hardcoded?

See below for details

Spoiler:
If palettes are like so

XCOM1 :
1 GEO
2 BASESCAPE
3 GRAPHS
4 UFOPEDIA
5 TACTICAL

XCOM2 :
1 GEO
2 BASESCAPE/UFOPEDIA
3 GRAPHS

What I am trying to do is create an universal palette for myself that has more reds/oranges in GEO hence a bit more universal and also able to function in both XCOM1 and XCOM2 modding.

My PALETTE.DAT :
1 modified XCOM1 GEO
2 XCOM1 BASESCAPE
3 XCOM1 GRAPH
4 XCOM1 BASESCAPE (XCOM2 uses #2 above for UFOPEDIA hence the duplicate trick)
5 XCOM1 TACTICAL (unused in XCOM2)

#4 and #2 being identical makes this palette compatible in both games.

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: making a new palette 4 xcom1 & 2 (hex stuff) plz help?
« Reply #1 on: August 19, 2015, 03:35:23 am »
And yes  I have managed to copy BASESCAPE palette into GEO palette working fine except menus are whack cause I copied over the hardcoded areas.

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: making a new palette 4 xcom1 & 2 (hex stuff) plz help?
« Reply #2 on: August 19, 2015, 03:41:04 am »
my guess is the RED circled area is hardcoded menu color

possibly the GREEN circled area but I doubt it.



Can anyone confirm?

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: making a new palette 4 xcom1 & 2 (hex stuff) plz help?
« Reply #3 on: August 19, 2015, 03:49:53 am »
774 bytes are 768 + 6 bytes buffer unused by openxcom engine i wonder what happens if i clear there or change them up

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: making a new palette 4 xcom1 & 2 (hex stuff) plz help?
« Reply #4 on: August 19, 2015, 05:22:50 am »
Openxcom ignores the 6 bytes in-between palettes.

Geoscape has the interception screens, so you'll have to check these screens, with weapon icons, and UFO visual identification.

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: making a new palette 4 xcom1 & 2 (hex stuff) plz help?
« Reply #5 on: August 19, 2015, 06:37:54 am »
i managed to create a hybrid like landscape. problem is palette is so limited and so different between xcom1 and xcom2 that i can't simply make an universal palette.

i noticed there are safe areas like all land, land textures, all water that can easily be changed . menus are actually first band in xcom2 but middle band in xcom1 . ive copied color bands from tftd and from ufo into a whole new palette kinda like a bleak earth looking for now.

in my mod everything is surface with no oceans. i kinda need to tailor it and change it once i mod for xcom2

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: making a new palette 4 xcom1 & 2 (hex stuff) plz help?
« Reply #6 on: August 19, 2015, 06:42:19 am »
in the above version main menus work from xcom1 and xcom1 plus all land and all water textures are present. i don't really need all water as im never gonna use that but  ill see maybe i can convert them to something

i have this idea of using black for second band for both land and water so i get extreme light /dark  . i gonna keep experimenting with it.

Offline kikimoristan

  • Commander
  • *****
  • Posts: 647
    • View Profile
Re: making a new palette 4 xcom1 & 2 (hex stuff) plz help?
« Reply #7 on: August 19, 2015, 09:28:52 am »
im pretty happy with the results so far...i mean in regards to my mod.

Offline AndO3131

  • Colonel
  • ****
  • Posts: 137
    • View Profile
    • Email
Re: making a new palette 4 xcom1 & 2 (hex stuff) plz help?
« Reply #8 on: August 19, 2015, 09:39:14 am »
Also seems palettes use 3 bytes instead of 4. How do I calculate what color am I dealing with from 3 bytes to 4?

Alpha channel is ignored by OpenXcom. First byte is red part divided by 4, second byte is green part divided by 4, third byte is blue part divided by 4 (i hope i didn't mess color order).

Also I noticed some things are hardcoded for ex menus in XCOM1/XCOM2 use certain colors. Where is this menu color area and is it constant between the two games?

Menus are available in rulesets: UFO interface and TFTD interface.

Palette has maximum 256 colors. I have a strong feeling it's impossible to merge UFO and TFTD palettes into single one and expect it to display consistent image, because various element from first game will use the same color index as elements from second game, but expecting different color of this exact element. For example look at gazer aliens from both games. They use the same index, but they look very different. Overwriting colors in TFTD palette will result in some unit or texture looking weird.