FileForums

FileForums (https://fileforums.com/index.php)
-   Conversion Tutorials (https://fileforums.com/forumdisplay.php?f=55)
-   -   XTool 2020 (Main Project) (https://fileforums.com/showthread.php?t=102832)

doofoo24 20-01-2020 11:37

1 Attachment(s)
:cool:

traxgaming 10-05-2020 01:05

What is Precomp ?
 
What is Precomp the Files ?
What is the advantage of it ?
How to use it?
What are the methods use it ?

Razor12911 06-08-2020 18:51

Finally an update after a year (08/2019 - 08/2020).

Project is restarted and I hope all goes well this time.

Xtool will be getting frequent updates from now onward since the base code is solid and can allow for new features to be added.

If you have been participating in the [Dev]Xtool thread, thanks a lot. I have managed to fix a lot of bugs and came to a conclusion. Use reflate at your own risk, an alternative has been added which is preflate but this cannot process all streams so choose wisely.

Changes from the Dev Xtool

Added stats monitoring (not visible when using xtool with FA via stdio mode)
Added depth setting (finding streams within streams)
Fixed low memory mode
Speed improvements (when dealing with files with a lot of streams)

Plans for next update
Add stream deduplication

dixen 07-08-2020 02:42

Dishonored. Death of the Outsider

Unpack

Quote:

Tested 3 files, 13,824,493,421 => 9,663,676,416 bytes. Ratio 143.06%
Testing time: cpu 8.91 sec/real 239.61 sec = 4%. Speed 40.33 mB/s
All OK

panker1992 09-08-2020 15:30

From My POV,

Precompression is give/take antibalanced situation.

Where i see it if you want a game decompressed 100% go ahead and decompress manually all then pack them,
and waste time and space when unpacking to do the same function reversed.

If we can get 98% os the files inputed decompressed we can go ahead and call it a day :D

2% is withing the margin of error :D

Razor12911 09-08-2020 20:53

1 Attachment(s)
I was supposed to post an update on the project 2 days ago but then I was greeted by this cloudflare error each time I tried to open the site.

Attachment 27668

So I just thought the site was down little did I know that either my ISP or the forum blocked my IP address because I used VPN and the site opened.

Perhaps I spend too much time on the forum :D

Grumpy 10-08-2020 04:41

@Razor12911

I quite often get that error when updating the Conversion Index, I just figure it takes to long to update so much text each time ... when I do encounter the error I just open the Index in another window and I find it has updated. ;)

Masquerade 13-08-2020 07:24

Hello, following guidance from the GFS thread, I tried the zlib+preflate method for the dynamic streams located in Automobilista 2, however the files haven't been precompressed. Here is the result:

Code:

Compressed 1,438 files, 27,663,572,443 => 27,663,586,865 bytes. Ratio 100.00%
Compression time: cpu 27.78 sec/real 728.72 sec = 4%. Speed 37.96 mB/s
All OK

This makes me think that this method is not correct for this game.

XTool is doing SOMETHING though, since there is CPU and RAM usage, just as if it was processing normal zlib streams.

Any thoughts? I can upload some of the files if anyone is interested.

shazzla 13-08-2020 07:57

I dont have this game,but are you sure its zlib?! (Ok,gfs.....)
Could it be Oodle?! I dont know,yust a question!

Masquerade 13-08-2020 09:59

Quote:

Originally Posted by shazzla (Post 487399)
I dont have this game,but are you sure its zlib?! (Ok,gfs.....)
Could it be Oodle?! I dont know,yust a question!

There are oodle libs in game folder, but this game is definitely zlib (as shown in GFS, with dynamic stream detection enabled). Oodle scan detects nothing.

KaktoR 13-08-2020 10:35

Maybe files are crypted?

shazzla 13-08-2020 10:35

If there r oodle libs then those streams r oodle streams imho.
Doesnt matter what scanners says its zlib.
Try with different oodle libs.
Again : imho. But maybe im very wrong...

@Kaktor : +1

Masquerade 13-08-2020 11:35

Oh dear
 
Quote:

Originally Posted by KaktoR (Post 487403)
Maybe files are crypted?

The files are definitely encrypted. Sorry for the problems... :(

500mb sample ---> 450mb when 7z compressed.

Razor12911 13-08-2020 16:40

Next update will have two new features, database and stream deduplication and here are some benchmarks as to what these features can do.

Input is Need for Speed Hot Pursuit\SEACREST

pzlib v2
Compressed 225 files, 3,253,110,016 => 859,932,872 bytes. Ratio 26.43%
Compression time: cpu 5.73 sec/real 300.50 sec = 2%. Speed 10.83 mB/s

pzlib v3
fails, no idea why :o

xtool2018 (v012)
Compressed 225 files, 3,253,110,016 => 722,889,785 bytes. Ratio 22.22%
Compression time: cpu 5.06 sec/real 188.09 sec = 3%. Speed 17.30 mB/s

xtool2019 (1908_R6)
Compressed 225 files, 3,253,110,016 => 722,934,572 bytes. Ratio 22.22%
Compression time: cpu 4.89 sec/real 189.14 sec = 3%. Speed 17.20 mB/s

xtool2020
Compressed 225 files, 3,253,110,016 => 722,927,890 bytes. Ratio 22.22%
Compression time: cpu 4.86 sec/real 165.26 sec = 3%. Speed 19.68 mB/s

xtool2020 with deduplication
Compressed 225 files, 3,253,110,016 => 719,194,176 bytes. Ratio 22.11%
Compression time: cpu 4.08 sec/real 154.45 sec = 3%. Speed 21.06 mB/s

xtool2020 with deduplication + memory database
Compressed 225 files, 3,253,110,016 => 719,195,766 bytes. Ratio 22.11%
Compression time: cpu 4.20 sec/real 75.00 sec = 6%. Speed 43.38 mB/s

xtool2020 with deduplication + imported database
Compressed 225 files, 3,253,110,016 => 719,194,905 bytes. Ratio 22.11%
Compression time: cpu 4.50 sec/real 61.77 sec = 7%. Speed 52.66 mB/s

precomp :(
Compressed 225 files, 3,253,110,016 => 754,538,183 bytes. Ratio 23.19%
Compression time: cpu 6.69 sec/real 547.05 sec = 1%. Speed 5.95 mB/s

In precomp's defence, it uses disk instead of memory to work and stream type was never narrowed to only focus on deflate streams.

All tests ran using 4 threads with 32mb chunk size

NOTE: This input has repeated streams, some games have similar characteristics therefore xtool stores a database in memory to remember the configuration and then removes these repeated streams to give more speed.
It's free speed, there is no penalty in performance if you use the new options at all times however, some tests need to be run due to the possibility of collisions in the dictionary used...

This project has come a long way :)

FitGirl 14-08-2020 08:31

Cool update, waiting impatiently :)
Any predictions on RAM requirements for both imported/memory DBs? I suspect it depends on number of duplicated streams, but it would be good beforehand to know what additional RAM will be required upon recompression. Maybe it's possible for xtool to report it after initial decompression is done?

Razor12911 15-08-2020 15:26

Quote:

Originally Posted by FitGirl (Post 487415)
I suspect it depends on number of duplicated streams

you answered yourself :)

but as I said, I have a few ideas to reduce the memory requirements like getting rid of streams from memory that have restored the duplicated streams. I am not sure if srep does this already but if it doesn't then it should be a bonus. GPU memory usage is another thing that will be added but in future. I need start adding support for other codecs, especially the external ones. What I plan is for people to write their own plugins regardless whether they can write code or not. If you can figure out a header structure of a game, just write and ini file and give it to xtool and it will do the rest. This is mostly for lz4 games, encrypted ones or ones that require something special. I actually wanted xtool to be able to import stuff from quickbms because it already has a huge library of scripts for games. (too much work though)

Here's an example of Saints Row IV Remastered, instead of making another side project, you just write this and give it to xtool.

Code:

[stream1]
Codec=lz4hc:l10 // lz4hc compression used, level 10
Header=00BADBEE0FEEDBEE // this is the magic bytes
Structure={Header(8)} {CSize(4)} {DSize(4)} {Stream} // this is the header structure
Condition1=DSize > CSize // the conditions for xtool to accept the stream
Condition2=CSize > 64
Condition3=CSize < 16 x 1024 x 1024

Quote:

Maybe it's possible for xtool to report it after initial decompression is done?
this I can do


@everyone

here are some benchmarks, I finally written the decompression code, though it needs some tweaking before I can post update

normal xtool
Code:

Compressed 1 file, 320,782,304 => 108,018,914 bytes. Ratio 33.67%
Compression time: cpu 0.47 sec/real 22.64 sec = 2%. Speed 14.17 mB/s

Tested 1 file, 108,018,914 => 320,782,304 bytes. Ratio 33.67%
Testing time: cpu 0.38 sec/real 14.91 sec = 3%. Speed 21.51 mB/s

+ memory database
+ deduplication
Code:

Compressed 1 file, 320,782,304 => 107,858,828 bytes. Ratio 33.62%
Compression time: cpu 0.44 sec/real 15.98 sec = 3%. Speed 20.08 mB/s

Tested 1 file, 107,858,828 => 320,782,304 bytes. Ratio 33.62%
Testing time: cpu 0.44 sec/real 9.32 sec = 5%. Speed 34.41 mB/s

thus far, the output is slightly better for more speed :)

