Author Topic: Chaingun remodel and palette fail  (Read 19467 times)

Offline tormodino

  • Sergeant
  • **
  • Posts: 22
    • View Profile
Chaingun remodel and palette fail
« on: September 15, 2016, 10:50:48 pm »
I took a stab at remodelling the chaingun and imported it into the game.
I then discovered the whole palette problem, and the gun shows up in a beautiful yellow and white.
There are some posts in the modding forums to help with this, but I need to ask:



Is the palette  the same for Piratez as regular OXcom? (I'm sure I can work out how to install them)
Can the engine not handle other palettes? And if so, where can I change it?
Where should I submit graphics if I do more of these, for constructive critiscism if nothing else?

Offline Dioxine

  • Commander
  • *****
  • Posts: 5465
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Chaingun remodel and palette fail
« Reply #1 on: September 15, 2016, 10:56:11 pm »
The palettes are the same, because hardcoded, which is kinda sad.

Offline tormodino

  • Sergeant
  • **
  • Posts: 22
    • View Profile
Re: Chaingun remodel and palette fail
« Reply #2 on: September 15, 2016, 11:04:03 pm »
That's too bad.
Any idea if that is scheduled to change? I just recently got interested in OpenXcom, and mods like Piratez one just blow the original game to pieces.
If the engine is truly open there seems to be no real limit to the content modders could create.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5465
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Chaingun remodel and palette fail
« Reply #3 on: September 15, 2016, 11:13:32 pm »
That's too bad.
Any idea if that is scheduled to change?

I'd bet on never, as far as the main dev team is concerned. But there are people making independent code additions, like all the new stuff you can see in piratez.

Offline tormodino

  • Sergeant
  • **
  • Posts: 22
    • View Profile
Re: Chaingun remodel and palette fail
« Reply #4 on: September 15, 2016, 11:21:14 pm »
That's great to hear. I am excited to see this mod move forward. You, and all the contributors, have done an amazing job.

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Chaingun remodel and palette fail
« Reply #5 on: September 16, 2016, 12:54:31 am »
OpenXcom needs the palette in order to provide lighting effects identical to the original games.
The palette contains the information which let the engine know how the sprite must look when it's darkened by 1 step, 2 steps, etc. down to full black.

There has been discussion, data analysis and experiments to try produce a simple mathematical rule which can apply to arbitrary RGB colors, and produces visually identical results, but without success. As far as I can understand, the remaining options are:
- abandon the original "look"
- abandon platforms not able to run hefty pixel shaders, such as office computers
- try something very clever, like supporting an extended palette of more than 256 colors, adding 16-color ranges as they are encountered in modded images.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5465
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Chaingun remodel and palette fail
« Reply #6 on: September 16, 2016, 01:20:20 am »
How about simply allowing custom 256 pals? TFTD has different pals, yet it works. Besides, you make it sound like some insurmountable problem, while modern pixel games easily support all kinds of effects (like Terraria, for example).
The 'original look' argument isn't a strong one either, as the game looks VERY differently from the original, unless ran on an archaic CRT (I suppose - I never had a chance). LCD's, not to mention portable machines, already change the look drastically.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: Chaingun remodel and palette fail
« Reply #7 on: September 16, 2016, 10:40:52 am »
How about simply allowing custom 256 pals? TFTD has different pals, yet it works.

Palettes are not hardcoded in the EXE.
They are read from data files and thus can could be modded relatively easily.
I thought it was already implemented, but it's not.
I can do it, it's quite easy, but...
... how would you use it? I mean if you change the palettes, all vanilla resources will stop working and also all modded resources will have to be recolored or completely recreated... unless you make only cosmetic changes.
Is that even feasible to think about? Or have I misunderstood something?

Offline Dioxine

  • Commander
  • *****
  • Posts: 5465
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Chaingun remodel and palette fail
« Reply #8 on: September 16, 2016, 10:57:37 am »
Battlescape palette is broken up into 16 colors, 16 shades each. If an new palette keeps this order, and is done with skill, a palette change will keep the pictures fine, while recoloring them to modder's desire. Eg. (if it was deployment sensitive) I could slightly pull all the tones towards blue in underwater missions, or towards green in say, acid rain, or bleach them for space missions. Other modders could change global palettes completely, thus getting just the right colors they want.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: Chaingun remodel and palette fail
« Reply #9 on: September 16, 2016, 11:08:07 am »
OK, I can do that.
Most of the work will be on your side anyway :)

