aliens

Author Topic: Graphics overlap  (Read 9326 times)

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Graphics overlap
« on: July 06, 2015, 03:36:17 pm »
I'm working on a new mod, generated my graphics the same way I have always done, but for some reason, they behave really weird. My new items seem to have a 2 by 3 "cloak field" no matter what size they are. They hide other items that are next to them, even though the engine knows the proper size of the item.

See screenshot below where an incendiary grenade hides one square of a laser rifle, even though the engine knows the grenade to be only 1x1 (the number of grenades displays in the proper place, and it indeed fits in a 1x1 space). The engine also knows that the rifle is there as shown by the tooltip on the "empty" square. It's really just a graphic issue.

I've used Falko's palette converter to make the images and it used to work fine. I think it's something to do with the ruleset(s), but I don't know what, so I attached the mod.

Thanks in advance!
« Last Edit: July 06, 2015, 03:37:48 pm by Arthanor »

Offline Aldorn

  • Commander
  • *****
  • Posts: 750
    • View Profile
Re: Graphics overlap
« Reply #1 on: July 06, 2015, 05:51:48 pm »
I think your ruleset is correct, and instead it has something to do with the palette you use, especially with background color


-> Have a look at 001 below, you can see that your ammunition is hiding rounding lines (right)

-> Have a look at 002 which is an example of ammunition 2X1 but with correct background colour : no issue

-> 003 is how your .png likes under my OS (W7) compared to a correct .png

-> 004 shows same issue but on your grenade, that hides part of my X-Ray equipment ! (compared to my incendiary grenade just above ;-))








Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Graphics overlap
« Reply #2 on: July 06, 2015, 06:07:00 pm »
Thanks for checking! I had noticed the ammo issue as well, yes. The images are the right size, so it shouldn't be that.

It could well be the palette, as you say, but that comes from Falko's palette converter. The idea of the green background is something to do with how Macs don't like transparent pictures in OpenXCom, so it's better to use a "dummy color" (in this case bright green) than the transparent color. Interestingly, it is rendered somewhat transparent as it still shows the grid lines, just not the items that are there..

If it's a problem with Falko's tool no longer being compatible with OpenXCom, I won't be able to make graphics anymore :(
« Last Edit: July 06, 2015, 06:09:01 pm by Arthanor »

Offline Aldorn

  • Commander
  • *****
  • Posts: 750
    • View Profile
Re: Graphics overlap
« Reply #3 on: July 06, 2015, 06:15:41 pm »
To be sure, I suggest you to make following test

- get attached file, copy and paste only your ammunition pixels on it (also try to keep max of background pixel unchanged)
- test it under OXC

Then
- try the converter on your new file to only change one color
- test it again under OXC

Result ?

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Graphics overlap
« Reply #4 on: July 06, 2015, 06:25:37 pm »
haha and here we highlight my primitive method of doing graphics work for OpenXCom:

I use a linux paint equivalent to work in RBG, selecting only colors from XCom palette. I then use Falko's "palette fixer" to map my RGB pixels onto XCom's palette.

I cannot make a picture for XCom without using Falko's tool, because what I have is a RGB image.

It is possible that the green background which was fixing a Mac problem with whichever graphics library OpenXCom uses, now creates a problem for the Linux/Windows (and possibly Mac) side of things.

Too bad Falko isn't around anymore.

Offline Hobbes

  • Commander
  • *****
  • Posts: 2101
  • Infiltration subroutine in progress
    • View Profile
Re: Graphics overlap
« Reply #5 on: July 06, 2015, 07:01:37 pm »
haha and here we highlight my primitive method of doing graphics work for OpenXCom:

I use a linux paint equivalent to work in RBG, selecting only colors from XCom palette. I then use Falko's "palette fixer" to map my RGB pixels onto XCom's palette.

I cannot make a picture for XCom without using Falko's tool, because what I have is a RGB image.

It is possible that the green background which was fixing a Mac problem with whichever graphics library OpenXCom uses, now creates a problem for the Linux/Windows (and possibly Mac) side of things.

Too bad Falko isn't around anymore.

yrizoud has published a very nice tool for converting images to the XCom palettes: https://openxcom.org/forum/index.php/topic,3709.msg46970.html#msg46970

Offline yrizoud

  • Commander
  • *****
  • Posts: 1014
    • View Profile
Re: Graphics overlap
« Reply #6 on: July 06, 2015, 09:14:22 pm »
The image files look fine to me, with palette and (lack of) transparency.
On finer analysis, the files have an PNG chunk with a Color Profile ("iCCP"). This kind of information is useless or downright misleading, and the PNG specification says it should appear before palette (PLTE), not after.
Can somebody (who witness problems with the original files) test with the following patched file ? I removed the iCCP data. If it works, Falko's tool has to be fixed.

Offline Aldorn

  • Commander
  • *****
  • Posts: 750
    • View Profile
Re: Graphics overlap
« Reply #7 on: July 07, 2015, 12:03:41 am »
Just made a test, it doesn't fix it from my side, but wait for Arthanor to confirm

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: Graphics overlap
« Reply #8 on: July 07, 2015, 12:16:14 am »
Too bad Falko isn't around anymore.
i am still here
but sadly have less time now
i will take a look at this tommorow at the latest at thursday

Offline myk002

  • Colonel
  • ****
  • Posts: 227
    • View Profile
Re: Graphics overlap
« Reply #9 on: July 07, 2015, 12:17:16 am »
I had trouble with graphics overlap on OSX.  I fixed it by converting the offending images to bmp with gimp and the auto-convert-and-resize plugin.

The same images had worked fine on Linux.

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Graphics overlap
« Reply #10 on: July 07, 2015, 02:57:23 am »
I'll test it tonight or tomorrow morning. What's weird is that those images used to work fine back when I was actively developing the XAE.

Either something changed in OXC, or something changed in the packages it uses. I have a few old installs on my laptop, I'll check with them too.

And thanks Falko for making me lie about your absence :D I am looking forward to your findings.

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Graphics overlap
« Reply #11 on: July 07, 2015, 03:53:45 am »
No, I tested it and it didn't work. It has the same "cloaking" effect.


Offline Dioxine

  • Commander
  • *****
  • Posts: 5412
  • punk not dead
    • View Profile
    • Nocturnal Productions
Re: Graphics overlap
« Reply #12 on: July 09, 2015, 01:43:48 pm »
The image files look okay to me... Try this, does it fix the problem?

Offline Falko

  • Commander
  • *****
  • Posts: 802
    • View Profile
Re: Graphics overlap
« Reply #13 on: July 09, 2015, 09:01:42 pm »
can you upload one of your original files (e.g. incendary grenade) before you put it through the website conversion?

Offline Arthanor

  • Commander
  • *****
  • Posts: 2488
  • XCom Armoury Quartermaster
    • View Profile
Re: Graphics overlap
« Reply #14 on: July 10, 2015, 04:28:38 am »
Here are two examples:

Flamethrower_BigRGB is from my linux paint clone. It's an RBG png.

Flamethrower.gif is just a gif that I got from Dioxine's Piratez mod, as an example of a gif that I would run through a custom recolor on your website (say I want the red to be blue or something).