Help! I want to add a new language for the Original game

In this forum you will find and post information regarding the modding of Star Wars Battlefront 2. DO NOT POST MOD IDEAS/REQUESTS.

Moderator: Moderators

Post Reply
ZetaGundam
Recruit Womprat Killer
Posts: 9
Joined: Fri Apr 16, 2021 10:38 am
Projects :: No Mod project currently.
Games I'm Playing :: SWBattlefrontII
xbox live or psn: No gamertag set

Help! I want to add a new language for the Original game

Post by ZetaGundam »

Can the editlocalize.bat edit the STAR WARS Battlefront II original file? Or change one of the original languages in game?
User avatar
cbadal
Corporal
Corporal
Posts: 155
Joined: Sun Jan 18, 2015 5:23 pm
Projects :: SWBF2 XBOX Mod Environment
Games I'm Playing :: SW Battlefront 2
xbox live or psn: No gamertag set
Contact:

Re: Help! I want to add a new language for the Original game

Post by cbadal »

Adding a language to the game is not supported by the modtools.
I'm not sure how many language variations of the game exist either.
I know the game supports [English (US), English (UK), Spanish, Italian, French, German, Japanese].

But my (Steam) version of the Game only has the English US files, same with my DVD game version.
I recently bought the GOG version with the 'May The 4th be with you' sale, and it looks to have the best language support of all the versions that I have [English (US), Spanish, Italian, French, German].

Along with the language strings, there are also the movie files and voice over (by voice actors) sound files that are part of 'localization' too.

I do not think this has been done by a modder before.
Which language did you want to add?
It could be the case that the GOG and Steam game versions support more languages than I am aware of. Maybe ask GOG & Steam.
User avatar
Anakin
Master of the Force
Master of the Force
Posts: 4817
Joined: Sat Sep 19, 2009 11:37 am
Projects :: RC Side Mod - Remastered - SWBF3 Legacy
Location: Mos Espa (germany)

Re: Help! I want to add a new language for the Original game

Post by Anakin »

more languages are supported, but for some reason steam always installs english. For dvd it depends on the language you select on the install setup.

I think it would be easier to hijack an existing language and overwrite it. i don't think anyone switches the language once installed
ZetaGundam
Recruit Womprat Killer
Posts: 9
Joined: Fri Apr 16, 2021 10:38 am
Projects :: No Mod project currently.
Games I'm Playing :: SWBattlefrontII
xbox live or psn: No gamertag set

Re: Help! I want to add a new language for the Original game

Post by ZetaGundam »

Anakin wrote:
Sat Jun 05, 2021 6:24 am
more languages are supported, but for some reason steam always installs english. For dvd it depends on the language you select on the install setup.

I think it would be easier to hijack an existing language and overwrite it. i don't think anyone switches the language once installed
Well I' m Chinese STAR WARS fan, I want to make a Chinese language patch for this game.
nobody3
Rebel Sergeant
Rebel Sergeant
Posts: 188
Joined: Wed Jun 15, 2011 8:30 am

Re: Help! I want to add a new language for the Original game

Post by nobody3 »

I've done it before (by that I mean I started the work), but I gave up because I realized I'd need the audio/voice translated as well for it to be worth it.
ZetaGundam
Recruit Womprat Killer
Posts: 9
Joined: Fri Apr 16, 2021 10:38 am
Projects :: No Mod project currently.
Games I'm Playing :: SWBattlefrontII
xbox live or psn: No gamertag set

Re: Help! I want to add a new language for the Original game

Post by ZetaGundam »

nobody3 wrote:
Mon Oct 25, 2021 11:29 am
I've done it before (by that I mean I started the work), but I gave up because I realized I'd need the audio/voice translated as well for it to be worth it.
Thanks for your reply, I only need to translated the text part into the game. You said you once to start this work, can you tell me how to Change the text of the Game?
nobody3
Rebel Sergeant
Rebel Sergeant
Posts: 188
Joined: Wed Jun 15, 2011 8:30 am

Re: Help! I want to add a new language for the Original game

Post by nobody3 »

It's as you said, editlocalize.bat. It gets munged into core.lvl. You need to learn how to use modtools before attempting this.
Marth8880
Resistance Leader
Posts: 5042
Joined: Tue Feb 09, 2010 8:43 pm
Projects :: DI2 + Psychosis
Games I'm Playing :: Silent Hill 2
xbox live or psn: Marth8880
Location: Edinburgh, UK
Contact:

