Page 8 of 11

Posted: Sat May 07, 2005 7:17 pm
by brienj
Yeah, you don't have to give .res files a XPR header, just a DDS file header, but it must be the right size and type. ;)

Posted: Sat May 07, 2005 8:08 pm
by TheKidRocker
brienj wrote:Yeah, you don't have to give .res files a XPR header, just a DDS file header, but it must be the right size and type. ;)
Yeah i tried this before aswell and got other quite similar results
What do you mean by size? And the type you mean is probably DXT1 & DXT4, etc.
How do i find out? trial and error i guess :)

Could u please give an example for the file I uploaded?

Thanks for ur help :)

Posted: Sat May 07, 2005 8:41 pm
by brienj
First, remove the first 20 bytes, so it is 40000h bytes long, and this is the size of a 512x512 DXT4 dds file, but since you can't save as a DXT4 in Photoshop anyway, just give it a DXT5 header, which is:

Code: Select all

4444 5320 7C00 0000 0710 0800 0002 0000
0002 0000 0000 0400 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 0000 0000
0000 0000 0000 0000 0000 0000 2000 0000
0400 0000 4458 5435 0002 0000 0000 0000
0000 0000 0000 0000 0000 0000 0010 0000
0000 0000 4444 5358 FFFF FFFF FFFF FFFF
Then save it as a .dds file, and open it up in Photoshop and edit it if you like, then save it as a DXT5 w/no mipmaps, remove the 80h byte dds header, replace the header you removed in the first step, and then it will work in the game.

This is what the image looks like when converted to a DXT5 file correctly:
Image

Posted: Sat May 07, 2005 10:03 pm
by TheKidRocker
Okay, i got a step further now :roll:
I deleted the first 20 bytes of the file and put ur code for the DXT5 Header in and what i got is this:
Image
:oops:

You sure that paintshop can open it correctly with the DXT5 header when its a DXT4 File?

Posted: Sat May 07, 2005 10:26 pm
by Mr.Mouse
Well, you can still try the other method, and let xprextract do it for you. What you forgot (or I think did not know) is that you have to have the correct size of the image data in the XPR header.

So in your original you left the value 4096 there (0010 0000, see the highlighted part):
Image

But your image data is larger: 262144 ! (or 0x40000 in hexadecimals).

So replacing the 0010 0000 with 0000 0400 will work.

This learns that the file is not DXT4, or DXT5, but DXT1.
It's 1024*512.

Image

Here are the xbx and DDS files.

Posted: Sat May 07, 2005 10:28 pm
by STG
He said photoshop didn't he? Not sure if there would be any difference between Photoshop and Paintshop pro but maybe.

Posted: Sat May 07, 2005 10:45 pm
by cfcrule
[quote]First, remove the first 20 bytes[/quote]


I know i sound like a noob but how much of it is 20 bytes is 4 numbers the byte. Sorry

Posted: Sat May 07, 2005 10:55 pm
by TheKidRocker
cfcrule wrote:
First, remove the first 20 bytes

I know i sound like a noob but how much of it is 20 bytes is 4 numbers the byte. Sorry
Every 2 Characters are 1 byte


Thanks for Mr Mouse for trying to help!
Your example files work fine for me.

But still couldnt do it myself, i changed the 0010 0000 to 0000 0400 and still get the same result as my first, but i noticed that the rest of your code there looks different too :oops:

Posted: Sat May 07, 2005 10:57 pm
by cfcrule
Thanks TheKidRocker.

Posted: Sat May 07, 2005 10:59 pm
by Mr.Mouse
TheKidRocker wrote:
cfcrule wrote:
First, remove the first 20 bytes

I know i sound like a noob but how much of it is 20 bytes is 4 numbers the byte. Sorry
Every 2 Characters are 1 byte


Thanks for Mr Mouse for trying to help!
Your example files work fine for me.

But still couldnt do it myself, i changed the 0010 0000 to 0000 0400 and still get the same result as my first, but i noticed that the rest of your code there looks different too :oops:
Ah I see you have actually TWICE the header info in there.
Notice how the 0100 0400 comes twice. I guess you inserted it instead of replacing the old?

Posted: Sat May 07, 2005 11:00 pm
by Mr.Mouse
Okay, here's what I got so far for the .k files, educated guesses:

Code: Select all

[K header]
string		Magic Value ('MF10')
uint32		Size of XBXX part 
string		Magic Value ('XBXX')
uint32		Unknown 
uint32		K file type (have seen 0 and 1)
ubyte		Unknown
uint32		type 0 k file: Offset of model/mesh data
		type 1 k file: number of files (excluding the model at the back)
uint32		type 0 k file: number of files (excluding the model at the back)
		type 1 k file: size of filename string (first entry already starts)

[FILE ENTRY]
uint32		Size of filename string
string		Filename (Original), null-terminated
uint32		Size of file (including header and image data in case of textures)
data		File data

In case of textures:

[TEXTURE]
uint32		Unknown 
uint32		Part of DDS file header (starting from 0x00040001 D3DCOMMON_TYPE_TEXTURE)
data		DDS image data

[At offset of model/mesh data]
uint32		Size of model file
data		Model file

[End-0x4d]
At the end of a k file that includes these model files is a tail.
0x4d in length, it probably also containing some Mesh vars. 

Posted: Sat May 07, 2005 11:03 pm
by TheKidRocker
Hey! Thats it! :)
Thanks a lot! ;)
Must have messed something up ;)
The double header explains why i always got two files out of it with one being empty ;)

Now i have the same result you got!
Thanks so much! :D

But are you sure about the 1024*512 ?
I think the images dont look right like that :oops:
Image

Posted: Sun May 08, 2005 12:14 pm
by Mr.Mouse
Well, that one image of the Hall looks okay, nice perspective. It doesn't mean ALL have those dimensions. This is what xprextract made of it, and I think the program knows what to do. :)

Posted: Tue May 10, 2005 1:46 pm
by themasterthree
So what I do is insert dds headers into the wm21 files and this makes it so I can view the images in Photoshop. Only thing I wanted 2 know was what header did you use for that .k goldberg? Also maybe brienj can answer this question does anyone know where the wm21 attires are located? Im guessing in the .k files but from that goldberg shot MM posted it seems its only the heads. Well if you would be kind of enough 2 help me with this 1 last thing.

Posted: Tue May 10, 2005 2:22 pm
by TheKidRocker
themasterthree wrote:So what I do is insert dds headers into the wm21 files and this makes it so I can view the images in Photoshop. Only thing I wanted 2 know was what header did you use for that .k goldberg? Also maybe brienj can answer this question does anyone know where the wm21 attires are located? Im guessing in the .k files but from that goldberg shot MM posted it seems its only the heads. Well if you would be kind of enough 2 help me with this 1 last thing.
As far as i understood things, the textures for the wrestlers and packed into the .k files so you have to extract them out there first :wink: