Trying to get yellow translucent color into the game
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Trying to get yellow translucent color into the game
Shape 912 in Black Gate is puddles of "blood" in various colours. Frames 12-15 are yellow, with solid colour on the edges and translucent in the middle of the puddle. I have extracted those graphics both in .png and .shp form and examined them in Gimp, and from what I can tell, the translucent yellow colour should be the one in palette slot 248. However, trying to insert the graphics into the game results in that colour showing up as white. I have tried importing that both in .png and .shp form.
-
- Site Admin
- Posts: 985
- Joined: Thu May 14, 2020 1:34 pm
Re: Trying to get yellow translucent color into the game
In the game palette, the last 32 colors are 'special'. They behave, by index (0-based), as follows:
224 to 231: Rotation group (8 colors).
232 to 239: Rotation group (8 colors), 238 and 239 are translucent for some shapes.
240 to 243: Rotation group (4 colors), translucent for some shapes.
244 to 247: Rotation group (4 colors), translucent for some shapes.
248 to 251: Rotation group (4 colors), translucent for some shapes.
252 to 254: Rotation group (3 colors), translucent for some shapes.
255: Completely transparent.
These are the semi-transparent colors you are looking for. That is, if the shape in question has/can have translucency. Based on shape source, here is the breakdown:
- faces.vga, sprites.vga: Always translucent.
- fonts.vga, gumps.vga: Never translucent.
- paperdol.vga, shapes.vga: Translucent if you check the 'translucent' check box in the shape information window in ES (in the appropriate tab).
Now, for the actual translucency information. Normally, Exult will load the translucency tables from the "xform.tbl" in static dir. There are 17 such tables (one for each translucent color), and these indicate what each palette entry will look like behind that translucent color. If Exult doesn't find the above file, it creates the tables using certain RGBA values for each translucent color; these RGBA values are also used for OpenGL rendering, so they can be trusted.
By default, the translucent colors should be the following color in game:
I'm not sure about index 238-243 colors.
Note: These values are used for rendering. If you try to input these values in your image, you will not get what you want! Like I said, you have to use the game palette and use the colors for the corresponding palette entries or use the shape plug-in and paint with the color it generates for the palette.
224 to 231: Rotation group (8 colors).
232 to 239: Rotation group (8 colors), 238 and 239 are translucent for some shapes.
240 to 243: Rotation group (4 colors), translucent for some shapes.
244 to 247: Rotation group (4 colors), translucent for some shapes.
248 to 251: Rotation group (4 colors), translucent for some shapes.
252 to 254: Rotation group (3 colors), translucent for some shapes.
255: Completely transparent.
These are the semi-transparent colors you are looking for. That is, if the shape in question has/can have translucency. Based on shape source, here is the breakdown:
- faces.vga, sprites.vga: Always translucent.
- fonts.vga, gumps.vga: Never translucent.
- paperdol.vga, shapes.vga: Translucent if you check the 'translucent' check box in the shape information window in ES (in the appropriate tab).
Now, for the actual translucency information. Normally, Exult will load the translucency tables from the "xform.tbl" in static dir. There are 17 such tables (one for each translucent color), and these indicate what each palette entry will look like behind that translucent color. If Exult doesn't find the above file, it creates the tables using certain RGBA values for each translucent color; these RGBA values are also used for OpenGL rendering, so they can be trusted.
By default, the translucent colors should be the following color in game:
Code: Select all
- 244: R 144, G 40, B 192, A 128
- 245: R 96, G 40, B 16, A 128
- 246: R 100, G 108, B 116, A 192
- 247: R 68, G 132, B 28, A 128
- 248: R 255, G 208, B 48, A 64
- 249: R 28, G 52, B 255, A 128
- 250: R 8, G 68, B 0, A 128
- 251: R 255, G 8, B 8, A 118
- 252: R 255, G 244, B 248, A 128
- 253: R 56, G 40, B 32, A 128
- 254: R 228, G 224, B 214, A 82
Note: These values are used for rendering. If you try to input these values in your image, you will not get what you want! Like I said, you have to use the game palette and use the colors for the corresponding palette entries or use the shape plug-in and paint with the color it generates for the palette.
-
- Site Admin
- Posts: 985
- Joined: Thu May 14, 2020 1:34 pm
Re: Trying to get yellow translucent color into the game
Yeah, I'm having that issue as well when trying to import a shp made from Gimp and not exported.
Edit: Palette index 248 is white for ES so it shows up that way. I have had the wrong index saved when I tried to save the first time in GIMP with an image created that was not indexed before converting. I opened it as a shp file and when I changed the color index, it displayed properly. Importing it worked properly too although I'm not sure how recent this ES version is.
Edit: Palette index 248 is white for ES so it shows up that way. I have had the wrong index saved when I tried to save the first time in GIMP with an image created that was not indexed before converting. I opened it as a shp file and when I changed the color index, it displayed properly. Importing it worked properly too although I'm not sure how recent this ES version is.
Re: Trying to get yellow translucent color into the game
The RGBA values are actually approximations, found by doing least squared error approximations. The translucency tables seem to be based on a subtractive color model rather than the alpha model, but I couldn't find a way to reverse engineer it yet.
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
Re: Trying to get yellow translucent color into the game
What puzzles me is that I have not had such problems with other translucent colors. If anyone can provide me with any directions on how to get yellow translucent color into the game, I would greatly appreciate that.
-
- Site Admin
- Posts: 985
- Joined: Thu May 14, 2020 1:34 pm
Re: Trying to get yellow translucent color into the game
240 is a brighter yellow. Translucent colors will look different depending on the background backgrounds. Importing is working fine for me on shape files.
Create a new file. Index it and save it as .shp.
Revert it. (notice that the file is screwed up)
Then you can start editing the picture.
Import it into Exult Studio.
Set the shape as translucent.
Save all.
Link to test shp file
It looks like 255 is not displayed as completely transparent or even translucent but as opaque black.
I'm not sure what transparent flag does offhand.
Create a new file. Index it and save it as .shp.
Revert it. (notice that the file is screwed up)
Then you can start editing the picture.
Import it into Exult Studio.
Set the shape as translucent.
Save all.
Link to test shp file
It looks like 255 is not displayed as completely transparent or even translucent but as opaque black.
I'm not sure what transparent flag does offhand.
Re: Trying to get yellow translucent color into the game
The translucent flag makes the shape use translucency instead of palette cycles for the colors in question. And color 255 should be displaying as completely transparent. It is possible that the entry in question is being converted to something else.
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
-
- Site Admin
- Posts: 985
- Joined: Thu May 14, 2020 1:34 pm
Re: Trying to get yellow translucent color into the game
I wrote transparent not translucent.
Exult Studio exported the shape and it still had index 255 so this would appear to be an issue with Exult.And color 255 should be displaying as completely transparent. It is possible that the entry in question is being converted to something else.
Re: Trying to get yellow translucent color into the game
Oh, right, the transparent flag; sorry, I misread. The transparent flag makes the object in question not receive clicks; they instead go through to whatever is underneath he object.
------
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
Marzo Sette Torres Junior
aka Geometrodynamic Dragon
[url=http://www.catb.org/~esr/faqs/smart-questions.html]How To Ask Questions The Smart Way[/url]
Re: Trying to get yellow translucent color into the game
Which version of GIMP do you use, Malignant Manor? I recently updated to 2.8.0, and following your directions I am unable to revert, probably because that version opens all images as temporary .xcf files for editing.
Re: Trying to get yellow translucent color into the game
Nevermind, I did manage to get it to work as intended. Thank you!
-
- Site Admin
- Posts: 985
- Joined: Thu May 14, 2020 1:34 pm
Re: Trying to get yellow translucent color into the game
It would be nice if you posted your workaround for future reference. (I'm on GIMP 2.6.8 and am pretty busy at the moment.)Nevermind, I did manage to get it to work as intended. Thank you!
Re: Trying to get yellow translucent color into the game
I did follow your directions for the most part. The only difference is really that instead of reverting, I opened the .shp file in a new window. Thus, this would be the actions step-by-step:
Create a new file.
Index and save as .shp.
Open the .shp file you just created. Now it should have the bottom half empty, and the top quarters each have a slightly different 1/4 sized image of whatever graphics there were to begin with.
Edit the picture as you please, and save again as .shp.
Import in Exult Studio.
Set the shape as translucent.
Save all.
In step 3, you do not need to specify a palette when GIMP asks for one. Instead you can use the colormap GIMP 2.8.0 automatically creates for each opened image. For reference, for me that has color index #248 as bright yellow, #249 as bright blue, #250 as bright green and #251 as bright red.
Create a new file.
Index and save as .shp.
Open the .shp file you just created. Now it should have the bottom half empty, and the top quarters each have a slightly different 1/4 sized image of whatever graphics there were to begin with.
Edit the picture as you please, and save again as .shp.
Import in Exult Studio.
Set the shape as translucent.
Save all.
In step 3, you do not need to specify a palette when GIMP asks for one. Instead you can use the colormap GIMP 2.8.0 automatically creates for each opened image. For reference, for me that has color index #248 as bright yellow, #249 as bright blue, #250 as bright green and #251 as bright red.