Re: Help! I want to add a new language for the Original game

Post by Marth8880 »

Might be possible by hijacking an existing language as mentioned, but my main concern would be the probable lack of support for Chinese alphabet characters.
User avatar
AnthonyBF2
Sith
Sith
Posts: 1255
Joined: Wed Aug 21, 2013 3:55 pm
Projects :: PS2+PSP Overhaul

Re: Help! I want to add a new language for the Original game

Post by AnthonyBF2 »

BF2 supports Japanese characters, I think it should also support Chinese.
ZetaGundam
Recruit Womprat Killer
Posts: 9
Joined: Fri Apr 16, 2021 10:38 am
Projects :: No Mod project currently.
Games I'm Playing :: SWBattlefrontII
xbox live or psn: No gamertag set

Re: Help! I want to add a new language for the Original game

Post by ZetaGundam »

nobody3 wrote:
Sat Nov 27, 2021 2:18 pm
It's as you said, editlocalize.bat. It gets munged into core.lvl. You need to learn how to use modtools before attempting this.
Thanks, Have you ever import the language into the game succeed?
The font can be displayed accurately?
ZetaGundam
Recruit Womprat Killer
Posts: 9
Joined: Fri Apr 16, 2021 10:38 am
Projects :: No Mod project currently.
Games I'm Playing :: SWBattlefrontII
xbox live or psn: No gamertag set

Re: Help! I want to add a new language for the Original game

Post by ZetaGundam »

AnthonyBF2 wrote:
Mon Nov 29, 2021 5:30 pm
BF2 supports Japanese characters, I think it should also support Chinese.
Unfortunately, The game not support Chinese yet.
Recently, Republic Commando and Jedi Academy on SWITCH ,Play Station or Xbox support Chinese, just PC version not support. I hope the Disney Official or LucasArts can update for PC.
Sporadia
Corporal
Corporal
Posts: 151
Joined: Thu Jan 24, 2019 11:02 pm
Projects :: No Mod project currently
Games I'm Playing :: None
xbox live or psn: No gamertag set

Re: Help! I want to add a new language for the Original game

Post by Sporadia »

Does the Steam version allow you to change language at all? I changed it to French using the menu on steam and it downloaded something, but the game was still in English. There's also no option to change language in the game.

Done some testing though because I was interested. The editlocalize tool should be easy. If you go to file > new then it lets you add a new language without hijacking an existing one, but I have no idea how to set the game to actually use that language. Then I tried hijacking English. I googled some simplified Chinese characters that don't exist in Japanese and put them in the name of one of my units. They don't show up at all. But it might be a thing with the English settings because I tried the same using some Japanese hiragana and kanji which are supposed to be supported, and they didn't show up either. Nor does the Cyrillic alphabet.

The most interesting thing I did get were the Spanish letters: áéñóúü. And assuming it works for French and Italian, I also got these extra Portuguese ones: ãõ. And all these letters from Scandinavian languages: ÆæØøÅåÄäÖöÐðÞþÝý. But the extra Polish letters didn't work, so it's not good for the entire Latin alphabet.

If someone did this enough, they could probably work out the exact libraries of characters that the European/American game accepts. (eg looking at unicode tables.)

It looks like there's a very slim chance that you could create a Chinese translation by modding over the Japanese language on a Japanese version of the game. But then things like simplified characters could still be problem. So is getting a Japanese version of the game in the first place. Don't recommend that at all. Realistically I think it would take something like an engine mod to add Chinese as an extra language properly (and add a robust language selection on PC in general).
ZetaGundam
Recruit Womprat Killer
Posts: 9
Joined: Fri Apr 16, 2021 10:38 am
Projects :: No Mod project currently.
Games I'm Playing :: SWBattlefrontII
xbox live or psn: No gamertag set

Re: Help! I want to add a new language for the Original game

Post by ZetaGundam »

Sporadia wrote:
Tue Dec 14, 2021 11:12 am
Does the Steam version allow you to change language at all? I changed it to French using the menu on steam and it downloaded something, but the game was still in English. There's also no option to change language in the game.

Done some testing though because I was interested. The editlocalize tool should be easy. If you go to file > new then it lets you add a new language without hijacking an existing one, but I have no idea how to set the game to actually use that language. Then I tried hijacking English. I googled some simplified Chinese characters that don't exist in Japanese and put them in the name of one of my units. They don't show up at all. But it might be a thing with the English settings because I tried the same using some Japanese hiragana and kanji which are supposed to be supported, and they didn't show up either. Nor does the Cyrillic alphabet.

