Question on Creating resource file graphics

F4Browse, CATE, Tacedit, Terrainview & TheaterMaker etc utility related

Moderators: Lone Wolf, Snake Man

User avatar
Sherlock
Lt. General
Posts: 1167
Joined: 2006-05-24 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Arizona, USA

Question on Creating resource file graphics

Post by Sherlock » 2007-03-18 19:12:14

OK,
I know the Ultimate Theater Tutorial says to use 256 color/8 bit images for resource file graphics. However, I've noticed that when I unpack Allied Force RSC file graphics that they are all 24 bit/16 million colors. So I would think we should be able to put our own 24 bit/16 Million color images back in and use them right?

Here's the rub. I am using Paint Shop Pro 7 (PSP7) as my graphics program. When I put a 24 bit/16 million color graphic back into the rsc file, most of the time it will not show up properly in the UI. But when I put it in as a 256/8bit image it always shows up properly. BUT I have been able to once or twice get a 24 bit/16 million color image to show up correctly (but I don't know what I did exactly to get it to work! :( ).

Here's my question: What is the secret to getting these images saved as 24 bit/16 million colors so that they will always show up in the UI properly as they should?

signed: Sherlock aka "Graphically challenged"
Sherlock
Victurous te Saluto

Snake Man
Commander-In-Chief
Posts: 9351
Joined: 2000-07-31 22:01:01
Gaming Interests: ArmA, ArmA 2, Falcon 4.0 and OFP.
Editing Interests: All, I (try) to edit everything.
Location: PMC

Post by Snake Man » 2007-03-19 01:55:52

Very useful post for you; I don't know :)

I didn't even knew that AF had different color support on the images. Its well worth to mention in the tutorial updates, thanks for letting us know.
PMC Tactical Forum New User Registration please read new info here.

PMC since 1984

Editing knowledge, visit PMC Editing Wiki
The leading, most detailed and comprehensive modification made for the Vietnam War - Vietnam: The Experience homepage
View our videos in PMC Youtube channel

PMC Tactical forum Advanced Search is power.

"ALPHA BLACK TO PAPA BEAR. ALL RUSSIANS ARE TOAST. OVER."

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Post by T_Rex » 2007-03-19 02:36:55

If you can, post a screenshot of the corruption. I'll hazard a guess, though, and it is the palette. Make sure your own graphic is saved as indexed, not RGB. I would suspect that the times you've gotten it to work, you probably modified an existing graphic and kept the same palette.

But, when you save it 256/8, there is enough room in the palette for there to not be a problem.

Pure conjecture, though, eh. :D
Sic Semper tyrannosauro.

User avatar
Sherlock
Lt. General
Posts: 1167
Joined: 2006-05-24 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Arizona, USA

Post by Sherlock » 2007-03-19 04:36:58

Can I get a quick class in the difference between RGB and indexed? :)
Sherlock
Victurous te Saluto

T_Rex
FreeFalcon
Posts: 848
Joined: 2001-03-04 23:01:01
Location: here

Post by T_Rex » 2007-03-19 12:27:01

hehehe

As long as you promise not to think this is the "right" answer. :D Here's wiki entries for something that's probably alot closer to a "right" answer:
http://en.wikipedia.org/wiki/Indexed_color
http://en.wikipedia.org/wiki/RGB_color_model

Ok.

From what I can tell, programs that display graphics (like F4) prefer to have all the colors nice and orderly and 'indexed.' That means the color palette - the grid of all the colors in a picture - are in a particular order. "Indexed" is what it is called in PhotoShop, but I think in PSP, it is something like "Use palette" or something. I can check on that tonight.

But, graphics manipulation programs don't like to be limited like that. To use things like layers, etc., you need to have a file with RGB identification of the colors. This means you can use any color, not just the ones already in the palette.

There's also a bit of a complication in F4, where the original file types didn't allow for a separate alpha/transparency channel. You had to use a color in the palette to designate what the transparency color was. So, for skins it was that lavender, and in cockpits it was blue, and in other files it was the first (or last, depending on your program) color in the indexed palette.

So, for F4, you're (usually) left with taking a previous graphic, converting it to RGB in a graphics program, messing with it, converting it back to indexed, THEN saving the palette, messing with the palette to make sure the transparency colors aren't messing anything up, saving the palette, then re-saving the graphic with a corrected palette.

(BTW, BMS did away with specific palette transparencies for skins because DDS allows for a separate alpha channel.) ;) :)

I'll try to find more info on the PSP v. PS handling of palettes. There's got to be something out there.
Sic Semper tyrannosauro.

Closter
Captain
Posts: 154
Joined: 2007-01-07 00:13:42

Post by Closter » 2007-03-19 13:10:15

To me, the main difference is this:

- In indexed image, the file is made from two series of numbers. First, the palette, that is a series (usually 256) of three values (usually bytes) that mean RGB colours. Second, the pixel colours, that are represented like a series (X times Y) of values (usually range 0 to 255, 1 byte) meaning the colour of that pixel as a index in the palette.

-In RGB image, there is no palette, and the colour of each pixel is made from the series (X times Y) of three (four) values (usually bytes). Each three values means the colour of that pixel as addition of 0 to 255 levels of red, same for green, same for blue. If three values, this is a 24 bit image, if four values then 1 could be used as Alpha channel meaning transparency. This is called 32 bit, same colours as a 24 bit. Other name, True Color.