FitGirl 15-08-2020 18:06

Configuration feature is great! It would be so much easier to repack some obscure formats.

dixen 16-08-2020 02:04

Quote:

Originally Posted by Razor12911 (Post 487431)
I actually wanted xtool to be able to import stuff from quickbms because it already has a huge library of scripts for games. (too much work though)

For LEGO series games this would be fine)

FitGirl 16-08-2020 13:03

Quote:

Originally Posted by dixen (Post 487435)
For LEGO series games this would be fine)

It will never work with LEGO series, cause there are no public compressors for algos used in those games, and the decompressors used by Luigi are in binary (ripped from DLL) format, so they can only be extracted, not packed back.

Razor12911 16-08-2020 16:05

Quote:

Originally Posted by FitGirl (Post 487415)
Any predictions on RAM requirements for both imported/memory DBs?

back on the SEACREST input from Need For Speed Hot Pursuit

I ran a memory usage test as you asked and these were the results.

xtool-virtual-memory.tmp = 328 MB
Decompression memory is 22 mb. 80,927 matches = 1,294,832 bytes = 0.10% of file

= total 350 MB (with deduplication)

Decompression memory is 1485 mb. 147,537 matches = 2,360,592 bytes = 0.18% of file

= total 1485 MB (without deduplication)

NOTE: Xtool uses memory of its own and this was not factored, about 190 MB
so if you do the math, that's 350+190 = about 540 MB total memory while if xtool doesn't remove deduplicates and lets srep all the work that's 1485+190 = 1675 MB

