Author Topic: [UFO MEGAMOD] Reaver's Faithful Megamod  (Read 19342 times)

Offline Lord_Kane

  • Sergeant
  • **
  • Posts: 46
    • View Profile
Re: [UFO MEGAMOD] Reaver's Faithful Megamod
« Reply #60 on: December 12, 2018, 11:03:28 pm »
I don't know what's wrong with OXCE and I may not have the latest version, though mine is pretty close to up to date. The fact that you aren't experiencing the issue with other images in Faithful means that the image fix I provided should work both for you and me, and anyone else, because it doesn't have any format changes from the other images that work. My original laser image had a format problem in which the image's palette listed index #255 as transparent, instead of 0. It worked fine because I used 0 for background anyway. Your fix switched the background to index 255. Any version of OXCE in which it worked would be one that checks the transparency indexing on the image, rather than assuming #0 is transparent, which I'm pretty sure is not what it is supposed to do.

My fix will work because it keeps 0 as the index color for the background and sets the palette to treat 0 as transparent.

It is working, but so did mine, so I don't know whats going on.

Offline Yankes

  • Commander
  • *****
  • Posts: 2080
    • View Profile
Re: [UFO MEGAMOD] Reaver's Faithful Megamod
« Reply #61 on: December 12, 2018, 11:53:12 pm »
I could say I'm culprit, in 5.1 I do lot of reactor and unify graphic bitting in most cases. But then I test it I saw that some mods have used incorrect indexes on some no battlescape graphic and I get "Great Idea (tm)": "I will fix it of you". On load I check if palette have transparent colors and if it not on index 0 then I swap it with 0 to fit general convention in code that 0 mean transparent.

As I see, you relay on old behavior to fix incorrect graphic and with this "fix" I un-fix your graphics.

Currently working combinations:
No-transparency: index 0 used as transparent
Transparency at 0: only index 0 work as transparent
Transparency at other index: engine will try fix palette, all pixels with this transparent index will be converted to index 0 and it will be set transparent.

There we had case where index 0 was used as background and index 255 that have transparency set, this triggered my code and it swap 255 with 0 making all background opaque.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 4972
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: [UFO MEGAMOD] Reaver's Faithful Megamod
« Reply #62 on: December 13, 2018, 12:26:07 am »
Morale of the story: Stick to the official format.

Official formats are:
1. "no transparency"... the only true xcom format... in which the game represents your non-transparent color index 0 as transparent
2. "transparency on index 0"... this is not the original format, but it is fully compatible and most people use it because it looks nicer in external image editors/viewers

Any other format (e.g. transparency on index 255) is NOT officially supported and whether it works or not depends on time of the year, and 20 other random factors... don't risk it.

I will discuss with Yankes how to align the "side effects" with OXC again... but I strongly recommend using official formats... it's the only way to be sure it works everywhere and for everybody.

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1225
    • View Profile
Re: [UFO MEGAMOD] Reaver's Faithful Megamod
« Reply #63 on: December 13, 2018, 12:39:51 am »
The problem is that mtpaint ignores the transparency setting and has no way of fixing it. The only way for me to fix a broken image is to copy its pixel data into an image with correct transparency. I had to figure this out in order to understand why all my images were getting broken.

I appreciate the change, though, thanks Yankes. My images would have wound up working correctly in the first place if this change had been made prior to my work.
« Last Edit: December 13, 2018, 12:41:32 am by The Reaver of Darkness »

Offline Lord_Kane

  • Sergeant
  • **
  • Posts: 46
    • View Profile
Re: [UFO MEGAMOD] Reaver's Faithful Megamod
« Reply #64 on: December 13, 2018, 12:52:56 am »
Weirdness, because I am just using photoshop to edit this stuff, oh well I guess if it works it works
just fix it as the problems come I guess.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 4972
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: [UFO MEGAMOD] Reaver's Faithful Megamod
« Reply #65 on: December 13, 2018, 12:40:00 pm »
The problem is that mtpaint ignores the transparency setting and has no way of fixing it. The only way for me to fix a broken image is to copy its pixel data into an image with correct transparency. I had to figure this out in order to understand why all my images were getting broken.

So, I installed mtPaint... and changing transparency index looks incredibly easy to me... it's a very prominent input field when saving an image (both as GIF and as PNG), see attached.

What am I missing?

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1225
    • View Profile
Re: [UFO MEGAMOD] Reaver's Faithful Megamod
« Reply #66 on: December 14, 2018, 05:59:49 pm »
When saving!? Why can't I change it during editing?? I would have never looked for it there!! Well thanks anyway. I am bewildered by its placement.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 4972
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: [UFO MEGAMOD] Reaver's Faithful Megamod
« Reply #67 on: December 14, 2018, 06:11:00 pm »
Why can't I change it during editing??

Because it depends on the image format/container.

The palette itself does not contain information about transparency... the image container (e.g. png, gif, etc.) contains this information saved completely independently of the palette.

