ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Sun Jan 20, 2019 8:08 pm

All times are UTC




Post new topic  Reply to topic  [ 15 posts ] 
Author Message
PostPosted: Fri Jan 11, 2019 5:03 am 

Joined: Fri Mar 30, 2018 2:48 am
Posts: 24
In The Skate games there are file packages called XSF files with 3D models, Collision data and Textures used for asset streaming.
If you have a minute to look at the format and see if there is anything you can do to get the files out of there intact, I would be very grateful :)

Here is a couple samples: https://mega.nz/#!K0gEjQzQ!DjvdfpVugiwJ ... yT-LqkMJXM

Many Thanks,
/GHFear


Top
   
PostPosted: Fri Jan 11, 2019 11:01 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 9654
http://aluigi.org/bms/skate3_xsf.bms


Top
   
PostPosted: Sat Jan 12, 2019 5:35 pm 

Joined: Fri Mar 30, 2018 2:48 am
Posts: 24
aluigi wrote:
http://aluigi.org/bms/skate3_xsf.bms


Thank you aluigi, you have no idea how much it means. =] Getting the level textures for this game is getting so close right now thanks to you!
The files seem to start a bit before they should and end a bit before they should tho. The header says the texture data should be 30 000 long and they are only about 26 000 - 29 000.
If you need more samples to look at, I can provide that?

Edit: It seem like the files are split up in the archives... It looks to me like the rest of the texture files are inside the cPres files haha.
Maybe that line at the end of each file is a reference to the other files?

Edit 2: So the files all have their own header with their own size... and the header says the data will be one length, yet the files are always WAY shorter and doesn't look like the normal rx2/ renderware4 files with the exact same headers. hmm...
Since the data looks so different, maybe it's compressed or something?

/GHFear


Top
   
PostPosted: Sun Jan 13, 2019 2:13 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 9654
Regarding the beginning and ending point I'm sure that it's all correct because the 0x80 bytes before the file are the header which is just 0x14 bytes plus all zeroes.
Coverage is 99% so it's all correct.

The extracted files have a 0x50 bytes header followed by 0x89 "RW4xb2" that seems to be a known texture format if you search it on Google.
I don't think there is any compression because there are various 32bit fields visible in these files, if they were compressed they would be a mess and in any case there is no decompressed size as far as I can see.


Top
   
PostPosted: Sun Jan 13, 2019 4:16 pm 

Joined: Fri Mar 30, 2018 2:48 am
Posts: 24
aluigi wrote:
Regarding the beginning and ending point I'm sure that it's all correct because the 0x80 bytes before the file are the header which is just 0x14 bytes plus all zeroes.
Coverage is 99% so it's all correct.

The extracted files have a 0x50 bytes header followed by 0x89 "RW4xb2" that seems to be a known texture format if you search it on Google.
I don't think there is any compression because there are various 32bit fields visible in these files, if they were compressed they would be a mess and in any case there is no decompressed size as far as I can see.


Yeah it's strange. I recently made a universal RW4xb2 texture exporter that works with a ton of EA games, but these files even tho the header looks 100% the same as the other files, it comes out as complete clutter with no visible patterns or colors at all. I can't even think of what it could be doing it. Looking at the files your script produces and looking at the same data inside the package, it ends where it should. So thanks a ton for making the process to get these textures WAY easier. I will work on the textures from here and see if I can find where the rest of the file (probably the mipmaps) are, how to combine them and such.

Thanks for everything aluigi :)
/GHFear


Top
   
PostPosted: Mon Jan 14, 2019 1:47 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 9654
Script 0.2 :D


Top
   
PostPosted: Mon Jan 14, 2019 2:05 pm 

Joined: Fri Mar 30, 2018 2:48 am
Posts: 24
aluigi wrote:
Script 0.2 :D


Haha omg, now it only gives me headers and nothing else xD
But now they start where the texture starts at least. :D So that's awesome!


Top
   
PostPosted: Mon Jan 14, 2019 2:58 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 9654
It worked with cSim* but yes you are right.
Script 0.3, please note that the names of the output files differ than those of the previous scripts (in case you want to use it with the previous output folder)


