March 29, 2024, 02:31
bigger smaller reset     1020px Wide width Full width Reset   * *

Gildor's Forums

  Homepage Facebook Read news on Twitter Youtube channel Github page
Welcome, Guest. Please login or register.
Did you miss your activation email?

« previous next »
Print
Author Topic: Font Packages Readable - Decompress tool bug?  (Read 67749 times)
MixerX
Guest
« on: January 16, 2010, 16:42 »

Hello.
I've been very excited about playing around with your tools, they are all great. But I've found an odd thing: If I load a font package from any supported game into Umodel, font textures are loaded, everything works great. It's also possible to extract all textures as TGA files.
But if I try to decompress the same font package using the Decompress tool, nothing happens, the file remains intact. In some cases, like for MOH:A, some blocks are decompressed, but the textures remain compressed - although Umodel *can* actually read them. Could you please add support for decompressing textures in font packages for the Decompress tool? It's the only possible way for modifying font files, because they also include font configuration chunks and other textures, which are not possible to re-create using Unreal Editor.
Thanks.
« Last Edit: January 16, 2010, 21:42 by MixerX » Logged
Gildor
Administrator
Hero Member
*****
Posts: 7978



View Profile WWW
« Reply #1 on: January 16, 2010, 18:37 »

UE3 textures has compression inside its format. It is not affected by package compression/decompression.
(E.g. package is compressed (1), it holds texture which has compressed block (2), and this block holds texture data which is usually compressed with one of DXT formats (3); decompress tool removes compression #1).
Logged
MixerX
Guest
« Reply #2 on: January 16, 2010, 18:53 »

I understand it.
What I want to say is: if I decompress any usual texture package (with decompress tool), the whole package as well as the textures are decompressed, and I can extract original DXT compressed blocks either by hex editor or by using 'extract' tool (and add a corresponding dxt [1/3/5] header to it with hex editor). This works with almost all classic texture packages. If I try to do this with a font package, it just doesn't decompress the texture blocks. They remain LZO compressed, their lenght varies and it's not possible to simply add a DXT header and get the original texture. So I'll try to put in a simple way: I can get original DXT textures from classic supported texture packages, but I can't get original DXT textures from font packages, because they remain LZO compressed after using the decompress tool (I get no error message though).

For example, this is a font package AFTER decompression. For me it simply looks like the texture blocks are still LZO compressed.
http://www.sendspace.com/file/b0tk48
« Last Edit: January 16, 2010, 19:03 by MixerX » Logged
Gildor
Administrator
Hero Member
*****
Posts: 7978



View Profile WWW
« Reply #3 on: January 16, 2010, 19:02 »

If you just want to extract fonts, you should use umodel, not extract or decompress.
Decompress tool is useful for game localizers only - it allows to edit parts of packages with hex editors.
Logged
MixerX
Guest
« Reply #4 on: January 16, 2010, 19:06 »

But that is EXACTLY WHAT I WANT TO DO!
I'm a translator and I need to change game fonts. I want to decompress the whole font package, WHICH INCLUDES DDS FONT TEXTURES, so I can modify them and put back. DDS is a lenght-stable format, I've been doing this with many games in previous unreal engines.
I want to:
1. decompress the font package, so I have plain DDS textures
2. extract DDS textures with hex editor and add a header to them
3. modify them in photoshop
4. put the modified textures back into font archive using hex editor
It's possible to do this with texture archives, I've tried, for example, to change MOH:A logo this way.
It's NOT possible to do this with font archives, because DDS textures inside of the archive remain LZO compressed.

Let me get this straight:
I take a random texture file, for example, LocGameCommon.upk. Run 'decompress LocGameCommon.upk', the program runs through the file and decompresses everything inside of it. The result is a completelly decompressed file, from which I can get plain DDS files using hex editor. I add a DDS header to them and I have the original texture files.
I take a random font file, for example UI_Fonts.upk. Run 'decompress UI_Fonts.upk', and nothing happens. I get no error message, the output file is exactly the same as the input file. DDS textures are still compressed so it's not possible to work with it.
« Last Edit: January 16, 2010, 21:52 by MixerX » Logged
Gildor
Administrator
Hero Member
*****
Posts: 7978



View Profile WWW
« Reply #5 on: January 16, 2010, 19:21 »

There is no easy way to replace compressed texture in a package.
Unreal Engine has capabilities to create localized packages, so you may add package to game distribution without modifying original packages. I don't know how to do it.

Check this forums:
http://forum.xentax.com/viewtopic.php?f=10&t=3754&start=0&st=0&sk=t&sd=a
These people used my tools to localize games, but I'm really don't know what they do. I have not found other links now, I'm taking them from my site referrers.
Logged
MixerX
Guest
« Reply #6 on: January 16, 2010, 19:42 »

I think you still don't understand me... I don't know how should I say it so it will be more clear. Please, read it carefully. Those people were using your tools to translate subtitles. I want to use your tools for modifying font files, but I can't, because there is (I hope that just) a little bug.

Inside of the *.UPK archives, there are DXT1/DXT3/DXT5 compressed DDS files. The whole package is LZO compressed.
If you decompress the LZO-compressed UPK package, you can EASILY work with the decompressed archive. It's very easy to determine where texture data starts and where it ends (it's possible to determine it just by looking at the bytes, DDS format is pretty straightforward; several bytes for RGB, several bytes for alpha. it has always the same structure.). You select it, copy into a new file, add an appropriate DXT header, save the file with a DDS extension, and you're done. Now you can work with the texture, modify it, and because it's a DDS file, it will always has the same lenght (as long as you dont change the type of DXT compression or texture resolution). After you modify the texture, you remove the DXT header and put it back into the LZO-decompressed UPK file.
THIS WORKS. You can change any texture you want, in case the UPK file isn't LZO compressed anymore. This is what the decompress tool is good for.
Now the bug. I don't know the reason why it happens, but the decompress tool isn't able to fully decompress the font packages. It is, on the other hand, able to fully decompress any other texture packages.
Inside of the font package, there is a font configuration chunk and DDS files. If I load a font package into Umodel, it loads the DDS font textures, I can see them, I can extract them (to TGA, which is useless for me). Every font package is as well compressed with LZO.