The most interesting thing I did get were the Spanish letters: áéñóúü. And assuming it works for French and Italian, I also got these extra Portuguese ones: ãõ. And all these letters from Scandinavian languages: ÆæØøÅåÄäÖöÐðÞþÝý. But the extra Polish letters didn't work, so it's not good for the entire Latin alphabet.

If someone did this enough, they could probably work out the exact libraries of characters that the European/American game accepts. (eg looking at unicode tables.)

It looks like there's a very slim chance that you could create a Chinese translation by modding over the Japanese language on a Japanese version of the game. But then things like simplified characters could still be problem. So is getting a Japanese version of the game in the first place. Don't recommend that at all. Realistically I think it would take something like an engine mod to add Chinese as an extra language properly (and add a robust language selection on PC in general).
Steam version change language need to use the Launch Options, input " /lang 0 or other number".
I try to change it to French, it's works. But I fail when I try to change it to Russian, the game can' t run.
Sporadia
Corporal
Corporal
Posts: 151
Joined: Thu Jan 24, 2019 11:02 pm
Projects :: No Mod project currently
Games I'm Playing :: None
xbox live or psn: No gamertag set

Re: Help! I want to add a new language for the Original game

Post by Sporadia »

Oh, you're right. And I didn't test the language options in a battle, which I now realise was a mistake. I only looked at the menus and saw that they were in English. But now I've tested more and I get what's going on.

If you go to Properties > Languages, then that menu changes the language of all the audio files. That's why it's a download. (if it doesn't perform a download then it hasn't worked). Then you have to go to the Launch Options to change the language of the text (with /lang). It seems possible to mix and match the text language and audio language. But changing the language of the text doesn't perform a download. The European text must all already be present in the game files. There are posts on the Steam forums with this table:

Code: Select all

/lang 0	English (US server)
/lang 1	Spanish (EU server)
/lang 2	Italian (EU server)
/lang 3	French (EU server)
/lang 4	German (EU server)
/lang 6	English (EU server)
A source: https://steamcommunity.com/sharedfiles/ ... =414295044

I don't know what's supposed to happen with /lang 5 but consensus is that it crashes the game. I can't find anything on a /lang 7. I also wouldn't be surprised if /lang 6 uses the UK English option, but I haven't tested it.

Since I can only find those 6 options, how did you try changing it to Russian? I can believe that changing the text language to Russian would break the game because the Launch Options don't download anything extra, and the Cyrillic alphabet is one of the things that wouldn't display. But it might be possible to mod it in somehow, if we figure out what files are affected. There are definitely other versions of the game which support different character sets.

EDIT: Looking at alternative ways to apply Launch Options, I've discovered something else. You can change the text language of the debug game (BF2_modtools_NoDVD).
  1. Right click on BF2_modtools_NoDVD.exe and create a shortcut
  2. Right click on the shortcut, and select properties
  3. Go to the Shortcut tab if it isn't already open
  4. In the target box, add /lang 3 (or whatever number you need) at the very end. Make sure you put it after the speech marks. So it becomes something like "C:\Program Files (x86)\Steam\steamapps\common\Star Wars Battlefront II Classic\GameData\BF2_modtools_NoDVD.exe" /lang 3
This works for the actual game exe too, but you need to make sure that the Steam Launch Options are empty first, otherwise they will overwrite the Launch Options from the shortcut. The debug game doesn't launch through Steam, and is not affected by the Steam Launch Options. Yet the /lang command still works on it, which is good to know.

