Go Back   Forums > Community Chatterbox > Tech Corner
Memberlist Forum Rules Today's Posts
Search Forums:
Click here to use Advanced Search

Reply
 
Thread Tools Display Modes
Old 20-05-2009, 03:35 AM   #21
weylin
Forum hobbit

 
Join Date: May 2009
Location: Bullhead City, United States
Posts: 38
Default

Ohh... I was looking at HUNTERCP.ACT That might just be a muzzle flash.

The HUNTER.ACT file has far more complexity.

I'm guessing the .'s are the dark areas of the image, while the blocks of symbols are where the different colored pixels would be.

What makes up a single letter on the hex editor, like 6C, might accually be many pixels.


Any way to take a file, and using different offsets, 4bit, 8bit, try and build an image out of it?
weylin is offline                         Send a private message to weylin
Reply With Quote
Old 20-05-2009, 09:50 AM   #22
AlumiuN
Vodka-Induced Entertainment
 
AlumiuN's Avatar

 
Join Date: Jan 2008
Location: Christchurch, New Zealand
Posts: 1,044
Default

Quote:
Originally Posted by weylin View Post
What makes up a single letter on the hex editor, like 6C, might accually be many pixels.
Unless it's a compressed format, then it isn't. After all, two hex letters make up 256 total possibilities, and if it's a 256 colour image...
__________________


Lies are for those who cannot handle the truth, but truth is for those who cannot handle the lies.
AlumiuN is offline                         Send a private message to AlumiuN
Reply With Quote
Old 20-05-2009, 10:49 AM   #23
The Fifth Horseman
FUTURE SCIENCE BASTARD
 
The Fifth Horseman's Avatar


 
Join Date: Oct 2004
Location: Opole, Poland
Posts: 14,276
Default

Quote:
I'm guessing the .'s are the dark areas of the image, while the blocks of symbols are where the different colored pixels would be.
Ignore the ASCII display - most of the time it's useless. Concentrate on the hexadecimal data.
Quote:
Any way to take a file, and using different offsets, 4bit, 8bit, try and build an image out of it?
The easiest thing to try is to stick the image data we've got into a PCX or an indexed-mode BMP replacing the original data.
Then prod around the offsets responsible for image width/height and see if the results make sense.
That's basicaly what I did with Space Hulk's CPH format earlier this year.
__________________

"God. Can't you people see I'm trying to commit a crime against science and nature here?"
-- Reed Richards
The Fifth Horseman is offline                         Send a private message to The Fifth Horseman
Reply With Quote
Old 21-05-2009, 10:46 PM   #24
weylin
Forum hobbit

 
Join Date: May 2009
Location: Bullhead City, United States
Posts: 38
Default

Usually the RGB color would be a 6 digit hex code.
RRGGBB

each hex pair could only do the 256 for each color, red green or blue.

Is this correct? Or do you think they used an even more compressed method, such as having every 8 bits act as an index for a pre-defined pallet, rather than 8 bits for red green and blue?



Do you know of any programs that can open raw data as an image?
Audacity can take anything, and import it as a raw data format.
Is there a graphical version of something like this?

Something with various settings, bit depth, height and width, "sliding" across the read data to possibly slip into the right alignment, the correct way the data should be read.
Perhaps a dialog that offers options on how each bit of data should be read.

Last edited by weylin; 21-05-2009 at 11:02 PM.
weylin is offline                         Send a private message to weylin
Reply With Quote
Old 21-05-2009, 11:37 PM   #25
AlumiuN
Vodka-Induced Entertainment
 
AlumiuN's Avatar

 
Join Date: Jan 2008
Location: Christchurch, New Zealand
Posts: 1,044
Default

Quote:
Originally Posted by weylin View Post
Usually the RGB color would be a 6 digit hex code.
RRGGBB

each hex pair could only do the 256 for each color, red green or blue.

Is this correct? Or do you think they used an even more compressed method, such as having every 8 bits act as an index for a pre-defined pallet, rather than 8 bits for red green and blue?



Do you know of any programs that can open raw data as an image?
Audacity can take anything, and import it as a raw data format.
Is there a graphical version of something like this?

Something with various settings, bit depth, height and width, "sliding" across the read data to possibly slip into the right alignment, the correct way the data should be read.
Perhaps a dialog that offers options on how each bit of data should be read.
That would be correct if it used 24-bit sprites, and if Horseman is right in saying it uses a local palette (which it probably does), then it'll be a 256 colour palette. Or maybe larger, but it certainly won't need three bytes per pixel with a palette.
__________________


Lies are for those who cannot handle the truth, but truth is for those who cannot handle the lies.
AlumiuN is offline                         Send a private message to AlumiuN
Reply With Quote
Old 22-05-2009, 08:31 AM   #26
The Fifth Horseman
FUTURE SCIENCE BASTARD
 
The Fifth Horseman's Avatar


 
Join Date: Oct 2004
Location: Opole, Poland
Posts: 14,276
Default

Quote:
Is this correct? Or do you think they used an even more compressed method, such as having every 8 bits act as an index for a pre-defined pallet, rather than 8 bits for red green and blue?
As you might have noticed, using 24-bit color would make the image data take up quite a lot of space.
When using a 256-color palette, you only need one byte per pixel, referring to a color in the palette. This reduces the amount of bytes needed to store the image data a threefold. In addition, VGA graphic cards commonly used at the time the game was published just simply couldn't simultaneously display more than 256 colors.