PS: some palette formats (e.g. Adobe's ACT) can store information about transparency in their palette file... but in the final image, it will still be saved separately in two objects: object 1 = palette without transparency; object 2 = transparency index

PPS: of course, the GUI could make this easier to edit... but this way it is more clear what is actually happening :) "Made by Programmers (tm)"
« Last Edit: December 14, 2018, 06:13:05 pm by Meridian »

Offline kevL

  • Colonel
  • ****
  • Posts: 223
    • View Profile
Re: [UFO MEGAMOD] Reaver's Faithful Megamod
« Reply #68 on: December 15, 2018, 12:18:28 am »
PPS: of course, the GUI could make this easier to edit... but this way it is more clear what is actually happening :) "Made by Programmers (tm)"

mtpaint is hardcore ...

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1225
    • View Profile
Re: [UFO MEGAMOD] Reaver's Faithful Megamod
« Reply #69 on: December 15, 2018, 03:55:25 pm »
The palette itself does not contain information about transparency... the image container (e.g. png, gif, etc.) contains this information saved completely independently of the palette.

I know it's separate of the palette, but isn't the palette part of the image container? I feel like I should have options to edit my image container in the Image menu.

Online Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 4972
  • Aaand we're back!
    • View Profile
    • My Wiki
Re: [UFO MEGAMOD] Reaver's Faithful Megamod
« Reply #70 on: February 04, 2019, 04:53:52 pm »
Hi Reaver,

found a few images with wrong transparency indices in v1.0.5.
Attached are fixed images, if you're interested.

Code: [Select]
Image Resources/ImprovedLivingQuarters/GS2_1.png (from lodepng) have set incorrect transparent color index 255 instead of 0
Image Resources/ImprovedLivingQuarters/GS2_2.png (from lodepng) have set incorrect transparent color index 255 instead of 0
Image Resources/ImprovedLivingQuarters/GS2_3.png (from lodepng) have set incorrect transparent color index 255 instead of 0
Image Resources/ImprovedLivingQuarters/GS2_4.png (from lodepng) have set incorrect transparent color index 255 instead of 0
Image Resources/ImprovedLivingQuarters/LQ2_1.png (from lodepng) have set incorrect transparent color index 255 instead of 0
Image Resources/ImprovedLivingQuarters/LQ2_2.png (from lodepng) have set incorrect transparent color index 255 instead of 0
Image Resources/ImprovedLivingQuarters/LQ2_3.png (from lodepng) have set incorrect transparent color index 255 instead of 0
Image Resources/ImprovedLivingQuarters/LQ2_4.png (from lodepng) have set incorrect transparent color index 255 instead of 0
Image Resources/ImprovedLivingQuarters/LQ2_b_1.png (from lodepng) have set incorrect transparent color index 255 instead of 0
Image Resources/ImprovedLivingQuarters/LQ2_b_2.png (from lodepng) have set incorrect transparent color index 255 instead of 0
Image Resources/ImprovedLivingQuarters/LQ2_b_3.png (from lodepng) have set incorrect transparent color index 255 instead of 0
Image Resources/ImprovedLivingQuarters/LQ2_b_4.png (from lodepng) have set incorrect transparent color index 255 instead of 0

I have replaced those with XComFiles versions, which were already corrected.

Code: [Select]
Image Resources/LargeFacilities/rbasebits_24.gif (from SDL) have set incorrect transparent color index 1 instead of 0

Fixed manually.

Code: [Select]
Image Resources/RedBlueLasers/RedBlueLasers_bigobs.gif (from SDL) have set incorrect transparent color index 255 instead of 0

Fixed manually.

Code: [Select]
Image Resources/XComFiles/Vessels/Basebits/AWACS_base.gif (from SDL) have set incorrect transparent color index 255 instead of 0
Image Resources/XComFiles/Vessels/Basebits/Darkstar_base.gif (from SDL) have set incorrect transparent color index 255 instead of 0
Image Resources/XComFiles/Vessels/Basebits/Hawkeye_base.gif (from SDL) have set incorrect transparent color index 255 instead of 0
Image Resources/XComFiles/Vessels/Basebits/MiG31_base.gif (from SDL) have set incorrect transparent color index 255 instead of 0
Image Resources/XComFiles/Vessels/Basebits/Raven_base.gif (from SDL) have set incorrect transparent color index 255 instead of 0
Image Resources/XComFiles/Vessels/Basebits/Thunder_base.gif (from SDL) have set incorrect transparent color index 127 instead of 0
Image Resources/XComFiles/Vessels/Basebits/Tormentor_base.gif (from SDL) have set incorrect transparent color index 255 instead of 0

I have replaced those with XComFiles versions, which were already corrected.
Please note that new images are PNG, not GIF, so remember to delete the GIFs.
Updated extraSprites.rul is also included in the fix.

