Important information: this site is currently scheduled to go offline indefinitely by end of the year.

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 »

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: 307 times

Re: TLZC compression

Post by finale00 »

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 »

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.
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: TLZC compression

Post by chrrox »

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: 307 times

Re: Tales of Vesperia TLZC compression

Post by finale00 »

Doesn't work for the book_enemy files.
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: Tales of Vesperia TLZC compression

Post by chrrox »

those files are null?
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: Tales of Vesperia TLZC compression

Post by chrrox »

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: 307 times

Re: Tales of Vesperia TLZC compression

Post by finale00 »

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?
chrrox
Moderator
Posts: 2602
Joined: Sun May 18, 2008 3:01 pm
Has thanked: 57 times
Been thanked: 1422 times

Re: Tales of Vesperia TLZC compression

Post by chrrox »

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 »

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 »

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: 1823
Joined: Wed Mar 31, 2010 6:54 am
Has thanked: 92 times
Been thanked: 1058 times

Re: Tales of Vesperia TLZC compression

Post by Ekey »

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 »

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 »

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