Page 7 of 11

Posted: Thu May 05, 2005 6:11 pm
by brienj
There is an update on the CAS icons. If you have the patched version of the game, they are DXT1 1bit Alpha instead of DXT4. They are still 128x128, but the filesize is half the size, because of the format.
Mr.Mouse wrote:Brien, how did you come to the conclusion they are in DXT4 format? Am I missing something?
Every DDS file in every game for the Xbox has always been in DXT4 format, excepting of course, the ones that are DXT1 or DXT2. I guess it is possible that they are really DXT5, but I really doubt it. I've never seen a DXT5 texture file ever used in an Xbox game, and I believe it has something to do with programming on the Xbox. In fact, there are some games, that if you don't give the texture a DXT4 header, it will say the file is damaged. Also Tao Feng, the other game made by Studio Gigante, used DXT4 and DXT1 textures. I can't prove 100% that they are DXT4 textures, but it really doesn't matter, because if you replace them with DXT5 textures they will work just fine, unlike some other Xbox games. ;)

Posted: Thu May 05, 2005 7:18 pm
by Mr.Mouse
Okay...interesting. That part about the DXT1 I had figured out as well, for the icons. (And the .xbx files).

But how do you go about editing the images then? Is it feasible to load them in Photoshop, save them as DX5 and replace the header with a DXT4 header?

I tried to edit the icon__.res file in a CAS (I got that from themasterthree), but it didn't work for some reason (here's a link). Also, the .res/.k images don't actually have DDS headers, just the data. They do however have their own header, which resembles .xbx headers. Do you know the format of these .xbx headers?

Here's an example of one (the highlighted part):

Image

The res/k files have part of this header before the image data comes, in the above example this part:

Code: Select all

 0008 0000 0100 0400 0000 0000 0000 0000 290C 6106 0000 0000
What do these values mean? :think:

Posted: Fri May 06, 2005 3:59 am
by gameboy
Mr.Mouse wrote:Okay...interesting. That part about the DXT1 I had figured out as well, for the icons. (And the .xbx files).

But how do you go about editing the images then? Is it feasible to load them in Photoshop, save them as DX5 and replace the header with a DXT4 header?

I tried to edit the icon__.res file in a CAS (I got that from themasterthree), but it didn't work for some reason (here's a link). Also, the .res/.k images don't actually have DDS headers, just the data. They do however have their own header, which resembles .xbx headers. Do you know the format of these .xbx headers?

Here's an example of one (the highlighted part):

Image

The res/k files have part of this header before the image data comes, in the above example this part:

Code: Select all

 0008 0000 0100 0400 0000 0000 0000 0000 290C 6106 0000 0000
What do these values mean? :think:
You can extract the files with the xbx headers by renaming them to .xpr and extract them using xprextract, you might be able to add .xbx and use one of the many xbx tools. The ones without the header you could probably add the xbx/xpr header and extract it with xprextract.

Posted: Fri May 06, 2005 7:28 am
by Mr.Mouse
I can extract the files myself, that's not the issue.

My question is about the nature of the values in part of the the header that is equal to a part of the header of .xbx/.xpr files. :!:

Besides, as I said above the .k/.res files don't have a complete .xbx header, so what you're suggesting would not work anyway, I doubt xprextract would be so smart to guess half of the header itself.

Posted: Fri May 06, 2005 8:58 am
by gameboy
Mr.Mouse wrote:I can extract the files myself, that's not the issue.

My question is about the nature of the values in part of the the header that is equal to a part of the header of .xbx/.xpr files. :!:

Besides, as I said above the .k/.res files don't have a complete .xbx header, so what you're suggesting would not work anyway, I doubt xprextract would be so smart to guess half of the header itself.
No it will not guess half of the header but if i add the first half of the header it will extract the dds file. I just now read through all the pages so I understand now and here is xprextract with the source maybe it will help.

Posted: Fri May 06, 2005 2:07 pm
by Mr.Mouse
Thanks! Will certainly take a look at it. :)

