Author Topic: UFO and TFTD in the single sequential campaign  (Read 25164 times)

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: UFO and TFTD in the single sequential campaign
« Reply #30 on: October 10, 2018, 10:47:55 pm »
Thanks. I see that it also allows changing "countryColor", "cityColor", "baseColor" and "lineColor". How is it written in the YAML file?


best look at TFTD ruleset that did that, overall as I said before: "`oceanPalette` in `globe`"
This mean
Code: [Select]
globe
  oceanPalette: 160

But I was asking how to change the whole Geoscape palette.
Here is something to replace the whole GEODATA/PALETTES.DAT: https://github.com/SupSuper/OpenXcom/blob/0854dec7da01a14503f750aecaf6c624df33859a/src/Mod/Mod.cpp#L2508
Here is something to read palettes from *.rul files:
https://github.com/SupSuper/OpenXcom/blob/0854dec7da01a14503f750aecaf6c624df33859a/src/Mod/Mod.cpp#L591
https://github.com/SupSuper/OpenXcom/blob/0854dec7da01a14503f750aecaf6c624df33859a/src/Mod/Mod.cpp#L602
But what is the syntax? I can't quite figure it from the C++ code.
 I can try it when I have time. This weekend, probably. Just swap "UFO" and "TFTD" in the paths for the 2nd script.
I do not mess with palettes swapig I do not recall where is exacly and how loaded. This function you link aren't directly responsible for loading palettes, only for internal use to copy palettes to other surfaces.


I still don't understand how exactly the shade is drawn. Does the engine check each pixel of the globe if it's in "ocean palette" and change its colour accordingly?

Exactly, this color can be on texture and it will be changed too. This is unused in UFO where sea ice texture have colors from ocean.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: UFO and TFTD in the single sequential campaign
« Reply #31 on: October 10, 2018, 11:27:04 pm »
But I was asking how to change the whole Geoscape palette.
You don't want to change the palette. You want to change all of the incorrect ocean indexes to match the correct position on the palette. If you change the palette, you might fix the ocean but you'll break the images in other parts of the game which use the same colors.

Offline tkzv

  • Commander
  • *****
  • Posts: 583
    • View Profile
Re: UFO and TFTD in the single sequential campaign
« Reply #32 on: October 11, 2018, 02:02:27 pm »
You don't want to change the palette. You want to change all of the incorrect ocean indexes to match the correct position on the palette. If you change the palette, you might fix the ocean but you'll break the images in other parts of the game which use the same colors.
Moving ocean colour definitions isn't very useful if palettes don't change. Of course, changing palettes, will require changing textures accordingly, and the work amount may avalanche. I wanted to avoid that, but I already started with the 2nd script.

Geoscape palette is only used for viewing the globe. As long as I don't touch interface colours, change textures and remember to change city/border/etc colours, everything will stay fine.

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9091
    • View Profile
Re: UFO and TFTD in the single sequential campaign
« Reply #33 on: October 11, 2018, 02:40:22 pm »
Geoscape palette is only used for viewing the globe.

Geoscape palette is also used for anything related to geoscape:
- dogfights
- geoscape GUIs and popups
- some Ufopedia articles
- and even some non-geoscape GUIs, for example Debriefing GUI, etc.

I would not recommend any non-cosmetic changes to geoscape palette... but if you want, you can change it completely in OXCE using custom palettes: https://openxcom.org/forum/index.php/topic,4187.msg88361.html#msg88361

Example:

Code: [Select]
customPalettes:
  - type: PAL_GEOSCAPE_NEW
    target: PAL_GEOSCAPE
    file: Resources/Palettes/test.pal       # JASC-PAL format, all 256 colors are mandatory
« Last Edit: October 11, 2018, 02:42:19 pm by Meridian »

Offline tkzv

  • Commander
  • *****
  • Posts: 583
    • View Profile
Re: UFO and TFTD in the single sequential campaign
« Reply #34 on: October 12, 2018, 01:06:47 am »
Geoscape palette is also used for anything related to geoscape:
- dogfights
- geoscape GUIs and popups
- some Ufopedia articles
- and even some non-geoscape GUIs, for example Debriefing GUI, etc.

I would not recommend any non-cosmetic changes to geoscape palette... but if you want, you can change it completely in OXCE using custom palettes: https://openxcom.org/forum/index.php/topic,4187.msg88361.html#msg88361

Example:

Code: [Select]
customPalettes:
  - type: PAL_GEOSCAPE_NEW
    target: PAL_GEOSCAPE
    file: Resources/Palettes/test.pal       # JASC-PAL format, all 256 colors are mandatory
Thanks! I was asking about just that.

The R-G-B colour components in PALETTE.DAT are in the range 0-63 and are multiplied by 4 for displaying. Do I understand correctly that palettes in the "palette" tag or JACS-PAL file should be in the range 0-255 and are not multiplied?

If I specify the palette for PAL_GEOSCAPE, will it be used for Ufopedia and debriefing? Or did you separate them?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9091
    • View Profile