EDIT 2: If you go to BF2_ModTools/data_ABC/Common/fonts, there are several .fff files in there which tell the game what font to use for different characters. The modtools have a tool to open/edit these files. Go to BF2_ModTools/ToolsFL/bin. There is a tool in there called FontEdit. Run FontEdit, then go to File > Open and navigate to one of the .fff files in your mod folder (I needed to tell the window to look for .fff, not .tga). This will open the font file in the editor. Use the arrow keys to move between each character and you'll see the fonts in the modtools (and presumably in the game) are only set up for the Latin alphabet, not Cyrillic or Japanese etc. If you wanted to hijack an existing language to support Chinese, I bet you could replace these .fff files with fonts that do contain Chinese characters (since the FontEdit tool let's you choose and save your own .fff), or attach Chinese characters to the end of the existing file. I haven't really played with it yet, but it's a start. There is a readme in the fonts folder that tells you what font the original game uses, but they're all custom made so I'm not sure how to get them. In FontEdit, if you go to Font > Capture it will only let you select fonts from your computer, but there's a box that lets you choose what script (character set) you want to add. Just try to keep them about the same size as the font you're overwriting. You can also search the fonts in your computer with the Show more fonts button in the Capture window (it's really good for checking what fonts support what languages). In my case, I can add Chinese Simplified characters from the Microsoft YaHei font. I don't know yet if this is enough to make Chinese characters appear in game. But this surely seems like it will be a required step. I assume this stuff gets munged into common.lvl. Then maybe it gets read by the addme along with the localization, or maybe it will require a more complicated mod.

EDIT 3: Nevermind, Chinese characters don't actually work in the FontEdit tool, they're just showing up as a ? You can get some basic Japanese characters this way though (along with lots of other alphabets). I don't know how else to make .fff font files since it's a BF2 specific file extension, so maybe a Chinese translation can't be done (without a very talented hex editor). Korean characters don't work either, nor does Kanji, so maybe it's not made for CJK. There's a unicode button that takes hours to test and it seems more promising. I want to try it with GNU unifont, but I won't be able to do that until later. If that doesn't work then nothing will.

EDIT 4: The unicode button is the buggiest thing in FontEdit. It might as well not be there to be honest. I've tested it with a font that's based on unicode and despite watching it cycle through every possible character during the capture, it doesn't actually use them. Regardless of what you select, the unicode button just gives you the Western Script after about an hour of waiting. Do not use.

If you use Capture normally, it works for these scripts: Western, Central European, Baltic, Turkish, Vietnamese, Cyrillic, Greek and Thai. It might work for Arabic and Hebrew but I'm so unfamiliar with those scripts that I can't tell if anything is missing. It doesn't work at all for Korean or Chinese. With Japanese, it will give you all the kana, but no kanji.

EDIT 5: I've now tried munging a font with Cyrillic characters and it definitely needs more work. I added the fonts to core.req (hoping it would replace the stock fonts). It did replace all the English letters in the menu and in the game. Or rather, it messed up the English letters. But at least it did something. I have a test unit localized with a Cyrillic name, and that still won't show up though; it's just blank. There's also a japanese.ciu file that looks important for this, but I'm not sure exactly what it's for or how it's used.

EDIT 6: Typing with a Russian keyboard on FontEdit isn't automatically jumping to the correct character (whereas typing in English jumps to the letter you've just typed). So I can't guarantee that it's mapping the symbols to the correct keys/code anyway. It would really take a hexeditor to figure out the .fff files. And I'm back to thinking it might take an engine mod if it needs to use a custom .ciu file (which looks like a list of integer unicode values in hex, it's hard to tell if it even has any file information).
ZetaGundam
Recruit Womprat Killer
Posts: 9
Joined: Fri Apr 16, 2021 10:38 am
Projects :: No Mod project currently.
Games I'm Playing :: SWBattlefrontII
xbox live or psn: No gamertag set

Re: Help! I want to add a new language for the Original game

Post by ZetaGundam »

Sporadia wrote:
Thu Dec 23, 2021 10:35 am
Oh, you're right. And I didn't test the language options in a battle, which I now realise was a mistake. I only looked at the menus and saw that they were in English. But now I've tested more and I get what's going on.

If you go to Properties > Languages, then that menu changes the language of all the audio files. That's why it's a download. (if it doesn't perform a download then it hasn't worked). Then you have to go to the Launch Options to change the language of the text (with /lang). It seems possible to mix and match the text language and audio language. But changing the language of the text doesn't perform a download. The European text must all already be present in the game files. There are posts on the Steam forums with this table:

Code: Select all

/lang 0	English (US server)
/lang 1	Spanish (EU server)
/lang 2	Italian (EU server)
/lang 3	French (EU server)
/lang 4	German (EU server)
/lang 6	English (EU server)
A source: https://steamcommunity.com/sharedfiles/ ... =414295044

I don't know what's supposed to happen with /lang 5 but consensus is that it crashes the game. I can't find anything on a /lang 7. I also wouldn't be surprised if /lang 6 uses the UK English option, but I haven't tested it.

