Jump to content
XCOMUFO & Xenocide

PCK Format


Jenny

Recommended Posts

I'm interested in reading PCK(image) files directly into my editor. However, I've been struggling with the PCK format. There's some info on http://www.ufopaedia.org/index.php?title=Image_Formats#PCK, but it seems it just added to my confusion. :)

 

I tried DaiShiva's PckView, but apparently it's not too fond of Vista, or the other way around. It crashes as soon as I try to open a file.

Link to comment
Share on other sites

I'm interested in reading PCK(image) files directly into my editor. However, I've been struggling with the PCK format. There's some info on http://www.ufopaedia.org/index.php?title=Image_Formats#PCK, but it seems it just added to my confusion. :)

 

I tried DaiShiva's PckView, but apparently it's not too fond of Vista, or the other way around. It crashes as soon as I try to open a file.

 

 

I don't have answers for you but want to say I couldn't make complete sense of one small pck from the information on that wiki page alone, though having it is helpful. I looked at BIGOB_55.PCK, the smallest pck i could find. It has no TAB so i guess that means there's only one image. Some single image pck's do have TAB files though for some reason. I don't understand why there is this at the end of BIGOB_55.pck - FE FF FE FF FE FF FE FF FF , if FF is supposed to mean the end of sprite data.

 

I'm sort of not surprised, PCK view can't open that file and i think daishiva was working on being able to load some of those bigobs files.

 

I'm looking now though at BIGOB_04 which is small and easy to compare to hex data. Its of a pistol clip. The 05 seems to mean 5 rows of transparent pixels, then the image starts. The colors line up when i look at the image that i'll include here. but at the end there is FE FA FE FA FE FA FE FA FE 2E FF I guess that has something to do with filling in the rest of the image in some way. I don't know about that. the EOF FF is at least at the end here though.

 

This is just what PCK view exports. I am pretty sure it doesnt really contain all that empty space. Or does it? It would be odd to me.

Edit :Are you using the pck view from strategy core? I dont have vista but i wonder if PCK-Tool would work in dosbox? I don't even know where i got PCK Tool, which is named PCK_View.exe - 25,936 bytes, no icon

 

http://img188.imageshack.us/img188/6024/clipc.png

Edited by localhosed
Link to comment
Share on other sites

Right I managed to read the first sprite in a PCK file and display it.. problem is I am pretty much guessing width and height so it's a bit deformed. I have no idea how to figure out the dimensions! Edited by Jenny
Link to comment
Share on other sites

Right I managed to read the first sprite in a PCK file and display it.. problem is I am pretty much guessing width and height so it's a bit deformed. I have no idea how to figure out the dimensions!

 

 

Someplace said most images are 32x40. The BIGOB04 seems to be working when i use those dimensions and draw it out in GIMP pixel by pixel using hex data. Not quite done yet. Ill post when i get to the other data at the end of the file.

 

Edit 5:37am : Ok, that clip pck fits in a 32x40 image. The rest of the pixels are filled by 4 times FA plus 2E or 1046 pixels of transparency. The first byte is the number of rows before the image starts, filled with transparency. After that you will be drawing at X=0, y=(value of first byte) .For this sized image that gives me the correct sized image. I guess the color bytes are some value stored in one of the four? palette files. I didn't try looking up each byte to draw in GIMP to see it colored.

 

I heard about non 32x40 images. Havent looked for them yet.

Edited by localhosed
Link to comment
Share on other sites

Since his editor set manipulates pck files, perhaps getting in touch with Bomb Bloke would be the best way to work out how they work. There are various rules to them. Some files take tab files while some don't. Working out which palette to use with them is also important when rendering them to screen.

 

I've not tried it, but I think the key here is to understand the RLE format. When that's worked out, the pck files are then loaded as one big bitmap. You use the offset provided in the .tab file to get the starting position of each 32x40 image.

 

By the way, having had a few misadventures with the bigobs files, I thought I'd mention this:

 

units\bigobs.pck is a composite file with multiple 32x40 images. Make use of its tab file to get the starting offset for each image.

 

ufograph\bigobs_??.pck are individual 32x40 images. These are duplicates of those in units\bigobs.pck, but do not have tab files. I'm assuming that ?? would correspond to the indexes for each tab in the previous file.

 

The reason we have a duplicate is that one set is used in the inventory screen while one is used in the battlescape screen (i.e. the hand slots). A bit of double handling there, but hey.

 

- NKF

Link to comment
Share on other sites

Thanks for the help, guys, but I've figured it out. And yeah, most of them seem to be 32x40.

 

I plan to incorporate X-com art into the next iteration of my editor, so stay tuned.