Posted: Fri May 06, 2005 3:31 pm
by Mr.Mouse
Okay good, so :

.XBX header :

Code: Select all

[HEADER]
string		Magic Value (XPR0 XPR1 etc)
uint32		Image data size
uint32 		Headersize (total)
uint32		Image type (see below)
uint32		Unknown
uint32		Unknown
uint32		Texture format (dimensions etc)
uint32		Unknown

[IMAGE DATA]
Data

There are image types:

0x80000000	D3DCOMMON_TYPE_VERTEXBUFFER 
0x00040001	D3DCOMMON_TYPE_TEXTURE
0x00800001	D3DCOMMON_TYPE_INDEXBUFFER
Check out Goldbergs textures. And yes, it's DXT4.

Posted: Fri May 06, 2005 4:05 pm
by TheKidRocker
Great Job Mr Mouse!

But how do you do the conversion now, i'm not really experienced in this yet, so could u make a small guide when u have the time? :)

Keep up the good work! :wink:

Posted: Fri May 06, 2005 4:53 pm
by greendayduh
Not sure if any1 cares but the member XTC is telling people he is the one that worked out the Image compression/format headers.

Posted: Fri May 06, 2005 6:41 pm
by XTC!
greendayduh wrote:Not sure if any1 cares but the member XTC is telling people he is the one that worked out the Image compression/format headers.
no i aint am just saying that people can do it and i can show them

Posted: Fri May 06, 2005 7:18 pm
by Mr.Mouse
To all: look, this is not an Xbox forum, nor is it dedicated to Wrestlegames or whatever.

Please, we ask you nicely, don't drag us (XeNTaX) into your specific discussions and debate.

Many people could have figured out what was figured out here, look at Brienj, he also did. It's nothing special if you know what you are doing.

It's here that I explained how I extracted textures to themasterthree, for those who need to know how to extract textures:

viewtopic.php?p=8008#8008

As I said there, it's simple.

Now let's close this debate. We wish to keep this forum clean. If it looks like a discussion on another forum spills over to this one, Captain and I will have to start modding the forum, which we usually never have to.

So, keep it clean, folks. :)

Posted: Sat May 07, 2005 9:32 am
by greendayduh
Sorry just wanted to inform if any1 cared. But real nice work, I still don't understand how to open the files :P. But I'm interested where this goes.

Posted: Sat May 07, 2005 10:09 am
by Mr.Mouse
TheKidRocker wrote:Great Job Mr Mouse!

But how do you do the conversion now, i'm not really experienced in this yet, so could u make a small guide when u have the time? :)

Keep up the good work! :wink:
I did it as Gameboy suggested, by creating a full XPR0 header and renaming the file to .XPR. Then XPREXTRACT did all the work. I have browsed through the source code of that program, and could easily identify what each value represents.

Posted: Sat May 07, 2005 3:39 pm
by brienj
I have a new video:

Lita Video

So I'm slowly getting the details of the .k files worked out, and when I am finished, I can share it with Mr. Mouse, although it looks like he may have already figured it out with the xprextract source code. My only problem is getting the model files out, I can only get the textures. Once that is done, CAS will be busted WIDE open. BTW, I am 99% sure the models are .x files, my problem is supplying a good header to them and finding an application that will handle multiple meshes. ;)

Posted: Sat May 07, 2005 5:26 pm
by TheKidRocker
Mr.Mouse wrote:I did it as Gameboy suggested, by creating a full XPR0 header and renaming the file to .XPR. Then XPREXTRACT did all the work. I have browsed through the source code of that program, and could easily identify what each value represents.
Okay let me show you my try :)

I took this file and opened in Hex WorkshopCivic Center Color.res

Here is what it showed:
Image

Then I checked an XPR File and changed the Header to this:
Image

Now I uses xprextract and got 2 files out of it, one that is totally blank and the other looks like that:
Image

Did i do anything wrong? :?