Since I can only find those 6 options, how did you try changing it to Russian? I can believe that changing the text language to Russian would break the game because the Launch Options don't download anything extra, and the Cyrillic alphabet is one of the things that wouldn't display. But it might be possible to mod it in somehow, if we figure out what files are affected. There are definitely other versions of the game which support different character sets.

EDIT: Looking at alternative ways to apply Launch Options, I've discovered something else. You can change the text language of the debug game (BF2_modtools_NoDVD).
  1. Right click on BF2_modtools_NoDVD.exe and create a shortcut
  2. Right click on the shortcut, and select properties
  3. Go to the Shortcut tab if it isn't already open
  4. In the target box, add /lang 3 (or whatever number you need) at the very end. Make sure you put it after the speech marks. So it becomes something like "C:\Program Files (x86)\Steam\steamapps\common\Star Wars Battlefront II Classic\GameData\BF2_modtools_NoDVD.exe" /lang 3
This works for the actual game exe too, but you need to make sure that the Steam Launch Options are empty first, otherwise they will overwrite the Launch Options from the shortcut. The debug game doesn't launch through Steam, and is not affected by the Steam Launch Options. Yet the /lang command still works on it, which is good to know.

EDIT 2: If you go to BF2_ModTools/data_ABC/Common/fonts, there are several .fff files in there which tell the game what font to use for different characters. The modtools have a tool to open/edit these files. Go to BF2_ModTools/ToolsFL/bin. There is a tool in there called FontEdit. Run FontEdit, then go to File > Open and navigate to one of the .fff files in your mod folder (I needed to tell the window to look for .fff, not .tga). This will open the font file in the editor. Use the arrow keys to move between each character and you'll see the fonts in the modtools (and presumably in the game) are only set up for the Latin alphabet, not Cyrillic or Japanese etc. If you wanted to hijack an existing language to support Chinese, I bet you could replace these .fff files with fonts that do contain Chinese characters (since the FontEdit tool let's you choose and save your own .fff), or attach Chinese characters to the end of the existing file. I haven't really played with it yet, but it's a start. There is a readme in the fonts folder that tells you what font the original game uses, but they're all custom made so I'm not sure how to get them. In FontEdit, if you go to Font > Capture it will only let you select fonts from your computer, but there's a box that lets you choose what script (character set) you want to add. Just try to keep them about the same size as the font you're overwriting. You can also search the fonts in your computer with the Show more fonts button in the Capture window (it's really good for checking what fonts support what languages). In my case, I can add Chinese Simplified characters from the Microsoft YaHei font. I don't know yet if this is enough to make Chinese characters appear in game. But this surely seems like it will be a required step. I assume this stuff gets munged into common.lvl. Then maybe it gets read by the addme along with the localization, or maybe it will require a more complicated mod.

EDIT 3: Nevermind, Chinese characters don't actually work in the FontEdit tool, they're just showing up as a ? You can get some basic Japanese characters this way though (along with lots of other alphabets). I don't know how else to make .fff font files since it's a BF2 specific file extension, so maybe a Chinese translation can't be done (without a very talented hex editor). Korean characters don't work either, nor does Kanji, so maybe it's not made for CJK. There's a unicode button that takes hours to test and it seems more promising. I want to try it with GNU unifont, but I won't be able to do that until later. If that doesn't work then nothing will.

EDIT 4: The unicode button is the buggiest thing in FontEdit. It might as well not be there to be honest. I've tested it with a font that's based on unicode and despite watching it cycle through every possible character during the capture, it doesn't actually use them. Regardless of what you select, the unicode button just gives you the Western Script after about an hour of waiting. Do not use.

If you use Capture normally, it works for these scripts: Western, Central European, Baltic, Turkish, Vietnamese, Cyrillic, Greek and Thai. It might work for Arabic and Hebrew but I'm so unfamiliar with those scripts that I can't tell if anything is missing. It doesn't work at all for Korean or Chinese. With Japanese, it will give you all the kana, but no kanji.

EDIT 5: I've now tried munging a font with Cyrillic characters and it definitely needs more work. I added the fonts to core.req (hoping it would replace the stock fonts). It did replace all the English letters in the menu and in the game. Or rather, it messed up the English letters. But at least it did something. I have a test unit localized with a Cyrillic name, and that still won't show up though; it's just blank. There's also a japanese.ciu file that looks important for this, but I'm not sure exactly what it's for or how it's used.

EDIT 6: Typing with a Russian keyboard on FontEdit isn't automatically jumping to the correct character (whereas typing in English jumps to the letter you've just typed). So I can't guarantee that it's mapping the symbols to the correct keys/code anyway. It would really take a hexeditor to figure out the .fff files. And I'm back to thinking it might take an engine mod if it needs to use a custom .ciu file (which looks like a list of integer unicode values in hex, it's hard to tell if it even has any file information).
Well, the BF2_Modtools_NoDVD.exe can' run in my computer, although I copy the binkw32.dll.
I still don' t know how to use the FontEdit. I Run FontEdit, then go to File > Open, then I select a .fff file in BF2_ModTools/data_ABC/Common/fonts. Then I click the Font>Unicode>Capture, choose Song style(宋体).
Then I don' t know how to do in next step. In fact I click the save to replace the .fff file which I open.
ZetaGundam
Recruit Womprat Killer
Posts: 9
Joined: Fri Apr 16, 2021 10:38 am
Projects :: No Mod project currently.
Games I'm Playing :: SWBattlefrontII
xbox live or psn: No gamertag set