540 MB vs 1675 MB memory usage, which is better?

when 540 MB ram was used, xtool was decoding at 88.91 MB/s
and when 1675 MB ram was used, xtool decoded at 27.45 MB/s

so yes more speed and less memory usage, potato pcs should benefit greatly from this (like mine :o)

Masquerade 17-08-2020 01:43

Quote:

Originally Posted by Razor12911 (Post 487457)
xtool-virtual-memory.tmp = 328 MB
Decompression memory is 22 mb. 80,927 matches = 1,294,832 bytes = 0.10% of file

= total 350 MB (with deduplication)

I know you don't have much data to go on, but how does xtool+dedup compare against xtool+srep?

FitGirl 17-08-2020 04:51

Quote:

Originally Posted by Masquerade (Post 487465)
I know you don't have much data to go on, but how does xtool+dedup compare against xtool+srep?

The idea of new xtool is not replace srep. It's purpose is not to recompress duplicate chunks, but just copy them, which makes less CPU load and faster overall decompression. You still need to run srep after xtool, cause it will deal with unpacked duplicated chunks.

Masquerade 20-08-2020 02:12

Hello, here is more data:

Both Scribblenauts games, +comic book (pdf format):

Original size: 1.84GB

https://i.imgur.com/jKD7fvx.png

So, the xtool 2020 is running with zlib+preflate method, maybe I should have disabled it so it's zlib vs zlib.

FitGirl 20-08-2020 04:20

Quote:

Originally Posted by Masquerade (Post 487498)
Hello, here is more data:

Both Scribblenauts games, +comic book (pdf format):

Original size: 1.84GB

https://i.imgur.com/jKD7fvx.png

So, the xtool 2020 is running with zlib+preflate method, maybe I should have disabled it so it's zlib vs zlib.

Afair Scribblenauts is encrypted. You are lucky to always choose encrypted games for your tests ;)

Harsh ojha 20-08-2020 05:14