So again, I hope the last time:
UMODEL can handle font packages, can decompress the LZO compression on dds font textures, can extract them into TGA.
For some reason, Decompress tool decompresses only certain parts of the font packages and the dds font textures inside of them remain LZO compressed.
This is why I call it a bug. All I please you for, is to take a look at it. If you can fix 'decompress' tool, so it will decompress the LZO-compressed DDS texture data in font packages, just like it successfully does in any other texture packages, I will be able to change game fonts easily.
Hope I've said it clearly enough this time. Sorry if I sound a little angry, I just want you to understand me Smiley
« Last Edit: January 16, 2010, 21:52 by MixerX » Logged
MixerX
Guest
« Reply #7 on: January 16, 2010, 19:52 »

Simply said, and sorry for spamming:
If I try to decompress random texture package, it works. All the textures inside of the output file aren't LZO compressed anymore.
If I try to decompress a font texture package, it doesn't work. All the textures inside of the output file remain LZO compressed.
If I load the same font package into UMODEL, UMODEL can read the textures and work with them. So it's a bug in the 'decompress' tool. I need to decompress the font package using DECOMPRESS tool, because that's the only way I can put the modified textures back into the decompressed package.
« Last Edit: January 16, 2010, 21:50 by MixerX » Logged
MixerX
Guest
« Reply #8 on: January 16, 2010, 20:40 »

One more thing Smiley

Example files:

In this RAR archive there are texture packages. Original LZO-compressed package and the same package decompressed with Decompress (as a proof that it works).
http://lokalizacie.gamesweb.sk/texture_package.rar

Here is a DDS file, which I've extracted from this decompressed archive (as a proof that it's possible to do). It's the last one, which basically goes to the end of the file.
http://lokalizacie.gamesweb.sk/texture.rar

And here are example font packages from games, which are listed as supported (MOH:A, SAW). If I run them through Decompress, the output file is exactly the same as the input file. Decompress doesn't do anything to them, although I get no error message. You can try yourself.
http://lokalizacie.gamesweb.sk/fonts_packages.rar
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7978



View Profile WWW
« Reply #9 on: January 16, 2010, 23:07 »

