READ THE RULES: Click here

Follow us on Facebook: https://www.facebook.com/xentax/ :)

Tales of Vesperia / Graces TLZC compression

Read or post about compression. And decompression. Or ask questions how to decompress your files.
Post Reply
oathkeeper9918
beginner
Posts: 24
Joined: Sat Jul 09, 2011 9:16 pm
Has thanked: 1 time

Tales of Vesperia / Graces TLZC compression

Post by oathkeeper9918 » Sun Apr 08, 2012 9:10 pm

so some guy reverse-engineered the TLZC compression format used in most of the Tales of games.

http://blog.lse.epita.fr/articles/8-sta ... ormat.html

There's a python program at the bottom of the post, I couldn't get it to work though (I would get a 'list index out of range' error on line 37). Any way to convert it to a quickbms script?? Or if someone could get that python program to work, that's be great too!

sample TLZC-compressed files: http://www.mediafire.com/?6423f9rml64tsmd

finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 294 times

Re: TLZC compression

Post by finale00 » Sun Apr 08, 2012 9:37 pm

What game is this?
I couldn't get it to work either.

Code: Select all

Traceback (most recent call last):
  File "decompress.py", line 39, in <module>
    decompress_tlzc(buf, open(sys.argv[2], "w"))
  File "decompress.py", line 31, in decompress_tlzc
    decompress_block(lzma_params, block, out, remaining)
  File "decompress.py", line 11, in decompress_block
    out.write(pylzma.decompress(block, size, maxlength=size))
TypeError: Error while decompressing: 6
.............
You should send the samples to the author.

oathkeeper9918
beginner
Posts: 24
Joined: Sat Jul 09, 2011 9:16 pm
Has thanked: 1 time

Re: TLZC compression

Post by oathkeeper9918 » Sun Apr 08, 2012 10:08 pm

They're from Tales of Vesperia. But hey, you got farther than I did in executing it, at least.

I sent the samples to the author, not expecting to get too much though.

User avatar
chrrox
Moderator
Posts: 2541
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1269 times

Re: TLZC compression

Post by chrrox » Sun Apr 08, 2012 11:12 pm

I made a quickbms script based on his post enjoy.

Code: Select all

idstring "TLZC"
get name basename
string name + ".FPS4"
comtype MSF
get version long
get tzsize long
get tsize long
goto 0x1D
set blockcount tsize
math blockcount += 0xFFFF
math blockcount /= 0x10000
for i = 0 < blockcount
get zsize short
putarray 0 i zsize
next i
for i = 0 < blockcount
savepos offset
getarray ZSIZE 0 i
if tsize >= 0x10000
append
clog MEMORY_FILE OFFSET ZSIZE 0x10000
append
else
append
if ZSIZE == 0
log MEMORY_FILE OFFSET tsize
else
clog MEMORY_FILE OFFSET ZSIZE tsize
endif
append
endif
math tsize -= 0x10000
math offset + ZSIZE
goto offset
next i
get SIZE asize MEMORY_FILE
log name 0 SIZE MEMORY_FILE

finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 294 times

Re: Tales of Vesperia TLZC compression

Post by finale00 » Mon Apr 09, 2012 12:03 am

Doesn't work for the book_enemy files.

User avatar
chrrox
Moderator
Posts: 2541
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1269 times

Re: Tales of Vesperia TLZC compression

Post by chrrox » Mon Apr 09, 2012 12:10 am

those files are null?

User avatar
chrrox
Moderator
Posts: 2541
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1269 times

Re: Tales of Vesperia TLZC compression

Post by chrrox » Mon Apr 09, 2012 12:13 am

oops my bad
change the one line
i left a hard coded number in there from a file i tested.
updated post

finale00
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 2382
Joined: Sat Apr 09, 2011 1:22 am
Has thanked: 170 times
Been thanked: 294 times

Re: Tales of Vesperia TLZC compression

Post by finale00 » Mon Apr 09, 2012 12:21 am

Now it works for book_enemy_20, but still fails on the other non-null books_enemy's (eg: 18, 19).

It fails on the very last iteration of the loop.
Maybe you have to deal with the remaining block separately?

User avatar
chrrox
Moderator
Posts: 2541
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1269 times

Re: Tales of Vesperia TLZC compression

Post by chrrox » Mon Apr 09, 2012 12:33 am

done

oathkeeper9918
beginner
Posts: 24
Joined: Sat Jul 09, 2011 9:16 pm
Has thanked: 1 time

Re: Tales of Vesperia TLZC compression

Post by oathkeeper9918 » Mon Apr 09, 2012 12:54 am

Thanks! The script works perfectly for Vesperia's and Graces' files

albert1905
veteran
Posts: 93
Joined: Wed May 09, 2012 1:13 pm
Has thanked: 11 times
Been thanked: 3 times

Re: Tales of Vesperia TLZC compression

Post by albert1905 » Sat May 10, 2014 8:50 am

oathkeeper9918 wrote:Thanks! The script works perfectly for Vesperia's and Graces' files
Did I make a mistake..? It doesn't work.
K-85.png
You do not have the required permissions to view the files attached to this post.

Ekey
M-M-M-Monster veteran
M-M-M-Monster veteran
Posts: 1637
Joined: Wed Mar 31, 2010 6:54 am
Has thanked: 62 times
Been thanked: 821 times

Re: Tales of Vesperia TLZC compression

Post by Ekey » Sat May 10, 2014 4:35 pm

albert1905 wrote:
oathkeeper9918 wrote:Thanks! The script works perfectly for Vesperia's and Graces' files
Did I make a mistake..? It doesn't work.
K-85.png
replace

Code: Select all

math blockcount + 0xFFFF
math blockcount / 0x10000
to

Code: Select all

math blockcount += 0xFFFF
math blockcount /= 0x10000

albert1905
veteran
Posts: 93
Joined: Wed May 09, 2012 1:13 pm
Has thanked: 11 times
Been thanked: 3 times

Re: Tales of Vesperia TLZC compression

Post by albert1905 » Sun May 11, 2014 3:14 pm

Ekey wrote:
albert1905 wrote:
oathkeeper9918 wrote:Thanks! The script works perfectly for Vesperia's and Graces' files
Did I make a mistake..? It doesn't work.
K-85.png
replace

Code: Select all

math blockcount + 0xFFFF
math blockcount / 0x10000
to

Code: Select all

math blockcount += 0xFFFF
math blockcount /= 0x10000
Thanks a lot.

jrush
n00b
Posts: 11
Joined: Thu Oct 25, 2012 11:10 am

Re: Tales of Vesperia / Graces TLZC compression

Post by jrush » Thu May 15, 2014 12:29 am

Does this mean you can extract models from Tales of Graces F or Tales of Graces? I have some models from Vesperia Xbox but I want to know if you can get models from Vesperia PS3.

Post Reply