First a global change only, for experimentation... and if it proves a worthy pursuit, I can add dependency on deployment too.

Offline Dioxine

  • Commander
  • *****
  • Posts: 5465
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Chaingun remodel and palette fail
« Reply #10 on: September 16, 2016, 11:36:14 am »
That'd be great :) A tiny detail: would it be possible to set map background color as well? (right now it's color 15, but undersea would look much better if the now-black areas were actually deep-blue... :)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: Chaingun remodel and palette fail
« Reply #11 on: September 16, 2016, 06:49:03 pm »
This is how it could look like.
Btw. the numbers down there are the current battlescape palette as a starting point.

Code: [Select]
customPalettes:
  - type: PAL_BATTLESCAPE_COPY
    target: PAL_BATTLESCAPE
    palette:
      0: [0,0,0]
      1: [252,252,252]
      2: [232,232,232]
      3: [216,216,216]
      4: [196,196,196]
      5: [176,176,176]
      6: [160,160,160]
      7: [140,140,140]
      8: [124,124,124]
      9: [104,104,104]
      10: [88,88,88]
      11: [68,68,68]
      12: [52,52,52]
      13: [32,32,32]
      14: [12,12,12]
      15: [0,0,0]
      16: [252,208,0]
      17: [236,180,0]
      18: [224,160,0]
      19: [208,136,0]
      20: [196,116,0]
      21: [180,96,0]
      22: [168,80,0]
      23: [152,64,0]
      24: [140,52,0]
      25: [124,36,0]
      26: [112,28,0]
      27: [96,16,0]
      28: [84,8,0]
      29: [72,4,0]
      30: [56,0,0]
      31: [44,0,0]
      32: [252,120,120]
      33: [236,104,104]
      34: [224,92,92]
      35: [208,76,76]
      36: [196,68,68]
      37: [184,56,56]
      38: [168,44,44]
      39: [156,36,36]
      40: [140,28,28]
      41: [128,20,20]
      42: [116,12,12]
      43: [100,8,8]
      44: [88,4,4]
      45: [72,0,0]
      46: [60,0,0]
      47: [48,0,0]
      48: [160,224,132]
      49: [136,208,116]
      50: [116,196,100]
      51: [92,184,84]
      52: [72,172,72]
      53: [60,160,64]
      54: [48,144,60]
      55: [40,132,56]
      56: [28,120,56]
      57: [20,108,52]
      58: [16,96,48]
      59: [8,80,44]
      60: [4,68,40]
      61: [0,56,36]
      62: [0,44,28]
      63: [0,32,24]
      64: [208,228,96]
      65: [184,212,84]
      66: [164,196,72]
      67: [144,184,60]
      68: [124,168,48]
      69: [104,156,40]
      70: [88,140,32]
      71: [72,124,24]
      72: [56,112,20]
      73: [40,96,12]
      74: [28,84,8]
      75: [16,68,4]
      76: [8,52,0]
      77: [4,40,0]
      78: [0,24,0]
      79: [0,12,0]
      80: [248,248,248]
      81: [232,224,224]
      82: [220,208,204]
      83: [204,188,184]
      84: [192,172,168]
      85: [176,156,148]
      86: [164,140,132]
      87: [148,124,116]
      88: [136,108,100]
      89: [120,92,88]
      90: [108,80,72]
      91: [92,68,60]
      92: [80,56,48]
      93: [68,44,40]
      94: [52,32,28]
      95: [40,24,20]
      96: [240,196,72]
      97: [224,176,64]
      98: [212,156,52]
      99: [200,136,48]
      100: [188,120,40]
      101: [176,104,32]
      102: [160,84,24]
      103: [148,72,20]
      104: [136,56,16]
      105: [124,44,12]
      106: [112,32,8]
      107: [96,20,4]
      108: [84,12,4]
      109: [72,4,0]
      110: [60,0,0]
      111: [48,0,0]
      112: [140,176,200]
      113: [128,160,188]
      114: [112,144,176]
      115: [104,128,164]
      116: [92,112,152]
      117: [80,100,144]
      118: [72,84,132]
      119: [60,72,120]
      120: [52,60,108]
      121: [44,48,96]
      122: [36,36,88]
      123: [32,28,76]
      124: [28,24,64]
      125: [24,16,52]
      126: [20,12,40]
      127: [16,8,32]
      128: [168,208,240]
      129: [148,188,224]
      130: [128,172,212]
      131: [112,152,200]
      132: [96,136,188]
      133: [80,120,172]
      134: [64,104,160]
      135: [52,88,148]
      136: [40,72,132]
      137: [28,60,120]
      138: [20,48,108]
      139: [12,36,96]
      140: [8,24,80]
      141: [4,16,68]
      142: [0,8,56]
      143: [0,4,44]
      144: [252,252,120]
      145: [236,228,104]
      146: [224,204,92]
      147: [208,184,76]
      148: [196,160,68]
      149: [184,140,56]
      150: [168,120,44]
      151: [156,100,36]
      152: [140,80,28]
      153: [128,64,20]
      154: [116,48,12]
      155: [100,32,8]
      156: [88,20,4]
      157: [72,8,0]
      158: [60,4,0]
      159: [48,0,0]
      160: [184,160,88]
      161: [172,144,76]
      162: [160,128,64]
      163: [148,112,56]
      164: [136,96,44]
      165: [124,80,36]
      166: [112,68,28]
      167: [104,56,24]
      168: [92,44,16]
      169: [80,32,12]
      170: [68,20,8]
      171: [56,12,4]
      172: [44,8,0]
      173: [32,4,0]
      174: [20,0,0]
      175: [12,0,0]
      176: [248,220,212]
      177: [232,196,192]
      178: [220,176,172]
      179: [208,152,152]
      180: [192,136,140]
      181: [180,120,128]
      182: [168,104,120]
      183: [152,92,108]
      184: [140,76,100]
      185: [128,64,92]
      186: [112,52,84]
      187: [100,44,76]
      188: [88,32,68]
      189: [72,24,60]
      190: [60,16,52]
      191: [48,12,44]
      192: [216,196,252]
      193: [200,172,236]
      194: [184,148,224]
      195: [172,128,208]
      196: [160,108,196]
      197: [152,92,180]
      198: [140,76,168]
      199: [132,60,152]
      200: [124,48,140]
      201: [116,36,124]
      202: [108,24,112]
      203: [96,16,96]
      204: [84,8,80]
      205: [72,4,60]
      206: [56,0,44]
      207: [44,0,32]
      208: [64,196,252]
      209: [56,172,236]
      210: [48,148,224]
      211: [40,128,208]
      212: [32,108,196]
      213: [28,88,184]
      214: [24,72,168]
      215: [16,52,156]
      216: [12,40,140]
      217: [8,24,128]
      218: [4,16,116]
      219: [4,4,100]
      220: [4,0,88]
      221: [4,0,72]
      222: [8,0,60]
      223: [8,0,48]
      224: [236,236,248]
      225: [216,216,232]
      226: [196,196,220]
      227: [180,180,208]
      228: [164,164,192]
      229: [148,144,180]
      230: [136,132,168]
      231: [120,116,152]
      232: [108,100,140]
      233: [96,88,128]
      234: [84,76,112]
      235: [72,64,100]
      236: [60,52,88]
      237: [52,40,72]
      238: [40,32,60]
      239: [32,24,48]
      240: [140,152,148]
      241: [132,136,140]
      242: [116,124,132]
      243: [108,116,124]
      244: [92,104,108]
      245: [84,92,100]
      246: [76,80,92]
      247: [56,68,84]
      248: [48,56,68]
      249: [40,48,56]
      250: [32,36,48]
      251: [24,28,32]
      252: [16,20,24]
      253: [8,12,16]
      254: [3,4,8]
      255: [3,3,6]