Re: UFO and TFTD in the single sequential campaign
« Reply #35 on: October 12, 2018, 09:11:07 am »
Yes 0-255 and are not multiplied.
It will be used on all places as before.

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: UFO and TFTD in the single sequential campaign
« Reply #36 on: January 10, 2019, 01:33:02 am »
You can fit TFTD textures into the UFO palette by reusing the (now useless) flat ocean with some TFTD blues and remapping the new textures accordingly:



Now you get day-night shading, just with an unfortunate side-effect of the "holes" looking even more obvious (since the old "flat shading" is leaking through):



Only feasible solution would be hiding all the holes or disabling "flat shading" entirely.

Offline luke83

  • Commander
  • *****
  • Posts: 1559
    • View Profile
    • openxcommods
Re: UFO and TFTD in the single sequential campaign
« Reply #37 on: January 10, 2019, 03:44:56 am »
Hey, thats my pallet ;) i almost have my globe working (except for that same issue you had with the grey overlay in the daylight, night time displays corretly)  :P
« Last Edit: January 10, 2019, 03:47:45 am by luke83 »

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: UFO and TFTD in the single sequential campaign
« Reply #38 on: January 10, 2019, 10:35:56 am »
The holes are caused by some shore regions using color #5. If you remap the shore regions to use color #12 instead, you would solve the issue. If you map them to closest match, it shouldn't have any terrain scars in the water--I think.

Offline luke83

  • Commander
  • *****
  • Posts: 1559
    • View Profile
    • openxcommods
Re: UFO and TFTD in the single sequential campaign
« Reply #39 on: January 10, 2019, 11:46:06 am »
Just tracking the last few errors in my globe now, just need that bug fix :)

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1512
    • View Profile
Re: UFO and TFTD in the single sequential campaign
« Reply #40 on: January 10, 2019, 01:08:19 pm »
just need that bug fix :)
You need to have the ocean textures from TFTD, like SupSuper has going. Then you just have to match them all up with the UFO textures so there's no holes, like he said.

Offline luke83

  • Commander
  • *****
  • Posts: 1559
    • View Profile
    • openxcommods
Re: UFO and TFTD in the single sequential campaign
« Reply #41 on: January 10, 2019, 01:11:04 pm »
The textures are used, they are  hidden under that Grey , looks like the blue is ignored but the numbers i placed on the snipped below still show through.

It looks like the game engine ignores any colour you place in that section of the Pallet as if i change those textures to something without Blue, it works correctly, i assume that is the bug SupSuper found.

As for holes, i dont think my map has any left on it ( i fixed them all) but my globe is no good for the majority of OXC, you will need to use Supsupers version for a Vanilla Earth.

« Last Edit: January 10, 2019, 01:57:21 pm by luke83 »

Offline SupSuper

  • Lazy Developer
  • Administrator
  • Commander
  • *****
  • Posts: 2162
    • View Profile
Re: UFO and TFTD in the single sequential campaign
« Reply #42 on: January 11, 2019, 11:26:31 am »
The holes are caused by some shore regions using color #5. If you remap the shore regions to use color #12 instead, you would solve the issue. If you map them to closest match, it shouldn't have any terrain scars in the water--I think.
It's a limitation of the globe shader. It doesn't actually check if it's shading a polygon, it just uses the color to decide if it's land (use 16-color shading) or ocean (use 32-color shading). So if polygons use ocean colors, bad stuff happens.
I tried moving the ocean color to an unused zone but that messed up the "flat" coloring. So I've just added an option to disable the 32-color shading via "oceanShading", will have to wait for OXCE to merge.

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: UFO and TFTD in the single sequential campaign
« Reply #43 on: January 11, 2019, 10:06:58 pm »
Easier solution would be change `Uint8 Globe::OCEAN_COLOR` to `Uint16 Globe::OCEAN_COLOR`, with this you could use values greater than`256` to disable it completely.

Btw using only color of pixel is feature not limitation. I deliberately did that to make ice blend with rest of sea.

Offline richardhead

  • Sergeant
  • **
  • Posts: 16
    • View Profile
Re: UFO and TFTD in the single sequential campaign
« Reply #44 on: February 14, 2019, 01:17:18 am »
I studied programming briefly in the early 90s. So my knowledge is limited to CoBOL, RPG, pascal and basic. I'd like to try the extended version, but it's sounds a little to complicated for my old ass to implement. Anyhow, it seams a good place to start, creatively, would be to design a totally brand new game with all the changes you'd like to see, then work backwards from there.  Some simple logic flaws always bugged me, like, if you are chasing an alien sub and it touches down, you can't attack it? What is it about being on the sea-bed that makes it immune to sonic oscillators? When aliens attack an underwater base, why dot just breach an exterior wall and watch the puny humans all drown? The "aquatic" aliens are obviously "amphibious" aliens because I don't see them wearing water-filled SCBAs when they are on land. I think I will do this and start a new thread about it. XCOM3 : Total Earth Defense. Maybe some actual modders who know what their doing can glean some ideas from it.