Quote
Sorry if I sound a little angry, I just want you to understand me
I'm fully understand you since the first your message. But you don't understand me.
Quote
For some reason, Decompress tool decompresses only certain parts of the font packages and the dds font textures inside of them remain LZO compressed.
This is why I call it a bug.
There is no bug neither in 'umodel' or 'decompress'. This is a nested compression on texture object level, not on package level.
I cannot produce package with decompressed texture data chunks, because it will change object size and I'll need to shift other objects inside package, so I'll need to parse whole package and all data stored inside it.
'decompress' tool simplt removes compression from package. Fully. It will not remove mp3 compression from sounds or DXT compression from textures. And it cannot remove extra LZO compression made on texture level by Epic's programmers.

Quote
Those people were using your tools to translate subtitles.
I've seen Korean and Turkish fonts for Batman on some forums. How does these people made it?
Possibly you may create font package in UT3 editor and put it into game distribution. Borderlands will treat such package as old-version file and it should pick it correctly.
Logged
MixerX
Guest
« Reply #10 on: January 16, 2010, 23:52 »

Okay, now it's clear. There's no way how to do it, unless the pointers are recalculated. You could have put it this way in your first message as well Wink

Batman is shipped with Unicode font table. In the fonts there are generated (almost) all Unicode characters, from Cyrillic to, as you mention, Korean or Japanese. Unfortunatelly, Batman is only one of the few games, which support extended character table. Most of the games only have basic Western 256 characters or they have characters only for those languages, which have paid for an official localization. I'm from Slovakia and we're the only country to have characters such as ŕ, ĺ or ľ.

The problem with creating new font packages is, that you need to:
1. Know the names, types and properties used for generating font entries.
2. Actually have those fonts in vector format. In packages they are often called 'Bigfont' or something like that, so you have to search for similar ones in large font databases. In addition, they are often shareware.
3. For me the biggest problem: In every font package there are textures, which you can't re-create by generating new fonts, like buttons, various special characters, textures or the fonts themselves have some special graphic effects. They all are mapped to certain characters and as far as I know it's not possible to import a texture, change its type to 'font' and map characters to it. It might be possible to generate a font, replace the texture and manually change all the mappings + coordinates, but oh well... human race is a lazy race. I've tried generating fonts in Roboblitz Unreal Editor (the first game to come in Unreal Engine 3), it worked, but it was a little messy.

Anyway, thanks for your time and replies Smiley I'm sorry if I was annoying you too much Wink
« Last Edit: January 16, 2010, 23:58 by MixerX » Logged
Gildor
Administrator
Hero Member
*****
Posts: 7978



View Profile WWW
« Reply #11 on: January 17, 2010, 01:37 »

You are not annoying Smiley
Roboblitz is very old game, I think it's a first UE3 game. You could try to use a newer game (UT3).

One of my friends (he is a russian professional localizer) replaced texture in a package by patching package export table and adding a bigger texture to the end of package file.
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7978



View Profile WWW
« Reply #12 on: January 18, 2010, 17:33 »

Possibly this will help:
(how to create correct localization using standard UE3 features)
http://udn.epicgames.com/Three/LocalizationReference.html
http://udn.epicgames.com/Three/LocalizedTextFiles.html
http://udn.epicgames.com/Three/ImportingFonts.html
Logged
MixerX
Guest
« Reply #13 on: January 18, 2010, 21:27 »

Yeah, there were some interesting points in the Localized Text References (maybe a way how to override those dialogue packages, which everybody wants to edit, but I'm not really sure). In the TrueTypeFactory section, there's basically everything I already know Smiley
Thanks for the links!

PS: Your Russian friend is probably a programmer... I'm not, so trying to do something like that would be complicated I think.
Logged
Gildor
Administrator
Hero Member
*****
Posts: 7978



View Profile WWW
« Reply #14 on: January 18, 2010, 21:28 »

PS: Your Russian friend is probably a programmer... I'm not, so trying to do something like that would be complicated I think.
Yes, he is a programmer.
Yes, this task is complicated.
Logged
Print 
« previous next »
Jump to:  

Powered by SMF | SMF © 2006-2009, Simple Machines LLC
Leviathan design by Bloc | XHTML | CSS