Quote:

Originally Posted by Razor12911 (Post 487457)
so yes more speed and less memory usage, potato pcs should benefit greatly from this (like mine :o)

Same here potato pc 😅

FitGirl Repack take more HHD space for installing game ex. Far Cry 3 duology
Need 17 GB HHD space free
But the game Size was 10 GB ( language english.
Without FC3 mapEditor )

*Sorry for my bad English as English is not my mother tongue 😅*

Masquerade 20-08-2020 13:36

Quote:

Originally Posted by FitGirl (Post 487500)
You are lucky to always choose encrypted games for your tests ;)

Sucks to be me I guess. I don't knowingly do this. :o

Razor12911 21-08-2020 15:01

Quote:

Originally Posted by Masquerade (Post 487498)
Hello, here is more data:

Both Scribblenauts games, +comic book (pdf format):

Original size: 1.84GB

https://i.imgur.com/jKD7fvx.png

So, the xtool 2020 is running with zlib+preflate method, maybe I should have disabled it so it's zlib vs zlib.

hmm, final size after compression?

Masquerade 21-08-2020 15:12

Quote:

Originally Posted by Razor12911 (Post 487523)
hmm, final size after compression?

With xtool r12: 1.38GB

I feel slightly ashamed for not thinking the data could be encrypted.

Didn't test to make a full archive with 2020, I will do this if you wish.

Every time I put xtool 2020 up against xtool r12, r12 always produces a larger size. Both run at 128m chunk size.

Razor12911 21-08-2020 16:08

and the final size of 2020?

shazzla 21-08-2020 22:38

@Razor12911 :

Few days ago i started playing with XTool 2008. Great job ! Thanks !
But i found this :

Frostpunk - On the edge (Is its streams ZLIB? It must be IMHO)

It cant precompress those .dat files. (For example ,common.dat and languages.dat were tested).
Common.dat nearly a 600 MB file,languages.dat is a much smaller.
In both case ,the output is the same.
Older generation of XTool (AFAIR V0.9) precompresses commond.dat well to ~1.5 GB, languages.dat ,too.
XTOOLs (older) setting was : 128mb
XTOOLs (2008) setting was : 128mb ,d0 and d9 ,after this 256mb. (doesnt matter)

In my other test i faced with this (dont remember what game,maybe Hellbound):
XTool 2008 inflation was 2 gigs AFAIR ,compressed with LOLZ ,after that compressed the game without XTOOL2008 and the same LOLZ parameters and it was smaller with some MBs ! (maybe a special case ,dont know)

ATM im away from my computer for the next...lot of days ,i cant send example files.

Keep up the good work !

humorlesslumber 22-08-2020 01:35

Good but can we somehow compress modded android games like dragon city?

Razor12911 24-08-2020 00:59

Quote:

Originally Posted by shazzla (Post 487529)
@Razor12911 :

Few days ago i started playing with XTool 2008. Great job ! Thanks !
But i found this :

Frostpunk - On the edge (Is its streams ZLIB? It must be IMHO)

It cant precompress those .dat files. (For example ,common.dat and languages.dat were tested).
Common.dat nearly a 600 MB file,languages.dat is a much smaller.
In both case ,the output is the same.
Older generation of XTool (AFAIR V0.9) precompresses commond.dat well to ~1.5 GB, languages.dat ,too.
XTOOLs (older) setting was : 128mb
XTOOLs (2008) setting was : 128mb ,d0 and d9 ,after this 256mb. (doesnt matter)

In my other test i faced with this (dont remember what game,maybe Hellbound):
XTool 2008 inflation was 2 gigs AFAIR ,compressed with LOLZ ,after that compressed the game without XTOOL2008 and the same LOLZ parameters and it was smaller with some MBs ! (maybe a special case ,dont know)

ATM im away from my computer for the next...lot of days ,i cant send example files.

Keep up the good work !

will be waiting for the sample :)

shazzla 24-08-2020 02:41

On it.. maybe 10 hrs from now... maybe.

FitGirl 24-08-2020 07:13

Quote:

Originally Posted by Razor12911 (Post 487548)
will be waiting for the sample :)

Check Discord for Halo sample ;)

shazzla 24-08-2020 11:21

Quote:

Originally Posted by Razor12911 (Post 487548)
will be waiting for the sample :)

As i promised :