Offline Dioxine

  • Commander
  • *****
  • Posts: 5465
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Chaingun remodel and palette fail
« Reply #12 on: September 17, 2016, 09:37:00 am »
Working on RGB numbers directly? Oh boy, this will be fun! :)

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: Chaingun remodel and palette fail
« Reply #13 on: September 17, 2016, 12:10:49 pm »
Working on RGB numbers directly? Oh boy, this will be fun! :)

Of course a binary palette will be supported later, there's just too much space for errors there (each application exports palettes differently).
This is just for playing around and experimenting...

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9136
    • View Profile
Re: Chaingun remodel and palette fail
« Reply #14 on: September 17, 2016, 06:25:47 pm »
Example of greyscale palette (standard battlescape palette, where R, G, B = max(R,G,B) from original palette).

Fun, still kinda useless :)

Code: [Select]
customPalettes:
  - type: PAL_BATTLESCAPE_GREYSCALE
    target: PAL_BATTLESCAPE
    palette:
      0: [0,0,0]
      1: [252,252,252]
      2: [232,232,232]
      3: [216,216,216]
      4: [196,196,196]
      5: [176,176,176]
      6: [160,160,160]
      7: [140,140,140]
      8: [124,124,124]
      9: [104,104,104]
      10: [88,88,88]
      11: [68,68,68]
      12: [52,52,52]
      13: [32,32,32]
      14: [12,12,12]
      15: [0,0,0]
      16: [252,252,252]
      17: [236,236,236]
      18: [224,224,224]
      19: [208,208,208]
      20: [196,196,196]
      21: [180,180,180]
      22: [168,168,168]
      23: [152,152,152]
      24: [140,140,140]
      25: [124,124,124]
      26: [112,112,112]
      27: [96,96,96]
      28: [84,84,84]
      29: [72,72,72]
      30: [56,56,56]
      31: [44,44,44]
      32: [252,252,252]
      33: [236,236,236]
      34: [224,224,224]
      35: [208,208,208]
      36: [196,196,196]
      37: [184,184,184]
      38: [168,168,168]
      39: [156,156,156]
      40: [140,140,140]
      41: [128,128,128]
      42: [116,116,116]
      43: [100,100,100]
      44: [88,88,88]
      45: [72,72,72]
      46: [60,60,60]
      47: [48,48,48]
      48: [224,224,224]
      49: [208,208,208]
      50: [196,196,196]
      51: [184,184,184]
      52: [172,172,172]
      53: [160,160,160]
      54: [144,144,144]
      55: [132,132,132]
      56: [120,120,120]
      57: [108,108,108]
      58: [96,96,96]
      59: [80,80,80]
      60: [68,68,68]
      61: [56,56,56]
      62: [44,44,44]
      63: [32,32,32]
      64: [228,228,228]
      65: [212,212,212]
      66: [196,196,196]
      67: [184,184,184]
      68: [168,168,168]
      69: [156,156,156]
      70: [140,140,140]
      71: [124,124,124]
      72: [112,112,112]
      73: [96,96,96]
      74: [84,84,84]
      75: [68,68,68]
      76: [52,52,52]
      77: [40,40,40]
      78: [24,24,24]
      79: [12,12,12]
      80: [248,248,248]
      81: [232,232,232]
      82: [220,220,220]
      83: [204,204,204]
      84: [192,192,192]
      85: [176,176,176]
      86: [164,164,164]
      87: [148,148,148]
      88: [136,136,136]
      89: [120,120,120]
      90: [108,108,108]
      91: [92,92,92]
      92: [80,80,80]
      93: [68,68,68]
      94: [52,52,52]
      95: [40,40,40]
      96: [240,240,240]
      97: [224,224,224]
      98: [212,212,212]
      99: [200,200,200]
      100: [188,188,188]
      101: [176,176,176]
      102: [160,160,160]
      103: [148,148,148]
      104: [136,136,136]
      105: [124,124,124]
      106: [112,112,112]
      107: [96,96,96]
      108: [84,84,84]
      109: [72,72,72]
      110: [60,60,60]
      111: [48,48,48]
      112: [200,200,200]
      113: [188,188,188]
      114: [176,176,176]
      115: [164,164,164]
      116: [152,152,152]
      117: [144,144,144]
      118: [132,132,132]
      119: [120,120,120]
      120: [108,108,108]
      121: [96,96,96]
      122: [88,88,88]
      123: [76,76,76]
      124: [64,64,64]
      125: [52,52,52]
      126: [40,40,40]
      127: [32,32,32]
      128: [240,240,240]
      129: [224,224,224]
      130: [212,212,212]
      131: [200,200,200]
      132: [188,188,188]
      133: [172,172,172]
      134: [160,160,160]
      135: [148,148,148]
      136: [132,132,132]
      137: [120,120,120]
      138: [108,108,108]
      139: [96,96,96]
      140: [80,80,80]
      141: [68,68,68]
      142: [56,56,56]
      143: [44,44,44]
      144: [252,252,252]
      145: [236,236,236]
      146: [224,224,224]
      147: [208,208,208]
      148: [196,196,196]
      149: [184,184,184]
      150: [168,168,168]
      151: [156,156,156]
      152: [140,140,140]
      153: [128,128,128]
      154: [116,116,116]
      155: [100,100,100]
      156: [88,88,88]
      157: [72,72,72]
      158: [60,60,60]
      159: [48,48,48]
      160: [184,184,184]
      161: [172,172,172]
      162: [160,160,160]
      163: [148,148,148]
      164: [136,136,136]
      165: [124,124,124]
      166: [112,112,112]
      167: [104,104,104]
      168: [92,92,92]
      169: [80,80,80]
      170: [68,68,68]
      171: [56,56,56]
      172: [44,44,44]
      173: [32,32,32]
      174: [20,20,20]
      175: [12,12,12]
      176: [248,248,248]
      177: [232,232,232]
      178: [220,220,220]
      179: [208,208,208]
      180: [192,192,192]
      181: [180,180,180]
      182: [168,168,168]
      183: [152,152,152]
      184: [140,140,140]
      185: [128,128,128]
      186: [112,112,112]
      187: [100,100,100]
      188: [88,88,88]
      189: [72,72,72]
      190: [60,60,60]
      191: [48,48,48]
      192: [252,252,252]
      193: [236,236,236]
      194: [224,224,224]
      195: [208,208,208]
      196: [196,196,196]
      197: [180,180,180]
      198: [168,168,168]
      199: [152,152,152]
      200: [140,140,140]
      201: [124,124,124]
      202: [112,112,112]
      203: [96,96,96]
      204: [84,84,84]
      205: [72,72,72]
      206: [56,56,56]
      207: [44,44,44]
      208: [252,252,252]
      209: [236,236,236]
      210: [224,224,224]
      211: [208,208,208]
      212: [196,196,196]
      213: [184,184,184]
      214: [168,168,168]
      215: [156,156,156]
      216: [140,140,140]
      217: [128,128,128]
      218: [116,116,116]
      219: [100,100,100]
      220: [88,88,88]
      221: [72,72,72]
      222: [60,60,60]
      223: [48,48,48]
      224: [248,248,248]
      225: [232,232,232]
      226: [220,220,220]
      227: [208,208,208]
      228: [192,192,192]
      229: [180,180,180]
      230: [168,168,168]
      231: [152,152,152]
      232: [140,140,140]
      233: [128,128,128]
      234: [112,112,112]
      235: [100,100,100]
      236: [88,88,88]
      237: [72,72,72]
      238: [60,60,60]
      239: [48,48,48]
      240: [152,152,152]
      241: [140,140,140]
      242: [132,132,132]
      243: [124,124,124]
      244: [108,108,108]
      245: [100,100,100]
      246: [92,92,92]
      247: [84,84,84]
      248: [68,68,68]
      249: [56,56,56]
      250: [48,48,48]
      251: [32,32,32]
      252: [24,24,24]
      253: [16,16,16]
      254: [8,8,8]
      255: [6,6,6]
« Last Edit: September 17, 2016, 06:44:46 pm by Meridian »