Re: Help! I want to add a new language for the Original game

Post by ZetaGundam »

Sporadia wrote:
Thu Dec 23, 2021 10:35 am
Oh, you're right. And I didn't test the language options in a battle, which I now realise was a mistake. I only looked at the menus and saw that they were in English. But now I've tested more and I get what's going on.

If you go to Properties > Languages, then that menu changes the language of all the audio files. That's why it's a download. (if it doesn't perform a download then it hasn't worked). Then you have to go to the Launch Options to change the language of the text (with /lang). It seems possible to mix and match the text language and audio language. But changing the language of the text doesn't perform a download. The European text must all already be present in the game files. There are posts on the Steam forums with this table:

Code: Select all

/lang 0	English (US server)
/lang 1	Spanish (EU server)
/lang 2	Italian (EU server)
/lang 3	French (EU server)
/lang 4	German (EU server)
/lang 6	English (EU server)
A source: https://steamcommunity.com/sharedfiles/ ... =414295044

I don't know what's supposed to happen with /lang 5 but consensus is that it crashes the game. I can't find anything on a /lang 7. I also wouldn't be surprised if /lang 6 uses the UK English option, but I haven't tested it.

Since I can only find those 6 options, how did you try changing it to Russian? I can believe that changing the text language to Russian would break the game because the Launch Options don't download anything extra, and the Cyrillic alphabet is one of the things that wouldn't display. But it might be possible to mod it in somehow, if we figure out what files are affected. There are definitely other versions of the game which support different character sets.

EDIT: Looking at alternative ways to apply Launch Options, I've discovered something else. You can change the text language of the debug game (BF2_modtools_NoDVD).
  1. Right click on BF2_modtools_NoDVD.exe and create a shortcut
  2. Right click on the shortcut, and select properties
  3. Go to the Shortcut tab if it isn't already open
  4. In the target box, add /lang 3 (or whatever number you need) at the very end. Make sure you put it after the speech marks. So it becomes something like "C:\Program Files (x86)\Steam\steamapps\common\Star Wars Battlefront II Classic\GameData\BF2_modtools_NoDVD.exe" /lang 3
This works for the actual game exe too, but you need to make sure that the Steam Launch Options are empty first, otherwise they will overwrite the Launch Options from the shortcut. The debug game doesn't launch through Steam, and is not affected by the Steam Launch Options. Yet the /lang command still works on it, which is good to know.

