JRoland

How to make KOTOR 1 display DBCS languages

Recommended Posts

I am a Star Wars fan from China and want to translate KOTOR 1 into Chinese. But I have no knowledge of software engineering. After searching and learning on various forums, I successfully converted dialog.tlk into a txt and translated the first line of dialogue. However, when I run the game, the translated text appears as garbled characters. After further searching, I learned that KOTOR 1 does not support DBCS languages.
Can anyone please teach me how to make KOTOR 1 display GBK-encoded text?

Share this post


Link to post
Share on other sites

Odyssey (KOTOR's engine) doesn't use regular fonts, it uses a font sheet (i.e. an image of the characters). So language is effectively "hard coded" unless you edit the font sheet. There is a tool that will help you do that - https://deadlystream.com/files/file/2375-kotor-autotranslate-tool/ - but unfortunately it doesn't support DBCS languages. But it might at least help you create a custom font sheet manually.

I assume you already converted the translated text back into a binary TLK file? I'm not entirely sure if the TLK format even supports DBCS languages.

 

Share this post


Link to post
Share on other sites
1 hour ago, DarthParametric said:

Odyssey(KOTOR 的引擎)不使用常规字体,而是使用字体表(即字符图像)。因此,除非您编辑字体表,否则语言实际上是“硬编码”的。有一个工具可以帮助您编辑字体表 - https://deadlystream.com/files/file/2375-kotor-autotranslate-tool/ - 但遗憾的是它不支持 DBCS 语言。但它至少可以帮助您手动创建自定义字体表。

我猜你已经把翻译好的文本转换回二进制 TLK 文件了?我不太确定 TLK 格式是否支持 DBCS 语言。

 

Thank you very much for your reply. I previously came across this forum post and learned that KOTOR doesn't support DBCS languages. As you mentioned, this AutoTranslate Tool  also doesn't support DBCS languages. To create a font sheet, I must choose a language that it supports for translation. So, how can I create a DBCS font sheet? I tried selecting a GBK (simplified Chinese character encoding) TTF file and arbitrarily choosing a language to create the font sheet, but nothing happened.

Additionally, due to my near-zero software engineering knowledge, I didn’t fully understand what you meant by "hard coded image of the characters." Does this refer to something like SUP subtitle files? If so, what role do the texts in the TLK file play?

Share this post


Link to post
Share on other sites

I have no idea if KOTOR actually supports Chinese, since it was never released in that language. I think Neverwinter Nights does though, and Odyssey is based on Aurora (NWN's engine).

Start by referring to these links:

https://wiki.xoreos.org/index.php?title=Xml2tlk

https://wiki.xoreos.org/index.php?title=TLK_language_IDs_and_encodings

In theory you'd convert a UTF-8 XML with strings in simplified Chinese to a binary K1 TLK using Xoreos with the following command:

xml2tlk --cp936 --kotor dialog.xml dialog.tlk

The language ID would need to be changed at the top of the XML file

<tlk language="130">

based on the table from the link above.

You can get Xoreos Tools here. Here's a vanilla English K1 XML if you need it:  dialogK1.7z

 

But the actual translated text is only half the job. As I mentioned above, Odyssey uses a font sheet, not a font file. It's an image with each individual letter of the alphabet in a position that is defined in the accompanying TXI file. There are about half a dozen or so font sheets in K1. They have separate ones for the different resolutions apparently, plus additional ones for the end credits and the cheat console. A font sheet itself typically has a plain white RGB (aside from icons like controller buttons). The alpha channel is a mask. Here's a vanilla English example:

fnt_d10x10b.jpg.578a51b5de3dcd16073c6ce2faf363e5.jpg     fnt_d10x10b_ALPHA.jpg.11b986f9381b31d37ed4ee5bb8e70366.jpg

Since Wizard's tool doesn't support DBCS languages, you can try this older tool to generate a font sheet and TXI - https://deadlystream.com/files/file/535-kotor-font-tool-nwn-font-maker/

I'm not sure if that will work either, but it's worth a try.  Unfortunately the texture sheets it creates are quite low resolution though. You'd need to duplicate the sheet TGA and TXI to match all the vanilla filenames:

fnt_console
fnt_credits
fnt_creditsa
fnt_creditsb
fnt_d10x10b
fnt_d16x16
fnt_d16x16a
fnt_d16x16b
fnt_dialog16x16
fnt_galahad14

Although I'm not sure if that last one is actually used.

Share this post


Link to post
Share on other sites
2 hours ago, DarthParametric said:

I have no idea if KOTOR actually supports Chinese, since it was never released in that language. I think Neverwinter Nights does though, and Odyssey is based on Aurora (NWN's engine).

Start by referring to these links:

https://wiki.xoreos.org/index.php?title=Xml2tlk

https://wiki.xoreos.org/index.php?title=TLK_language_IDs_and_encodings

In theory you'd convert a UTF-8 XML with strings in simplified Chinese to a binary K1 TLK using Xoreos with the following command:


xml2tlk --cp936 --kotor dialog.xml dialog.tlk

The language ID would need to be changed at the top of the XML file


<tlk language="130">

based on the table from the link above.

You can get Xoreos Tools here. Here's a vanilla English K1 XML if you need it:  dialogK1.7z

 

But the actual translated text is only half the job. As I mentioned above, Odyssey uses a font sheet, not a font file. It's an image with each individual letter of the alphabet in a position that is defined in the accompanying TXI file. There are about half a dozen or so font sheets in K1. They have separate ones for the different resolutions apparently, plus additional ones for the end credits and the cheat console. A font sheet itself typically has a plain white RGB (aside from icons like controller buttons). The alpha channel is a mask. Here's a vanilla English example:

fnt_d10x10b.jpg.578a51b5de3dcd16073c6ce2faf363e5.jpg     fnt_d10x10b_ALPHA.jpg.11b986f9381b31d37ed4ee5bb8e70366.jpg

Since Wizard's tool doesn't support DBCS languages, you can try this older tool to generate a font sheet and TXI - https://deadlystream.com/files/file/535-kotor-font-tool-nwn-font-maker/

I'm not sure if that will work either, but it's worth a try.  Unfortunately the texture sheets it creates are quite low resolution though. You'd need to duplicate the sheet TGA and TXI to match all the vanilla filenames:

fnt_console
fnt_credits
fnt_creditsa
fnt_creditsb
fnt_d10x10b
fnt_d16x16
fnt_d16x16a
fnt_d16x16b
fnt_dialog16x16
fnt_galahad14

Although I'm not sure if that last one is actually used.

OMG
This is too complicated for a beginner like me, but thank you very much for your reply. I'll try to figure it all out.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.