https://mega.nz/file/11RUTKIb#SCuzYA...LWlLeP5mgiu6EM

Razor12911 25-08-2020 18:51

@FitGirl
using

-mzlib+reflate
Code:

Tested 1 file, 92,646,762 => 48,529,408 bytes. Ratio 190.91%
Testing time: cpu 0.06 sec/real 2.62 sec = 2%. Speed 18.56 mB/s

-mzlib+preflate
Code:

Tested 1 file, 90,385,191 => 48,529,408 bytes. Ratio 186.25%
Testing time: cpu 0.08 sec/real 3.60 sec = 2%. Speed 13.46 mB/s

@shazzla

using

-mzlib+reflate
Code:

"localizations.dat". File is broken.
Tested 1 file, 67,329,029 => 9,663,657 bytes. Ratio 696.72%
Testing time: cpu 0.00 sec/real 1.10 sec = 0%. Speed 8.75 mB/s

-mzlib+preflate
Code:

Tested 1 file, 9,663,731 => 9,663,657 bytes. Ratio 100.00%
Testing time: cpu 0.02 sec/real 0.59 sec = 3%. Speed 16.34 mB/s

I remember mentioning somewhere that you sometimes need to include reflate/preflate along with zlib because this is no longer automated like in previous iterations.

in the sample FitGirl provided reflate gave better output, not sure if it's because of bigger hifs but this is why preflate doesn't replace reflate and why both are used, you just need to pick one to work with if the default zlib method doesn't process streams by itself.

that said, reflate no longer gets updates so at times, it breaks crc of files like in thr sample provided by shazzla so this means you need to use preflate.

I hope this clears up a few things about the program's usage.

Tests were performed using xtool_2008_R1 (the current version),

arc.ini
Code:

[External compressor:xtool]
header    = 0
packcmd  = xtool.exe precomp -mzlib+preflate -c32mb -t100p-1 -d0 - - <stdin> <stdout>
unpackcmd = xtool.exe decode -t100p-1 - - <stdin> <stdout>

Edit:

the next version of xtool will have reflate automatically verify the streams it processes to avoid checksum errors and if it fails but preflate was enabled, it will jump to preflate. may take longer to process but I guess there is no other alternative at this point.

Razor12911 26-08-2020 17:45

Update available

Changes

- fixed command line parser
- updated deflate scanner
- added stream deduplication
- added stream database
- added decompression memory limiter
- added grittibanzli (also handles deflate stream but slow af)

Notes

stream deduplication doesn't allow you to set max decompression memory so it uses VM file, this will be in future versions.
stream deduplication also produces a file that is required for decompression, this file must always exist else xtool will always fail restoring the data

Code:

[External compressor:xtool]
header    = 0
packcmd  = xtool.exe precomp -mzlib+preflate -c32mb -t100p-1 --dbase --dedup=xtool.bin - - <stdin> <stdout>
unpackcmd = xtool.exe decode -t100p-1 --dedup=xtool.bin - - <stdin> <stdout>

xtool.bin must be put along with the installation (setup.exe) and extracted to temp like you would with xtool.exe and other decompression exe/dll/cls files

if you have multiple archives, the same xtool.bin file can be used. meaning if you used xtool in data1.bin and data2.bin, xtool.bin can be used for both, the program itself will decide which section of the xtool.bin belongs to which archive. This is better than having xtool1.bin and xtool2.bin for each archive ;)

nicholas2006 27-08-2020 21:50

Thanks for the awesome tool.

It works wonderfully in 99% cases but I recently came across with a game called UnderMine and xtool seems to not do anything..
GFS shows zlib 135 MB > 226 MB and I'm using the following method: -mzlib+preflate -c128mb -t2

Any guidance would be greatly appreciated.

*edit: I used different keywords to search and found my answer in a different thread (issue being it was dynamic stream). But any other input may be helpful!

Snapppr6 28-08-2020 08:32

????
 
hi razor12911
in any data type we can use xtool 2008 and 1908

Masquerade 28-08-2020 11:51

Thank you for the dedup mode, it is working well.

Mad Max = 43kb deduplication file made

I expect that with more duplicated streams, the file size of course will increase - is there a limit on how large the file could reach? or could it reach astronomical sizes (20+mb), in which case, packaging it inside a setup would appear irregular.


All times are GMT -7. The time now is 18:48.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com