shabbywu / Battle-Brothers-CN

Battle Brothers(战场兄弟)中文翻译项目
https://battle-brothers-cn.shabbywu.cn/
GNU General Public License v3.0
488 stars 5 forks source link

Hello, bro #183

Closed daviskim007 closed 3 months ago

daviskim007 commented 4 months ago

Hello, I'm Korean and I'm personally translating Battle Brothers into Korean. I'd like to know how Battle Brothers converted the city and terrain names on the map to Chinese. I tried this but couldn't solve it due to font issues, so I need some advice. Since I'm using DeepL, it's okay to answer in Chinese :D

shabbywu commented 4 months ago

In short, Battle Brothers is a game based on OpenGL, and the text render technology used in big map is an very old-style method called bitmap. Bitmap can save memory when there is only little "character" to render, you can find some picture with suffix ".png" in the data folder, they are the Bitmap font.

However, chinese or other language does not using "character" to represent font, Bitmap is a hell. So we need another technology to render text in OpenGL. The one I used is FreeType/TrueType, you can also find some font file with suffix ".ttf" in the data folder, they are the TrueType font.

So, they keypoint now is "How to let Battle Brothers render text with TrueType font but not Bitmap font". We can split this issue into two sub issues.

For the first sub issue, we can found result in this doc, which is a Tutorial about "Text-Rendering" in OpenGL.

For the second sub issue, there will be more difficult to solve it. If we decompiled the game exe, we can find that Battle Brothers is a game compiled by c++ for x86 system. So we can use some x86 hook to replace the c++ function. I have used firda and libpeconv to make it, both can work well.

After solve the two sub issues above, the game will render font with TrueType. :)


It take me 3+ months part-time to try and implement the text render logic and embed it into Battle Brothers game, just for reference only. And in my maintainer roadmap, I am currently rewriting bb-launcher(the core part for text rendering), and will publish it into github release and nexusmods. (as soon as next month) If you dont mind to add me(shabbywu) into your Korean localization mod staff list(mark me as technology supporter), you can use bb-launcher directly.

daviskim007 commented 4 months ago

WOW. 听起来真的好难. There is no any Korean localization mod staff. I just did a localization of the Legends mod of Battle Brothers by myself and it's almost 90% complete. So If you can help me with the technology side of things, I'd be very grateful.

Because I don't know anything about programming and at first I had been editing the file directly. But there were so many problems with it that so I've just finished a work using someone else's hook format.

But I couldn't solve the font issue. I found the fonts folder in the gtx and the fonts.css file in the ui folder, but it looked like it was out of my knowledge.

So, I'd like to know what bb-launcher you're talking about, and try it out. If you don't mind, can I give it a try?

谢谢[你]的回答 :D

shabbywu commented 4 months ago

I need to take some test for rendering Korean character, Could you please give me a TureType font include Korean character.

In windows, you can find a folder named "fonts" (or other text meaning fonts in Korean). upload some fonts as attachment, when i am free i will try it.

shabbywu commented 4 months ago

bb-launcher is a part of this tool.

To render chinese character in big map, we must launch the game with this tools. And to render Korean character, i need to add Korean font file to bb-launcher project.

daviskim007 commented 4 months ago

general.zip

How about this bro? It's a true type font

daviskim007 commented 4 months ago

1

It's really cool and awesome. bro. It's like the 三国志 game I used to play in the past. It's like there are 刘备 and 诸葛亮 in a big city.

shabbywu commented 4 months ago

update: Next month I will publish a new version bb-launcher which support custom font.ttf. Maybe it can render Korean character, please wait more days.

(P.S. not sure when but never be early ten days of May......Becasue i need a holiday)

daviskim007 commented 4 months ago

Thank you so much. You don't have to be in such a hurry :D

shabbywu commented 3 months ago

image

Good news. Korean character can be rendered. And the new bb-launcher will release as soon as possible.

@daviskim007

daviskim007 commented 3 months ago

WOW!!! I'm so impressed. really bro.

shabbywu commented 3 months ago

@daviskim007 Hey guy, I have released a preview version bb-launcher at NexusMod .

Complete Usage docs can be found at README_EN

daviskim007 commented 3 months ago

1

This is truly amazing. You've accomplished something that no one else has been able to do since the release of Battle Brothers. I'm genuinely moved and very grateful to you. Some Koreans call you "大哥(Big Brother)" as a sign of respect. Once again, thank you so much.

shabbywu commented 3 months ago

/close