-As a side note, 16 bit colour image means each pixel colour is made of the addition of 5 bit of levels of each colour, meaning 32 different levels of red, green and blue. The last bit could be used as a mask. There are other uses of the different bits, e.g. give green 6 bits (we are more ready to select levels of green). This means a indexed image could look even better than a 16 bit (also called High-Color) one.

For sure there is more... but you get the idea.
Image

Closter
Captain
Posts: 154
Joined: 2007-01-07 00:13:42

Post by Closter » 2007-03-29 19:43:44

AFAIK , most graphics in the files are 16bit, not 16 million colors as the tutorials said. Some of them are 8bit, 256 colors.

When the perl scripts work they verbosely give indications of the deep of the file's color " ...pal 2..." means 2 colors of the palette are used. If they say " pal 0" I guess it is 16bit color.

Please Snakeman, review the tutorials, I am having troubles with them too.
Image

ranger822
Banned user
Posts: 389
Joined: 2004-07-27 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Beautiful Virginia

Try a MacFalcon Tool

Post by ranger822 » 2007-03-29 20:46:12

For those of you that have a Macintosh for your really important work . . Rick Prior made a tool for me to pack and unpack the art resource files. . .

@Closter - download the ITO2 package - and then use one of the idx/rsc file sets for patches, mainbg, etc - - I used a tool which sidesteps using perl for any of that crap. There are two types of images that seem to work Targa Type 1 and Type 2. I nearly always use Type 2 which are 16 bit images . . . anyway - if your exe can use my image sets and you can find someone with access to a Macintosh I will send you the tools you need to convert your art/resource files the easy and quick way.

Closter
Captain
Posts: 154
Joined: 2007-01-07 00:13:42

Post by Closter » 2007-03-30 08:18:48

I don't mind using perl scripts (well in fact is boring...) but it is annoying to find all those errors. People are giving up making theaters because of this!

Ultimate Theater Tutorial. Part 3
1º E.g.:
- "- Start your paint program, open europe-features.bmp, resize it to 256x256 256 colors GIF and save it into the campaign\europe directory under the name of kneemap.gif - this is your kneemap ingame."

NEGATIVE. It is 2048 pixels (128 segments) or 1024 (64 segments)

2º E.g.:
-"resize it to 344x344 256 color TGA, flip it (vertical) and save it to BID_3FLY_DIS.tga filename."

-"resize it to 172x172 256 color TGA, flip it (vertical) and save it to IA_MAP_TGA.tga filename."

-"resize it to 370x370 256 color TGA, flip it (vertical) and save it to JSTARS_MAP.tga"

NEGATIVE. All these files are 16bit color TGA Type 2

3º E.g.:
-"resize it to 256x256 256 color TGA and save it to KOREA_256.tga filename."

NEGATIVE. The size is 258x258 and its depth 16bit color TGA Type 2

4ºE.g.:

There is nothing said about KOREA_512.tga that is double the previous size(516x516), and nothing about art1024 where all previous work has to be redone


@Sherlock, some programs see this TGA 16 bit RGB as 24 bit RGB when you load it. E.g.: Irfanview or Photoshop. Be careful!

I am still learning what is the correct size and depth for the BIG_MAP_ID.tga and BIG_AWACS_MAP_ID.tga
Image

User avatar
Sherlock
Lt. General
Posts: 1167
Joined: 2006-05-24 22:01:01
Gaming Interests: Falcon 4.0
Editing Interests: All, I (try) to edit everything.
Location: Arizona, USA

Post by Sherlock » 2007-03-30 15:57:30

Thanks Closter, Snake Man, Ranger and T_Rex!

Your additional info is helping me to understand the process and the "gotchas" to look for. Keep those suggestions/in-sights coming guys! :)
Sherlock
Victurous te Saluto

Closter
Captain
Posts: 154
Joined: 2007-01-07 00:13:42

Post by Closter » 2007-04-03 14:04:36

I have followed the ODS 512 path, and now I am able to see all these files. I am surprised to see some differences, but this way nearly all is working.


Theater 128 seg. a la ODS 512.


-kneemap.gif 256 colors GIF
2048 pixels (128 segments) or 1024 (64 segments). As usual.

main:

-IA_MAP_TGA.tga
172x172 tga RGB 16bits

-BID_3FLY_DIS.tga
344x344 tga RGB 16bits

campmap:

-BIG_MAP_ID.tga
4096x4096 indexed 256 colors

-BIG_AWACS_MAP_ID.tga
4096x4096 indexed 256 colors

intel:

-JSTARS_MAP.tga
370x370 tga indexed 256 colors.

-KOREA_256.tga
512x512 tga indexed 256 colors.

-PAK_OUTLINE_OVERLAY.tga
512x512 tga RGB 16bits

-PAK_REGION_OVERLAY.tga
512x512 tga RGB 16bits

Korea_512.tga not used. In theory goes into intel.rsc ---> artspain\art1024.

mainbg.rsc:

-MAIN_SCRN.tga
1024x768 tga RGB 16bits.

And one very important thing: apart from having correct format, you need not having intel.irc in art\resource.

All this for SP4.2 exe.
Image

Who is online

Users browsing this forum: ClaudeBot [Bot] and 0 guests