Edited by Jenny
Link to comment
Share on other sites

To bring up another point, does anyone know how exactly TFTD handles its palette data? There are only three entries in palettes.dat (as opposed to 5 in x-com), but I read that TFTD changes the palettes on the fly as is needed. Anyone know how exactly this works?

 

Primary reason for asking is quite simple. I've read in BIGOBS.PCK and none of the default 3 palettes make it look as it should, so either I'm missing something or some kind of of palette swap is needed.

Link to comment
Share on other sites

This may sound like a broken record, but try contacting Bomb Bloke. He knows more about image formats than anyone I know. And he created a mod which adds TFTD items into Enemy Unknown which required a palette swap. ;)

 

- Zombie

Link to comment
Share on other sites

To bring up another point, does anyone know how exactly TFTD handles its palette data? There are only three entries in palettes.dat (as opposed to 5 in x-com), but I read that TFTD changes the palettes on the fly as is needed. Anyone know how exactly this works?

 

Primary reason for asking is quite simple. I've read in BIGOBS.PCK and none of the default 3 palettes make it look as it should, so either I'm missing something or some kind of of palette swap is needed.

 

 

I'm at the point trying to understand how to use the 64 possible intensities for the rgb colors in the palettes like the ufopaedia.org page says. I guess the hidden TFTD palettes are the four ones bomb bloke wrote about on this page under "TFTD Tactical Palettes" : http://www.ufopaedia.org/index.php?title=PALETTES.DAT

 

If i understand it right, that #1 of these hidden ones would be used for bigobs.

 

Edit: Nope, I don't understand whats going on with value (aka what BB calls intensity i think) yet like i thought i did. Bummer. So i can't help like i thought i could yet.

 

Maybe Seb76 or one of those programming wizards would know. Yes, especially bomb bloke since i found today that he wrote that page.

 

Tripled Edit : Wait yes. Ill rewrite what i suggested but that you probably already tried. If you take the color from bb's PNG's on the '4 hidden' TFTD palettes, you can then reduce the color's value to "25%" in GIMP or whatever the correct equivalent is using the 64 shade system (i guess it'll be "0" the lowest possible). Then you could search for those rgb bytes in the executable. But if tftd doesn't store them in the normal way and instead uses some method to modify other palettes, then searching for them might not work. I wouldn't have an idea of how to find them. Maybe a code wizard like Seb76 would know though.

Edited by localhosed
Link to comment
Share on other sites

The four special Tactical palettes are probably just one (the land palette). See how the game adjusts the blue element of each colour index for their corresponding depths. It probably multiplies the depth by a certain value and adds it to the blue element for each palette entry (in increasing intensity for each colour set). See the black bar between cyan and orange and how everything has blue added to them.

 

- NKF

Edited by NKF
Link to comment
Share on other sites

The four special Tactical palettes are probably just one (the land palette). See how the game adjusts the blue element of each colour index for their corresponding depths. It probably multiplies the depth by a certain value and adds it to the blue element for each palette entry (in increasing intensity for each colour set). See the black bar between cyan and orange and how everything has blue added to them.

 

- NKF

 

 

Well for the first of the four he has it labelled "1. Land & Inventory Displays." . I interpret that as meaning for what i think bigobs are used for in inventory. I guess. I like the underwater colors and light levels, weirder than UFO in my opinion.

Link to comment
Share on other sites

  • 1 month later...
Jenny, can I ask you how you create those colors exactly? I've been using color.fromARGB() to create my colors, but when I'm loading the aliens from the UFOPaedia, I'm getting some very dark images. I'm wondering if maybe I'm using 32 bit colors incorrectly, I understand it's only 8 bit colors, but to get the correct color, I've only been able to use the 32 bit setting. It might be completely different in openGL, but hopefully you can shed some light on what might be weird about this. Thanks.
Link to comment
Share on other sites

Jenny, can I ask you how you create those colors exactly? I've been using color.fromARGB() to create my colors, but when I'm loading the aliens from the UFOPaedia, I'm getting some very dark images. I'm wondering if maybe I'm using 32 bit colors incorrectly, I understand it's only 8 bit colors, but to get the correct color, I've only been able to use the 32 bit setting. It might be completely different in openGL, but hopefully you can shed some light on what might be weird about this. Thanks.

 

The textures were that dark for me as well, so I just amplified them (by about 140% if I recall correctly).

 

Hope this helps.

Link to comment
Share on other sites

The textures were that dark for me as well, so I just amplified them (by about 140% if I recall correctly).

 

Hope this helps.

 