EDIT 2: If you go to BF2_ModTools/data_ABC/Common/fonts, there are several .fff files in there which tell the game what font to use for different characters. The modtools have a tool to open/edit these files. Go to BF2_ModTools/ToolsFL/bin. There is a tool in there called FontEdit. Run FontEdit, then go to File > Open and navigate to one of the .fff files in your mod folder (I needed to tell the window to look for .fff, not .tga). This will open the font file in the editor. Use the arrow keys to move between each character and you'll see the fonts in the modtools (and presumably in the game) are only set up for the Latin alphabet, not Cyrillic or Japanese etc. If you wanted to hijack an existing language to support Chinese, I bet you could replace these .fff files with fonts that do contain Chinese characters (since the FontEdit tool let's you choose and save your own .fff), or attach Chinese characters to the end of the existing file. I haven't really played with it yet, but it's a start. There is a readme in the fonts folder that tells you what font the original game uses, but they're all custom made so I'm not sure how to get them. In FontEdit, if you go to Font > Capture it will only let you select fonts from your computer, but there's a box that lets you choose what script (character set) you want to add. Just try to keep them about the same size as the font you're overwriting. You can also search the fonts in your computer with the Show more fonts button in the Capture window (it's really good for checking what fonts support what languages). In my case, I can add Chinese Simplified characters from the Microsoft YaHei font. I don't know yet if this is enough to make Chinese characters appear in game. But this surely seems like it will be a required step. I assume this stuff gets munged into common.lvl. Then maybe it gets read by the addme along with the localization, or maybe it will require a more complicated mod.

EDIT 3: Nevermind, Chinese characters don't actually work in the FontEdit tool, they're just showing up as a ? You can get some basic Japanese characters this way though (along with lots of other alphabets). I don't know how else to make .fff font files since it's a BF2 specific file extension, so maybe a Chinese translation can't be done (without a very talented hex editor). Korean characters don't work either, nor does Kanji, so maybe it's not made for CJK. There's a unicode button that takes hours to test and it seems more promising. I want to try it with GNU unifont, but I won't be able to do that until later. If that doesn't work then nothing will.

EDIT 4: The unicode button is the buggiest thing in FontEdit. It might as well not be there to be honest. I've tested it with a font that's based on unicode and despite watching it cycle through every possible character during the capture, it doesn't actually use them. Regardless of what you select, the unicode button just gives you the Western Script after about an hour of waiting. Do not use.

If you use Capture normally, it works for these scripts: Western, Central European, Baltic, Turkish, Vietnamese, Cyrillic, Greek and Thai. It might work for Arabic and Hebrew but I'm so unfamiliar with those scripts that I can't tell if anything is missing. It doesn't work at all for Korean or Chinese. With Japanese, it will give you all the kana, but no kanji.

EDIT 5: I've now tried munging a font with Cyrillic characters and it definitely needs more work. I added the fonts to core.req (hoping it would replace the stock fonts). It did replace all the English letters in the menu and in the game. Or rather, it messed up the English letters. But at least it did something. I have a test unit localized with a Cyrillic name, and that still won't show up though; it's just blank. There's also a japanese.ciu file that looks important for this, but I'm not sure exactly what it's for or how it's used.

EDIT 6: Typing with a Russian keyboard on FontEdit isn't automatically jumping to the correct character (whereas typing in English jumps to the letter you've just typed). So I can't guarantee that it's mapping the symbols to the correct keys/code anyway. It would really take a hexeditor to figure out the .fff files. And I'm back to thinking it might take an engine mod if it needs to use a custom .ciu file (which looks like a list of integer unicode values in hex, it's hard to tell if it even has any file information).
If I just use the Font Edit to open a .fff file, it just displays a "A". And When I press a Key, the "A" will change to the letter which I press.
Sporadia
Corporal
Corporal
Posts: 151
Joined: Thu Jan 24, 2019 11:02 pm
Projects :: No Mod project currently
Games I'm Playing :: None
xbox live or psn: No gamertag set

Re: Help! I want to add a new language for the Original game

Post by Sporadia »

