aliens

Author Topic: world.dat editor, terrain colors  (Read 2370 times)

Offline robin

  • Commander
  • *****
  • Posts: 1226
  • ULTIMATE ROOKIE
    • View Profile
world.dat editor, terrain colors
« on: September 05, 2021, 12:58:55 pm »
I wanted to change/expand the colors in the editor (to match the changed/expanded textures on my globe).
It pretty simple, you just have to add extra
Code: [Select]
terrain #RRGGBB lines for the extra textures, or change the code in the existing lines to change the color for existing textures.
The problem is that in the editor the custom colors are rendered darker or plain wrong.
Does the editor use special colors/palette?
(It does not seem to be the geoscape palette...).
Thanks
« Last Edit: September 05, 2021, 01:00:43 pm by robin »

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: world.dat editor, terrain colors
« Reply #1 on: September 05, 2021, 02:47:25 pm »
i can't say anything about it for sure (since i haven't looked in to it a whole lot)

but I think the same thing happens in the MapView code -- it defines colors for the XCOM palettes with its own values. When I noticed that the RGB values were not the same as the widely accepted values I changed them to the latter. But the colors as they appeared in the app were then just wrong. (so i reverted)

it might have something to do with the way that .net displays colors.

Daishiva must have figured out some way to calculate RGB values (for MapView/.net) as they actually appear in XCOM. Here's the MapView palettes (strangely, they appear to render accurately) ...

https://github.com/kevL/OpenXCOM.Tools/tree/master/XCom/_Embedded

perhaps you can/should do some cross-checking first, then try Daishiva's value(s) in the WorldDat editor

Offline robin

  • Commander
  • *****
  • Posts: 1226
  • ULTIMATE ROOKIE
    • View Profile
Re: world.dat editor, terrain colors
« Reply #2 on: September 06, 2021, 11:03:51 pm »
thanks, i'll try to look into it but i confess it seems complicated  :-[

Offline kevL

  • Colonel
  • ****
  • Posts: 482
  • pitchforks and torches
    • View Profile
Re: world.dat editor, terrain colors
« Reply #3 on: September 09, 2021, 04:12:36 pm »
well, you're a pixel artist, right?

so you probly know about 8-bit palettes ... 256 color indices that use ids [0..255] ... those lists i linked to are the colors of the ids.

But the lists are not numbered. They are in order, however. the first RGB value is id #0 ... the last RGB value is id #255

So try something like this: in something like Gimp, open the (true) XCOM palette that you want to get the color of. Figure out its id. Then copy the corresponding palette-list (under my link) to Notepad++ so you can see line numbers.

The line numbers in Notepad will be off-by-two, however (one for the palette-header, and two because Notepad will start at 1 instead of 0).

then grab the RGB values of the id you're hoping for, convert them to Hex (that worlddatEditor understands) and try it,

---
Or,

open PckView (comes with Mapview2). open a PCK spriteset. double-click a sprite, which shows the SpriteEditor and Palette. Change the palette in PckView to "ufo-geo" and the Palette window should display that palette. Click the color you want and its RGB values should appear in the statusbar ... convert them to Hex and put them in worlddatEditor ...


ps. I haven't tried any of this and it's hypothetical, but in theory it just might work

Offline robin

  • Commander
  • *****
  • Posts: 1226
  • ULTIMATE ROOKIE
    • View Profile
Re: world.dat editor, terrain colors
« Reply #4 on: September 12, 2021, 11:19:14 pm »
i'll make an attempt. thank you.