Top
   
PostPosted: Mon Jan 14, 2019 3:25 pm 

Joined: Fri Mar 30, 2018 2:48 am
Posts: 24
aluigi wrote:
It worked with cSim* but yes you are right.
Script 0.3, please note that the names of the output files differ than those of the previous scripts (in case you want to use it with the previous output folder)


Holy shit dude! It fuckin works! :D I love you dude. The textures show up just fine.
Make it name them rx2 instead of rw4 tho. :] I already changed that on my end, but for people who download it in the future it would be easier since that's what the xbox extension is for it. This is great. I almost have a rx2 -> OBJ script made now too. ^^ Finally this game can have it's 3D models and Textures preserved.

Thank you.


Top
   
PostPosted: Mon Jan 14, 2019 5:44 pm 

Joined: Fri Mar 30, 2018 2:48 am
Posts: 24
btw aluigi, What compression does the file data have?


Top
   
PostPosted: Mon Jan 14, 2019 6:03 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 9654
RefPack algorithm (in quickbms it's used as dk2 or ea).
It's easy to recognize because the first 2 bytes are 0x10 0xfb.


Top
   
PostPosted: Tue Jan 15, 2019 4:35 am 

Joined: Fri Mar 30, 2018 2:48 am
Posts: 24
aluigi wrote:
RefPack algorithm (in quickbms it's used as dk2 or ea).
It's easy to recognize because the first 2 bytes are 0x10 0xfb.


So after google'ing around for the last couple hours I can't find a tool that can compress with that algorithm. Do you know if there is such a tool publicly available?
Since I believe I need to compress the data again if I wanted to reimport the files =]

OK, so I found this on here posted by you:
Code:
comtype dk2_compress
get SIZE asize
clog "new_file" 0 SIZE SIZE


I tried it and the file is ALMOST identical, there are some differences and the file is a bit longer, would there be another way to do it that could produce the same compression?

Edit: I made this compression script for those that would like to play around with it and find ways to make it work. File is attached.

/GHFear


Attachments:
File comment: rx2, dk2/ RefPack algorithm file compressor script
skate3_rx2_dk2_compressor.zip [365 Bytes]
Downloaded 2 times
Top
   
PostPosted: Tue Jan 15, 2019 8:22 am 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 9654
For compression I use qfs_compress_data from src\included\qfs.c:
Code:
// New generation FSH/QFS decompressor/compressor
// Version 1.22 - copyright (c) Denis Auroux 1998-2002
// auroux@math.polytechnique.fr


Top
   
PostPosted: Tue Jan 15, 2019 8:59 am 

Joined: Fri Mar 30, 2018 2:48 am
Posts: 24
aluigi wrote:
For compression I use qfs_compress_data from src\included\qfs.c:
Code:
// New generation FSH/QFS decompressor/compressor
// Version 1.22 - copyright (c) Denis Auroux 1998-2002
// auroux@math.polytechnique.fr


Aah that may explain why it's slightly different. The first 20% is 100% the same but then it starts looking a bit different, which is very odd.
I have the Xbox 360 SDK and there is source for the Texture bundler, compressor and UnBundler and such in there, so I will look at that an see if it's something I can use to compress them with the absolute same format. There was also some Skate 3 source released that could be of help.

Edit:Maybe changing the QFS_MAXITER value could help this situation out? is that something I can do on my end?

Edit 2: If anyone knows how to reach the QFS_MAXITER parameter and change the value to test to see if you can make the files look identical or smaller in files size, I have the Decompressed file, the file with original compression and the file compressed and built with QuickBMS as samples.
I also attached the script I made for compressing Skate 2 and 3 rx2 files so you can use it for testing the changed levels of compression.

Thanks.


Attachments:
File comment: Decompressed, Original Compression and QuickBMS Compression Test Files.
Skate 3 dk2 Test.zip [422.52 KiB]
Downloaded 1 time
Top
   
PostPosted: Tue Jan 15, 2019 4:29 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 9654
MAXITER has been already edited because the original value gave ever worst results.
I guess it's just the implementation of that compression function that sucks.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 15 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited