Page 1 of 1

Mass Effect 2 TLK Unpack/Pack -> Help (Source code)

Posted: Mon Aug 29, 2011 2:58 pm
by Venushja
Hello.
Anyone knows, how to edit this Source Code? I want to extract it, package
it and have the same structure. Y'know, I extracted Original TLK to XML and then
I packaged that XML back to TLK (without any changes in XML file). This new TLK
have in result different structure (not the same structure as a structure in
original TLK file) and the size of file was about 100kB bigger. I really need
your help - my knowledge is not good enough to solve this. Sorry for my bad English.
Thanx for any help.

Code: Select all

http://www.megaupload.com/?d=6LE0W7U3
Source Code, TLK Files (PC and Xbox), TLK Tools 1.0.4 inside in rar file.

Re: Mass Effect 2 TLK Unpack/Pack -> Help (Source code)

Posted: Tue Aug 30, 2011 2:00 am
by delutto
You tried to contact the developer of the tool?

Re: Mass Effect 2 TLK Unpack/Pack -> Help (Source code)

Posted: Tue Aug 30, 2011 8:25 am
by Venushja
Not tried. The program sent me buddy and I pulled it from the source code and when I did not know what to do with it so I wrote here.

Re: Mass Effect 2 TLK Unpack/Pack -> Help (Source code)

Posted: Sat Sep 03, 2011 8:28 am
by Venushja
Really anyone? :(

Re: Mass Effect 2 TLK Unpack/Pack -> Help (Source code)

Posted: Mon Sep 19, 2011 8:01 pm
by mnn
The structure should be the same. I know this tool and format of ME2 TLK files. They use Huffman coding compression scheme. Basically that means, unless you have original source code BioWare used to compile those TLK files, you'll never get the same resulting file even if you haven't changed texts at all.

Re: Mass Effect 2 TLK Unpack/Pack -> Help (Source code)

Posted: Mon Nov 07, 2011 5:41 pm
by Krait
Hi, I accidentally stumbled upon this forum. I'm the developer of the tool. Quick Google search would lead you to the homepage of the project: http://social.bioware.com/project/3492/, where you could contact me ;)

I'm sorry for resurrecting the thread, just wanted to clarify for others.

Yes, the compression is Huffman coding, so the copy will never be 1-1. But there's another reason for the 100kB size difference. The original ME2 TLKs have one additional trick, which I didn't implement. When there is string A that is a suffix for another string B, then reference to string A is stored at the end of string B, instead of the actual string. So for example if there are three identical strings, they're stored only once, with references.

But at the time of writing the tool, I was too lazy to efficiently implement this. And the size difference is really affordable.

But the "structure", as you say, is ok. It's identical and appropriate for the format. It just lacks one optimalization, but it only means the file is _slighlty_ bigger nothing else.

The only issue with the tool is that it has very limited support for Xbox360 and PS3 TLKs. It only loads them fine and dumps to XML. But somehow, when converted back to TLK, it doesn't work on the console. I don't have any console for testing, so can't really trace the problem down.

Re: Mass Effect 2 TLK Unpack/Pack -> Help (Source code)

Posted: Mon Nov 07, 2011 5:58 pm
by mnn
Krait wrote:The only issue with the tool is that it has very limited support for Xbox360 and PS3 TLKs. It only loads them fine and dumps to XML. But somehow, when converted back to TLK, it doesn't work on the console. I don't have any console for testing, so can't really trace the problem down.
Do you correctly handle endianness?

Re: Mass Effect 2 TLK Unpack/Pack -> Help (Source code)

Posted: Mon Nov 07, 2011 6:17 pm
by Krait
mnn wrote:
Krait wrote:The only issue with the tool is that it has very limited support for Xbox360 and PS3 TLKs. It only loads them fine and dumps to XML. But somehow, when converted back to TLK, it doesn't work on the console. I don't have any console for testing, so can't really trace the problem down.
Do you correctly handle endianness?
Yes, changing endianness is currently the only difference between console and PC mode in the app. That's why it can properly read the TLK to XML. But when TLK is created from such XML, it's buggy on both Xbox360 and PS3. Weird, eh?

Re: Mass Effect 2 TLK Unpack/Pack -> Help (Source code)

Posted: Mon Nov 07, 2011 6:30 pm
by mnn
Are you sure endianness is the only thing different in console versions of TLK? Because apparently, there must be something else.

Re: Mass Effect 2 TLK Unpack/Pack -> Help (Source code)

Posted: Mon Nov 07, 2011 6:43 pm
by Krait
mnn wrote:Are you sure endianness is the only thing different in console versions of TLK? Because apparently, there must be something else.
Clearly it's not the only thing ;) I said that currently, it's the only implemented difference. And it's enough for one-way conversion only :/
Well, it's a dead end for me, because I don't own any console. I had reports from people who tried to run those TLKs on Xbox360 and PS3 and they had errors. But I couldn't understand what were the symptoms exactly and our contact was very limited unfortunately.

Re: Mass Effect 2 TLK Unpack/Pack -> Help (Source code)

Posted: Tue Nov 08, 2011 3:56 pm
by michalss
Yes there is something else, i have JTAG console here and if someone want to help i can test TLK's anytime you want. If you are interest please contact me on PM and i will send you msn, skype or IcQ .

Me and my firend spend many hours on this without the success, we also find that repacked TLK for PC has also many differents but it runs ok. I was able to run it for about 5 mints on X360 with text mess but thats about all, really unplayable at all.
Trust me PPL would ript off your hands to make it work on PS3 or Xbox360 :)

Mike