aliens

Author Topic: So you say you want a Palette huh?  (Read 4969 times)

Offline RSSwizard

  • Commander
  • *****
  • Posts: 758
    • View Profile
So you say you want a Palette huh?
« on: November 07, 2016, 01:22:53 am »
Just thought id post it because its something I recently worked on for zdoom, that game has some limited palette issues also given that it was optimized only for the stuff they had in it. So there were alot of colors that had large ranges given to them while maybe it could have been done with fewer.

I cooked up a new palette for zdoom which works by having all the original textures and sprites converted to .png format (as a spare resource file loaded after the primary one) so that their colors would remap using the game engine, and it works pretty well.

The thing is, while this palette may not be entirely ideal for UFO Defense or TFTD, with some tweaking it could easily do what the game/style needs it to do while offering color availability that just isnt present in either game. Like for example the pinkish skin tones can become the soft lavender that is frequently seen in TFTD.

One way I do it is taking a color range - say the Grays or the Skin Tones, and every other color down the range scintillates between saturated and unsaturated. Not a big difference but its "just enough" that it can provide a bridge or make do.

They gray tones especially, while some people like seeing flat gray ranges in my experience actual gray isnt a realistic color to see, usually you see off-white yellowish ivories, faded taupe and bluish slate. So it actually cycles between those.

The darker colors are also hard to make out or notice to the human eye anyway, so alot of colors that fade into darkness, they fade into like one of 3 applicable colors so a bunch of extra dark tones are truncated to make room for more hues.

Im probably not going to fork much work into adapting it because palette adaptability seems like its in its infancy for OXC and im unlikely to get into any heavy lifting with mod work.

This .png file has the palette in it, and I dont mind if somebody else takes it and modifies it or gets inspired by it.

Offline Warboy1982

  • Administrator
  • Commander
  • *****
  • Posts: 2333
  • Developer
    • View Profile
Re: So you say you want a Palette huh?
« Reply #1 on: November 07, 2016, 02:15:15 am »
the palette is adaptable, but the sprites have to be designed using said palette for any good to come of it. ;)

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: So you say you want a Palette huh?
« Reply #2 on: November 07, 2016, 08:53:26 am »
the palette is adaptable, but the sprites have to be designed using said palette for any good to come of it. ;)

Would it be possible for MCD/PCK/TAB files to be assigned different palettes and use them?

Offline RSSwizard

  • Commander
  • *****
  • Posts: 758
    • View Profile
Re: So you say you want a Palette huh?
« Reply #3 on: November 21, 2016, 12:00:56 am »
So I was bored and started playing around with colors anyway and figured id come up with a custom catered optimized palette for ufo. Some colors were truncated but I replaced them with ones I think modders would prefer more anyway, and made other colors do double duty.

You guys can do what you want with it, put a hat on it, whatever.

I do have a question about that last row of colors that everybody always blanks out though: are these used for color cycling or fullbrights, or are they much different colors when presented in the ufopaedia or something? What goes on with that eh?

If they are hardcoded candy then thats fine, but I think if someone was going to bother with converting all their graphics they'd want to use those as well if they could (plus I think except for some minor changes, the palette would also do fine across the different game modes too, such as ufopaedia, geo, tactical).

Does the game use a series of palettes for light shading or is it an algorithm now?

(the .gif file attachment is 8bit and has the palette in it as illustrated
edit: due to a derp moment I forgot that ufo actually needs a black color on the palette, so its at the end of the red range)
« Last Edit: November 21, 2016, 03:06:37 am by RSSwizard »

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: So you say you want a Palette huh?
« Reply #4 on: November 21, 2016, 05:45:26 am »
I don't know about the last row, I think it gets replaced in UFOPaedia images compared to Battlescape? Someone else will know.

My understanding of the shading is that it's done by shifting indices for the whole image. So to make something darker, you add a number between 1 and 15 to every palette index for the whole image. If that's large enough to make it change palette row, you pick black instead. So if you have a pale grey, index 4, and want it darker, the color displayed will be index 5, or 6 for a bit darker still, etc. But if you want it really dark it will stop at 15 otherwise it'd become the next color. It's the reason every row is a smooth gradient of colors in battlescape palettes (same for the colors used for globe textures in the geoscape).

This also means that your palette cannot work with the current algorithm because shading deep reds (2nd row) will eventually give you bright pinks.

Offline RSSwizard

  • Commander
  • *****
  • Posts: 758
    • View Profile
Re: So you say you want a Palette huh?
« Reply #5 on: November 22, 2016, 04:42:38 am »
thats a terrible horrible way to do things, ive never heard of such a thing
ick, retch, barf

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: So you say you want a Palette huh?
« Reply #6 on: November 22, 2016, 04:47:00 am »
I think "That's XCom baby!" is appropriate here  ;D If you can do it hard, why do it easy?

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: So you say you want a Palette huh?
« Reply #7 on: November 22, 2016, 05:52:03 am »
Well, Doom does the same thing... a palette + a color map which defines the progressive levels of darkness.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: So you say you want a Palette huh?
« Reply #8 on: November 22, 2016, 07:03:10 am »
I think "That's XCom baby!" is appropriate here  ;D If you can do it hard, why do it easy?

"If it's stupid but it works, it isn't stupid" - Murphy's Laws

Offline Yankes

  • Commander
  • *****
  • Posts: 3208
    • View Profile
Re: So you say you want a Palette huh?
« Reply #9 on: November 22, 2016, 07:50:00 pm »
I think "That's XCom baby!" is appropriate here  ;D If you can do it hard, why do it easy?
I could say it not XCom but 80's or early 90's games.

And I personally love this system :)

Offline RSSwizard

  • Commander
  • *****
  • Posts: 758
    • View Profile
Re: So you say you want a Palette huh?
« Reply #10 on: November 22, 2016, 10:51:42 pm »
Well, Doom does the same thing... a palette + a color map which defines the progressive levels of darkness.
that one is tolerable and novel, unbound to the palette itself it just remaps colors, I was going to mention it but...