Yeah, that helps a lot. I just wanted to make sure it wasn't me doing something stupid. So, I guess I'll just have to do the same. Thanks a lot.

Link to comment
Share on other sites

  • 1 year later...

Hello. Im trying to recover my old ufo creations.

I got a nice Green Ethereal Pck years ago, and modded it with, adding eyes. The eyes flashing when the alien walks:

 

 

http://img11.imageshack.us/img11/7734/ethereal.jpg

 

Still ethereal and walking ethereal.

 

The problem is:

I dont know why, but in my old pc with Ufo dos version it worked fine. But now, the alien is garbled in teh tactical game.

I edited it years ago and convert the PCK file with the old Win PCK v0.5, but the newest Pck visors (PckView, CnView, XcWiev...) dont works with this file. They dont open the archive.

I want to open the file for further work in it.

 

¿Any tips?

Edited by Yuri Torban
Link to comment
Share on other sites

From what I remember back when I was fiddling with changing sprites and inventory images, pckview is a little broken when it imports images and saves them as PCK files. Every time I used the modified PCK files, the images would get garbled and make the game very unstable.

 

I don't think pckview is saving them correctly. If the other image converters you're using are causing the same problems, then it may be the same problem.

 

The best tool I can probably recommend for importing images and making new pck files is included in Bomb Bloke's tool kit:

 

http://www.strategycore.co.uk/files/index.php?dlid=683

 

All of the modified images I've done with it so far have worked properly.

 

- NKF

Edited by NKF
Link to comment
Share on other sites

Thanks

 

I got the BB tool, made a .bat file and extracted a unmodded file. It works. A nice folder with a bunch of gifs suddenly apeared.

The problem was my bugged ethereal file. The folder created by the tool is empty. My file is corrupted.

 

I must make the entire process again... for the begining.

 

---

 

I downloaded the fenix green ethereal from this site:

http://freelancer.ag.ru/gamearchive/download/index_eng.shtml

but the images are bmps

 

The problem is: I dont have the original green ethereal .pak, but a copule of .bmp images.

 

-Anybody has a healhty green ethereal .pak?

 

-Must I convert all the 75 bmp files to 75 .gifs?

 

-Can I change the orange for the green in the .tab file instead?

 

-Can anybody handdle my green "ethereal with eyes" atached file?

ETHEREAL.rar

Edited by Yuri Torban
Link to comment
Share on other sites

Meanwhile I modded the default orange (I hate the orange ethereal coat) with the BBtool Pck converter.

Some colours are fine. The yellow eyes moving are ok, but the red is bugged. Apears as grey. Tried other tones with photoshop but dont work. All red tones are grey in game. View image:

 

http://img864.imageshack.us/img864/7621/etherealeyesbug.jpg

Still ethereal and walking ethereal, with the eyes lighting...nice.

 

I converted other pcks and seems the red colour is converted as grey.

 

Any solutions for the red colour?

Edited by Yuri Torban
Link to comment
Share on other sites

Unable to repair the bugged red eyes, I tried with PCKview114. The file handle bmps and with this formate I got the eye red. But the picture is garbled at battlescape.

 

Partial solution: the inmobile ethereal hasn´t visible eyes. Only at move its flashing.

 

The file is atached. Replace ethereal.pck and ethereal.tab in UNITS folder. And of course, make a backup of the original files.

 

http://img534.imageshack.us/img534/5361/ethereallightingeyeswal.jpg

 

Download it and enjoy the nice feature!

ethereal_walking_flashing_eyes.rar

Edited by Yuri Torban
Link to comment
Share on other sites

At last!

 

I recovered my old ethereal from an ancient CD.

I putted it in UNITS folder and the game recognices it at once.

 

http://img827.imageshack.us/img827/3916/greenethereal.jpg

The green coat ethereal (Thanks Fenix) with with red eyes that light up when walking.

 

 

Make a backup of the original files. Download the zip, and put the etehreal.pck and ethereal.tab in the UNITS folder.

Ethereal_green_red_lighting_eyes.rar

Edited by Yuri Torban
Link to comment
Share on other sites

Another PCK one: The Xcom2 biodrone.

The original one is bugged. Without the apropiate animation and a still green patch moving atached.

 

http://img37.imageshack.us/img37/7558/oldbiodrone.jpg

 

 

I remade it, cleaning the rays and restoring the spinning and "under radiate" animation:

 

http://img851.imageshack.us/img851/2702/biodrone.jpg

 

Download, unzip and replace the biodron.pck and biodron.tab in the units folder. Make a bakup.

 

Enjoy it.

New_biodrone.rar

Edited by Yuri Torban
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...