In addition, you can do a lot of things with palettized images that would be more complicated (or just too CPU-intensive to do in realtime) with RGB ones - like instantly change a sprite's colors, use same image to create three differently colored sprites simply by switching around references to certain palette colors index, colorize the game graphics by swapping palette colors for different ones and so on. UFO: Enemy Unknown is a prime example - using a palette of sixteen shades of sixteen colors, the game is able to create lighted enviroment simply by increasing or decreasing the references to pallete color numbers depending on the area's level of lighting. This way, a single sprite can be drawn with sixteen different levels of lighting.

Quote:
Do you know of any programs that can open raw data as an image?
Audacity can take anything, and import it as a raw data format.
Is there a graphical version of something like this?

Something with various settings, bit depth, height and width, "sliding" across the read data to possibly slip into the right alignment, the correct way the data should be read.
Perhaps a dialog that offers options on how each bit of data should be read.
Not that I know of.
The quickest way for similar results would be to use a hex editor to insert the suspected data into a PCX file and mess around with width and height values.
You'd need a palette for that, though.
__________________

"God. Can't you people see I'm trying to commit a crime against science and nature here?"
-- Reed Richards

Last edited by The Fifth Horseman; 22-05-2009 at 08:37 AM.
The Fifth Horseman is offline                         Send a private message to The Fifth Horseman
Reply With Quote
Old 22-05-2009, 10:01 AM   #27
weylin
Forum hobbit

 
Join Date: May 2009
Location: Bullhead City, United States
Posts: 38
Default

Could you tell me how to make a PCX?

I tried making -careful- edits to a blank 32x32 white PCX image, and it got a corrupted data error, and opened it anyways but with wierd results, discoloration at the bottom.

Maybe because it was all one color, I was screwing up the compression it uses... because the whole line turned yellow
weylin is offline                         Send a private message to weylin
Reply With Quote
Old 22-05-2009, 10:12 AM   #28
The Fifth Horseman
FUTURE SCIENCE BASTARD
 
The Fifth Horseman's Avatar


 
Join Date: Oct 2004
Location: Opole, Poland
Posts: 14,276
Default

The PCX is composed of three parts: the header, the image data and the palette. If anything's missing, then you'll get weird results.
I'll give you some details on the format later, my notes are on the home PC.
__________________

"God. Can't you people see I'm trying to commit a crime against science and nature here?"
-- Reed Richards
The Fifth Horseman is offline                         Send a private message to The Fifth Horseman
Reply With Quote
Old 22-05-2009, 08:02 PM   #29
weylin
Forum hobbit

 
Join Date: May 2009
Location: Bullhead City, United States
Posts: 38
Default

The pallet can come before or after as long as it has a proper tag, can't it?

I looked at the wiki article but im still confused as to how to structure one from scratch.


BTW, the game lion, I believe it uses a gradually changing color pallet for the day/night cycle. Not sure how many stages the pallet transition is, but it changes from full color to redish orange, then to to a grey and blue scheme from dusk till night.
It does this transition very gradually so I'm uncertain if the pallet undergoes some sort of scripted change over time, or if the pallets are framed, changing pallets every few seconds.
weylin is offline                         Send a private message to weylin
Reply With Quote
Old 22-05-2009, 10:07 PM   #30
The Fifth Horseman
FUTURE SCIENCE BASTARD
 
The Fifth Horseman's Avatar


 
Join Date: Oct 2004
Location: Opole, Poland
Posts: 14,276
Default

Believe me, you'd notice the palette. A 256-color palette with 3 bytes per color needs 768 bytes, assuming the records are stored directly one after another.

In a PCX, the palette is placed at the end of file. I'm pretty sure the palettes are not stored in the ACT files - and given what you just told me, they might be hard-coded into the game itself.

I'm attaching a RAR with three useful things. The first is a header from a PCX file, remaining two are palettes fror use with it.

Copy the part of the ACT you think is the image data and open the header, Paste the data at the end of the header and adjust the width/height offsets as follows:
* offset 08h : hexadecimal value of image width decreased by 1
* offset 42h : hexadecimal value of image width
* offset 0Ah :hexadecimal value of image height decreased by 1

Then copy any pre-made palette and paste it on the end of the file.
Save with extension PCX.
And... yep, that's one working PCX
Attached Files
File Type: rar PCX.rar (589 Bytes, 2 views)
__________________

"God. Can't you people see I'm trying to commit a crime against science and nature here?"
-- Reed Richards
The Fifth Horseman is offline                         Send a private message to The Fifth Horseman
Reply With Quote
Reply


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dos Box File Extracting Problems discotillyoudie Troubleshooting 6 17-03-2007 04:15 AM
Something Went Wrong In The Extracting Process Brian Troubleshooting 3 13-09-2006 03:08 PM
Self-extracting Archives The Fifth Horseman Old Suggestions 23 03-08-2005 08:54 AM
Opening Or Extracting Bin Files troop18546 Tech Corner 13 29-04-2005 10:02 PM


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump
 


The current time is 03:01 AM (GMT)

 
Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.