ZetaGundam wrote:
Sun Jan 02, 2022 8:33 am
If I just use the Font Edit to open a .fff file, it just displays a "A". And When I press a Key, the "A" will change to the letter which I press.
Yeah it does. You can also cycle between the different characters using the arrow keys. Although one of the problems I've noticed is that when you capture a font in a different script, then pressing letters on the keyboard doesn't work correctly. For example, I captured a font in the Cyrillic script. Then I switched my computer keyboard to Russian, but pressing each key wasn't jumping to the correct letter. But the letters were there when I cycled through them with the arrow keys. It also wasn't enough to get the Cyrillic characters to appear in game; I've given up trying to figure out how to do that.
ZetaGundam wrote:
Sun Jan 02, 2022 8:27 am
I still don' t know how to use the FontEdit. I Run FontEdit, then go to File > Open, then I select a .fff file in BF2_ModTools/data_ABC/Common/fonts. Then I click the Font>Unicode>Capture, choose Song style(宋体).
Then I don' t know how to do in next step. In fact I click the save to replace the .fff file which I open.
I really don't recommend selecting unicode because it takes a seriously long time and didn't seem to work anyway.
  1. Go to Font > Capture
  2. In the capture window, choose the Song style
  3. In the capture window, choose the Chinese script (probably Chinese Big5 or Chinese gb2312 since that's how Chinese characters are mapped most of the time.)
  4. Now capture
For most alphabets, this was enough to get the extra characters to appear in FontEdit, but for the Chinese characters it wasn't actually rendering them. It was just giving me a lot of substitute characters (eg ?). If it did work, then you could save over the .fff files and see what happens. You need to add the .fff files to core.req like this:

Code: Select all

REQN
{
    "font"
    "gamefont_large"
}
That definitely does replace the stock font files, but it still has problems. When I tried it, all the Western characters were replaced with random/incorrect ones. I had a test unit named in Cyrillic, but that didn't show up at all. I don't know how much of that is down to the FontEdit capture mapping the characters incorrectly (which I think is responsible for the Western Script using the wrong characters, and the Russian keyboard not jumping correctly in FontEdit). Or if there are actually more steps required to get new alphabets into the game. I feel like there are more steps required to get totally new alphabets into the game.

PS. Just to carry on the discussion on steam languages, setting the audio language to Spanish is actually downloading the English audio. The only languages which I can confirm have custom audio are English, French and German. Setting the text language with /lang works for them all, though.
ZetaGundam
Recruit Womprat Killer
Posts: 9
Joined: Fri Apr 16, 2021 10:38 am
Projects :: No Mod project currently.
Games I'm Playing :: SWBattlefrontII
xbox live or psn: No gamertag set

Re: Help! I want to add a new language for the Original game

Post by ZetaGundam »

Sporadia wrote:
Sun Jan 02, 2022 12:37 pm
ZetaGundam wrote:
Sun Jan 02, 2022 8:33 am
If I just use the Font Edit to open a .fff file, it just displays a "A". And When I press a Key, the "A" will change to the letter which I press.
Yeah it does. You can also cycle between the different characters using the arrow keys. Although one of the problems I've noticed is that when you capture a font in a different script, then pressing letters on the keyboard doesn't work correctly. For example, I captured a font in the Cyrillic script. Then I switched my computer keyboard to Russian, but pressing each key wasn't jumping to the correct letter. But the letters were there when I cycled through them with the arrow keys. It also wasn't enough to get the Cyrillic characters to appear in game; I've given up trying to figure out how to do that.
ZetaGundam wrote:
Sun Jan 02, 2022 8:27 am
I still don' t know how to use the FontEdit. I Run FontEdit, then go to File > Open, then I select a .fff file in BF2_ModTools/data_ABC/Common/fonts. Then I click the Font>Unicode>Capture, choose Song style(宋体).
Then I don' t know how to do in next step. In fact I click the save to replace the .fff file which I open.
I really don't recommend selecting unicode because it takes a seriously long time and didn't seem to work anyway.
  1. Go to Font > Capture
  2. In the capture window, choose the Song style
  3. In the capture window, choose the Chinese script (probably Chinese Big5 or Chinese gb2312 since that's how Chinese characters are mapped most of the time.)
  4. Now capture
For most alphabets, this was enough to get the extra characters to appear in FontEdit, but for the Chinese characters it wasn't actually rendering them. It was just giving me a lot of substitute characters (eg ?). If it did work, then you could save over the .fff files and see what happens. You need to add the .fff files to core.req like this:

Code: Select all

REQN
{
    "font"
    "gamefont_large"
}
That definitely does replace the stock font files, but it still has problems. When I tried it, all the Western characters were replaced with random/incorrect ones. I had a test unit named in Cyrillic, but that didn't show up at all. I don't know how much of that is down to the FontEdit capture mapping the characters incorrectly (which I think is responsible for the Western Script using the wrong characters, and the Russian keyboard not jumping correctly in FontEdit). Or if there are actually more steps required to get new alphabets into the game. I feel like there are more steps required to get totally new alphabets into the game.

PS. Just to carry on the discussion on steam languages, setting the audio language to Spanish is actually downloading the English audio. The only languages which I can confirm have custom audio are English, French and German. Setting the text language with /lang works for them all, though.
Can this step can make the debug program BF2_modtools_NoDVD.exe support the Chinese characters?
In fact, although the editlocalize.bat has Japanese text, I Don't know how to setting the game to Japanese. I need to do this in order to prove the game can display Chinese correctly.
I want to know how to use editlocalize.bat ? The program just let me save a .cfg file after edit the text.
Post Reply