Hey ppl
Its possible to make a pluggin to this game Manhattan Chase
I have uploaded one file from textures directory they use this format for almost all files they have in the game if you can plz take a look on it.
Thx
Important information: this site is currently scheduled to go offline indefinitely by end of the year.
Manhattan Chase
-
- Site Admin
- Posts: 4073
- Joined: Wed Jan 15, 2003 6:45 pm
- Location: Dungeons of Doom
- Has thanked: 450 times
- Been thanked: 682 times
- Contact:
This is a file that contains increasingly smaller textures for the same item (like MIP maps in DDS). I haven't quite figured out the format of the images yet. They do not look compressed really, as the image data matches the height*width variables in there. So it should be an 8-bit image format.
Do you have more examples? There are still some variables in the 0x24 header that I don't understand.
Do you have more examples? There are still some variables in the 0x24 header that I don't understand.
-
- advanced
- Posts: 47
- Joined: Sun Mar 07, 2004 6:37 am
- Location: USA
- Contact:
The DCT texture file format is indeed a DDS file with mips. The DCT header is 48 bytes and contains all the information including the width and height. All that I looked at were DXT3 format which may mean that modders can utilize the alpha channel.
Marvey:
Since I'm on the road and using this old laptop I don't think I have enough resources available to write and test a Perl conversion script but if you want to convert by hand I can tell you how with Photoshop and a HEX editor.
Marvey:
Since I'm on the road and using this old laptop I don't think I have enough resources available to write and test a Perl conversion script but if you want to convert by hand I can tell you how with Photoshop and a HEX editor.
Strange but I sat understood with formats of all files this game and have come to conclusion what not what there DXT3 even does not smell as a format... At all files with expansions DCT, DCW, DCM, DCA, CAM , MCS, DCV, DCL, dcShadow, dcScript heading DC2 and further on all file almost one zero... What think in this occasion?
This example CAM file format
DC2...........?....i...k.
.?...=...:...B...?....2?
This example DCT file format
DC2.......................................
.................................................
.................................................
..................................................
...................................................
..................................................
..................................................
....................................................
.....................................................
........................................................
..................................
This example CAM file format
DC2...........?....i...k.
.?...=...:...B...?....2?
This example DCT file format
DC2.......................................
.................................................
.................................................
..................................................
...................................................
..................................................
..................................................
....................................................
.....................................................
........................................................
..................................
-
- advanced
- Posts: 47
- Joined: Sun Mar 07, 2004 6:37 am
- Location: USA
- Contact:
If I read your translation correctly, you do not understand how I concluded the DCT files are DXT3.
The DC2 header is 48 bytes long. If you remove this header the remaining data is a raw DXT3 with mips. It is not readable as a DXT3 because there is no DDS header. I looked at some other textures and there are both DXT1 and DXT3
To make it a DDS you will need to add a DDS header. This can be done by creating a DDS DXT3 file in the size needed with mips. Then remove the 128 byte header from your newly created DDS and attach it to the top of the raw DDS. The same for DXT1
To get the correct file size look at the original DC2 header. The 2 byte word at byte 19 is the width and the 2 byte word at byte 23 is the height. I also noticed the file size height and width at byte 36 and 38
For instance this Perl script would work for the DXT3
Basically the script reads the 48 byte header , gets the size of the graphic, removes the 48 byte header , puts the DDS header on the file using the size from the original header. Just a time saver since it will read every DCT file in the folder and convert to DXT3. I tried it on a few and the actual DXT3 files came out ok.
The DC2 header is 48 bytes long. If you remove this header the remaining data is a raw DXT3 with mips. It is not readable as a DXT3 because there is no DDS header. I looked at some other textures and there are both DXT1 and DXT3
To make it a DDS you will need to add a DDS header. This can be done by creating a DDS DXT3 file in the size needed with mips. Then remove the 128 byte header from your newly created DDS and attach it to the top of the raw DDS. The same for DXT1
To get the correct file size look at the original DC2 header. The 2 byte word at byte 19 is the width and the 2 byte word at byte 23 is the height. I also noticed the file size height and width at byte 36 and 38
For instance this Perl script would work for the DXT3
Code: Select all
while ($name = <*.dct>){
print "found a DCT file named $name\n";
open(INPUT, "< $name") or die "can't open $input file: $!\n";
binmode(INPUT);
$FileLength = (-s INPUT);
print "filelength = $FileLength\n";
read(INPUT,$c,$FileLength,0) or die "can't read $FileLength bytes.\n";
($Width,$Height)= unpack "Sx[S]S", substr $c, 36, 128;
print "width = $Width\n";
print "height = $Height\n";
$Size = ($Width * $Height);
print "size = $Size\n";
$DDSL1 = pack "SSSSSSSS", 17476, 8275, 124, 0, 4103, 10, $Height, 0;
$DDSL2 = pack "SSSSSSSS",$Width,0,0,4,0,0,0,0;
$DDSL345 = pack "LLLLLLLLLLLL", 0,0,0,0,0,0,0,0,0,0,0,0;
$DDSL6 = pack "LCCCCLL", 0,68,88,84,51,0,0;
$DDSL78 = pack "LLLLLLLL", 0,0,0,0,0,0,0,0;
seek INPUT, 48, SEEK_SET or die "can't seek Header length. \n";
read (INPUT,$b,$Size,0) or die "can't read File Size.\n";
$name =~ s/DCT/dds/;
print "name = $name\n";
open(DDSFILE, "> $name") or die "can't open DDSFILE: $!\n";
binmode(DDSFILE);
print(DDSFILE $DDSL1);
print(DDSFILE $DDSL2);
print(DDSFILE $DDSL345);
print(DDSFILE $DDSL6);
print(DDSFILE $DDSL78);
print(DDSFILE $b);
}
-
- advanced
- Posts: 47
- Joined: Sun Mar 07, 2004 6:37 am
- Location: USA
- Contact:
Mate is possible to compile this code ?
I have heard of Perl compilers but the code is smaller and easier to manipulate in script form. For instance to get this to work on DXT1 only requires text editing a couple values.
Perl is a free download, I used ActiveState Perl to test the script. It runs at the command prompt and requires no Perl knowledge to run the script.