Code: [Select]
Image Resources/XComFiles/Vessels/Inticon/AWACS_dogfight.gif (from SDL) have set incorrect transparent color index 255 instead of 0
Image Resources/XComFiles/Vessels/Inticon/AWACS_minimised.gif (from SDL) have set incorrect transparent color index 127 instead of 0
Image Resources/XComFiles/Vessels/Inticon/Darkstar_minimised.gif (from SDL) have set incorrect transparent color index 127 instead of 0
Image Resources/XComFiles/Vessels/Inticon/Dropship_dogfight.gif (from SDL) have set incorrect transparent color index 255 instead of 0
Image Resources/XComFiles/Vessels/Inticon/Dropship_minimised.gif (from SDL) have set incorrect transparent color index 127 instead of 0
Image Resources/XComFiles/Vessels/Inticon/Hawkeye_dogfight.gif (from SDL) have set incorrect transparent color index 255 instead of 0
Image Resources/XComFiles/Vessels/Inticon/Hawkeye_minimised.gif (from SDL) have set incorrect transparent color index 127 instead of 0
Image Resources/XComFiles/Vessels/Inticon/MiG31_dogfight.gif (from SDL) have set incorrect transparent color index 255 instead of 0
Image Resources/XComFiles/Vessels/Inticon/MiG31_minimised.gif (from SDL) have set incorrect transparent color index 127 instead of 0
Image Resources/XComFiles/Vessels/Inticon/Raven_dogfight.gif (from SDL) have set incorrect transparent color index 255 instead of 0
Image Resources/XComFiles/Vessels/Inticon/Raven_minimised.gif (from SDL) have set incorrect transparent color index 127 instead of 0
Image Resources/XComFiles/Vessels/Inticon/Skyraider_dogfight.gif (from SDL) have set incorrect transparent color index 255 instead of 0
Image Resources/XComFiles/Vessels/Inticon/Thunder_dogfight.gif (from SDL) have set incorrect transparent color index 255 instead of 0
Image Resources/XComFiles/Vessels/Inticon/Thunder_minimised.gif (from SDL) have set incorrect transparent color index 127 instead of 0
Image Resources/XComFiles/Vessels/Inticon/Tormentor_dogfight.gif (from SDL) have set incorrect transparent color index 255 instead of 0
Image Resources/XComFiles/Vessels/Inticon/Tormentor_minimised.gif (from SDL) have set incorrect transparent color index 127 instead of 0

I have replaced those with XComFiles versions, which were already corrected.
Please note that new images are PNG, not GIF, so remember to delete the GIFs.
Updated extraSprites.rul is also included in the fix.

Code: [Select]
Image Resources/XenoOperations/Basebits/Corridor.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeHyperP1.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeHyperP2.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeHyperP3.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeHyperP4.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeHyperPC1.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeHyperPC2.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeHyperPC3.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeHyperPC4.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeLabP1.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeLabP2.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeLabP3.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeLabP4.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeLabPC1.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeLabPC2.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeLabPC3.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeLabPC4.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeRadarP1.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeRadarP2.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeRadarP3.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeRadarP4.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeRadarPC1.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeRadarPC2.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeRadarPC3.gif (from SDL) have set incorrect transparent color index 1 instead of 0
Image Resources/XenoOperations/Basebits/LargeRadarPC4.gif (from SDL) have set incorrect transparent color index 1 instead of 0

Fixed manually.

Offline Lord_Kane

  • Sergeant
  • **
  • Posts: 46
    • View Profile
Re: [UFO MEGAMOD] Reaver's Faithful Megamod
« Reply #71 on: February 04, 2019, 10:19:50 pm »
snip by Meridian

I will have to update my mod with these too, as I use reaver's mod as a base, so Thank you Meridian
« Last Edit: February 04, 2019, 10:42:34 pm by Meridian »

Offline The Reaver of Darkness

  • Commander
  • *****
  • Posts: 1225
    • View Profile
Re: [UFO MEGAMOD] Reaver's Faithful Megamod
« Reply #72 on: February 19, 2019, 09:28:18 pm »
Thanks, Meridian. I have been avoiding this for so long because it's such a headache to tackle it. As always, you're a big help.

I have applied the fixes, run a brief test, and updated the mod on here and on the mod portal. If anyone finds any more incorrect transparency indexes, let me know here.

Offline Edwardtoist

  • Squaddie
  • *
  • Posts: 2
    • View Profile
UFO MEGAMOD Reavers Faithful Megamod
« Reply #73 on: March 24, 2019, 12:21:47 pm »
about fwiffo disappearing from the fleet after spathi finally slave-shield their homeworld: is it a bug or a feature?

Offline Lord_Kane

  • Sergeant
  • **
  • Posts: 46
    • View Profile
Re: UFO MEGAMOD Reavers Faithful Megamod
« Reply #74 on: March 24, 2019, 09:05:27 pm »
about fwiffo disappearing from the fleet after spathi finally slave-shield their homeworld: is it a bug or a feature?

Thats a completely different game, thats from Star Control 2, this forum is for OpenXCom and this thread is for a mod for OpenXcom, if you need help with Star Control 2, try here: http://forum.uqm.stack.nl/ they can offer much more assistance :)
« Last Edit: March 24, 2019, 09:09:49 pm by Lord_Kane »