Pyrdacor / Ambermoon

Resources for the incredible Amiga game Ambermoon
92 stars 10 forks source link

Translation #94

Open galon3 opened 1 year ago

galon3 commented 1 year ago

Hi I wanted to try translation, but I have a problem with the tools.

Tools v1.12, Amiga versions 1.18

d:\GAMES\AmbermoonTools-Windows>ambermoontextimport -e "d:\GAMES\Amiga\Dyski\dh0\AMBERM\Amberfiles" Text.amb "d:\GAMES\Ambertekst" Reading texts from sub-file 1 ... failed Unable to read text data.

So I tried importing from EnglishTextOutput1.14.7z (after unpacking)

d:\GAMES\AmbermoonTools-Windows>ambermoontextimport -i "d:\GAMES\Amiga\Dyski\dh0\AMBERM\Amberfiles" Text.amb "d:\GAMES\Ambertekst" Looking for text data in 'd:\GAMES\Ambertekst\Text.amb' ... failed No text files with the right names exist so the resulting data file will be empty! Do you want to continue (Y/N)? n No text files found.

What am I doing wrong? And one more question. Does the font used in the game have Polish characters (ąćęłóńśżź)? Thanks for your work.

Pyrdacor commented 1 year ago

Sorry I forgot to update the tools. There is a new tool which eases text export and import. I will try to provide the tool as soon as possible. But I am not home right now.

The game has no polish characters unfortunately. For the remake I could add them. For the Amiga version we might use replacements like s for ś etc or create a new glyph mapping etc. I can work on that in the future. Make sure to use the polish characters in the texts anyway. In worst case I can adjust the tools to replace those characters with replacements for Amiga but support the right characters in the remake.

If you would use replacements like s in the translations it would be much harder to replace them by the right polish characters later.

galon3 commented 1 year ago

Thanks for the information. No rush, using the Amiga version and tools I wanted to see if it would work. Now that I know it can be done, I'll look into the texts in the Ambermoon/Translations/ directory. Is it possible to merge the text from Ambermoon-Advanced/english with them? Or is it better to keep them separate? Greetings

Pyrdacor commented 1 year ago

I would not merge them as some texts were changed or extended and thus you won't have the correct texts in the normal version anymore. So keep them separate.

Pyrdacor commented 1 year ago

I updated the tools. There is version 1.14 now available which includes the tool AmbermoonTextManager. Please give it a try.

galon3 commented 1 year ago

Thanks for the new tool, but I continue to have problems with it. All _data files generate an error, dict gives an empty result (I tested them one by one). d:\GAMES\AmbermoonTools-Windows>AmbermoonTextManager -e "d:\GAMES\Amiga\Dyski\dh0\AMBERM\Amberfiles" "d:\GAMES\Ambertekst" Writing 0 dictionary entries. Writing all texts from Text.amb. Unhandled exception. System.IO.EndOfStreamException: Read beyond the data size. at Ambermoon.Data.Legacy.Serialization.DataReader.CheckOutOfRange(Int32 sizeToRead) at Ambermoon.Data.Legacy.Serialization.DataReader.ReadWord() at Ambermoon.Data.Legacy.Serialization.PlacesReader.ReadPlaces(Places places, IDataReader dataReader) at Ambermoon.Data.Places.Load(IPlacesReader placesReader, IDataReader dataReader) at AmbermoonTextImport.Program.Export(String gameDataPath, String outputPath, List1 options, List1 files) at AmbermoonTextImport.Program.Main(String[] args) amber I packed the translated Text.amb and it works, (the program itself substituted Polish characters).

Pyrdacor commented 1 year ago

Can you send me the Amberfiles directory (zipped) that you are using with the tool? Or attach it here if you like.

I will have a look at it tomorrow then.

Nice to see Polish texts in Ambermoon already!

Pyrdacor commented 1 year ago

Can you try v1.15?

galon3 commented 1 year ago

No, I will be home on Sundays, then I will check other versions.

śr., 7 cze 2023 o 15:09 Pyrdacor @.***> napisał(a):

Can you try v1.15?

— Reply to this email directly, view it on GitHub https://github.com/Pyrdacor/Ambermoon/issues/94#issuecomment-1580782758, or unsubscribe https://github.com/notifications/unsubscribe-auth/BAJF5EQRUQ4AGOFKP4GMFA3XKB4O3ANCNFSM6AAAAAAYZFSOFQ . You are receiving this because you authored the thread.Message ID: @.***>

galon3 commented 1 year ago

Export works, import generates an error: Reading all texts from Text.amb. Looking for text data in 'd:\test\tekst\Text.amb\Messages' ... done Looking for text data in 'd:\test\tekst\Text.amb\WorldNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\FormatMessages' ... done Looking for text data in 'd:\test\tekst\Text.amb\AutomapTypeNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\OptionNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\MusicNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\SpellClassNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\SpellNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\LanguageNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\ClassNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\RaceNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\SkillNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\AttributeNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\SkillShortNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\AttributeShortNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\ItemTypeNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\ConditionNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\UITexts' ... done Looking for text data in 'd:\test\tekst\Text.amb\DateAndLanguageString' ... done Looking for text data in 'd:\test\tekst\Text.amb\VersionString' ... done Looking for text data in 'd:\test\tekst\Monster_char.amb' ... failed

ambermoon_english_1.18_extracted.zip has German files in the folder 3Map_data.amb\343\

Pyrdacor commented 1 year ago

Ok thanks. I will check on that next week.

Pyrdacor commented 1 year ago

Should work now with 1.16

galon3 commented 1 year ago

Export works, import generates an error: d:\GAMES\AmbermoonTools-Windows>AmbermoonTextManager -i "d:\test\Amberfiles" "d:\test\tekst" Looking for text data in 'd:\test\tekst\Dict.amb' ... done Reading all texts from Text.amb. Looking for text data in 'd:\test\tekst\Text.amb\Messages' ... done Looking for text data in 'd:\test\tekst\Text.amb\WorldNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\FormatMessages' ... done Looking for text data in 'd:\test\tekst\Text.amb\AutomapTypeNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\OptionNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\MusicNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\SpellClassNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\SpellNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\LanguageNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\ClassNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\RaceNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\SkillNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\AttributeNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\SkillShortNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\AttributeShortNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\ItemTypeNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\ConditionNames' ... done Looking for text data in 'd:\test\tekst\Text.amb\UITexts' ... done Looking for text data in 'd:\test\tekst\Text.amb\DateAndLanguageString' ... done Looking for text data in 'd:\test\tekst\Text.amb\VersionString' ... done Looking for text data in 'd:\test\tekst\Monster_char.amb' ... done Looking for text data in 'd:\test\tekst\Save.00/Party_char.amb' ... done Looking for text data in 'd:\test\tekst\NPC_char.amb' ... done Looking for text data in 'd:\test\tekst\Place_data' ... done Looking for text data in 'd:\test\tekst\Objects.amb' ... done Looking for text data in 'd:\test\tekst\2Map_data.amb\263' ... done Looking for text data in 'd:\test\tekst\2Map_data.amb\265' ... done Looking for text data in 'd:\test\tekst\2Map_data.amb\285' ... done Looking for text data in 'd:\test\tekst\2Map_data.amb\416' ... done Looking for text data in 'd:\test\tekst\2Map_data.amb\420' ... done Looking for text data in 'd:\test\tekst\2Map_data.amb\425' ... done Looking for text data in 'd:\test\tekst\2Map_data.amb\441' ... done failed

I have about 40% of the translation finished and one question for now. Some messages start with "'s" . Won't it cause problems to replace this string with ","? As I understand, a name will be inserted at the beginning of the message. The English message "Thalion's attack failed!" in Polish should become "Atak Thaliona zawiódł!" or less elegantly, but still grammatically correct "Thalion, atak zawiódł!" ("Thalion, the attack failed!").

Pyrdacor commented 1 year ago

Strange error. It worked for me. Do you extract the English data?

It is no problem to use a ',' as long as the result is valid. As you said, the name is inserted before. The comma is a valid character, so this should be fine. Unfortunately you can't change the order of the words that easy. For example place the name somewhere else.

galon3 commented 1 year ago

I tried with different versions (english), 1.18, 1.19, Advanced 1.03. They extract, but when trying to pack back an error. I tried to pack the translated files, also got an error, although different: Looking for text data in 'd:\test\tekst\Monster_char.amb' ... Failed to load game data: The given key 'AM2_CPU' was not present in the dictionary. I attach the packed translation (as much as I finished), if you find some time try to pack them, I could start testing if there are any big errors Ambertekst pl.zip

a1exh commented 1 year ago

Could it be that some translated text has exceeded maximum number of characters?


From: galon3 @.> Sent: 13 June 2023 20:11 To: Pyrdacor/Ambermoon @.> Cc: Subscribed @.***> Subject: Re: [Pyrdacor/Ambermoon] Translation (Issue #94)

I tried with different versions (english), 1.18, 1.19, Advanced 1.03. They extract, but when trying to pack back an error. I tried to pack the translated files, also got an error, although different: Looking for text data in 'd:\test\tekst\Monster_char.amb' ... Failed to load game data: The given key 'AM2_CPU' was not present in the dictionary. I attach the packed translation (as much as I finished), if you find some time try to pack them, I could start testing if there are any big errors Ambertekst pl.ziphttps://github.com/Pyrdacor/Ambermoon/files/11738300/Ambertekst.pl.zip

— Reply to this email directly, view it on GitHubhttps://github.com/Pyrdacor/Ambermoon/issues/94#issuecomment-1589878439, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGBFP7DDTYGEPARYKLFZH33XLC3N3ANCNFSM6AAAAAAYZFSOFQ. You are receiving this because you are subscribed to this thread.Message ID: @.***>

Pyrdacor commented 1 year ago

Well the second error is just about tooling. It will be gone if you add all the other files like AM2_CPU etc to the folder. There is a general routine to load game data which loads all the files of the game. This is used in the tool to patch the texts in an easier way. I think I have to refactor this so only the text-related files are needed.

For the other error I have to investigate. Hopefully find the time for it today.

Pyrdacor commented 1 year ago

Version 1.17 should fix the remaining issues hopefully. You also won't have to provide all the files like AM2_CPU anymore. You can even skip some text-related files. In this case a warning is shown. Let me know if it works.

galon3 commented 1 year ago

Thanks, I finally managed to pack all the files. At the moment the errors appear only in certain cases: Amberfiles empty or missing files Looking for text data in 'd:\test\tekst\Monster_char.amb' ... Failed to load game data: Object reference not set to an instance of an object. missing file to be packed Unhandled exception. System.IO.DirectoryNotFoundException: Could not find a part of the path 'd:\test\tekst\2Map_data.amb'. at System.IO.Enumeration.FileSystemEnumerator1.CreateDirectoryHandle(String path, Boolean ignoreNotFound) at System.IO.Enumeration.FileSystemEnumerator1.Init() at System.IO.Enumeration.FileSystemEnumerable1..ctor(String directory, FindTransform transform, EnumerationOptions options, Boolean isNormalized) at System.IO.Enumeration.FileSystemEnumerableFactory.UserDirectories(String directory, String expression, EnumerationOptions options) at System.IO.Directory.InternalEnumeratePaths(String path, String searchPattern, SearchTarget searchTarget, EnumerationOptions options) at System.IO.Directory.GetDirectories(String path, String searchPattern, EnumerationOptions enumerationOptions) at AmbermoonTextImport.Program.<>cDisplayClass11_0.gProcessFiles|8(String containerFile, Func`2 processor, Boolean zeroBased, Boolean withMultipleTextsForSubFiles) at AmbermoonTextImport.Program.<>cDisplayClass11_0.gProcessAndWriteFiles|7(String containerFile, Func2 processor, Boolean zeroBased, Boolean withMultipleTextsForSubFiles) at AmbermoonTextImport.Program.<>c__DisplayClass11_0.<Import>g__ReadGotoPointNames|12(String filename) at AmbermoonTextImport.Program.<>c__DisplayClass11_0.<Import>g__CheckAndRead|13(String file, Action1 reader) at AmbermoonTextImport.Program.Import(String gameDataPath, String inputPath, List1 options, List1 files) at AmbermoonTextImport.Program.Main(String[] args)`

yottayuan commented 7 months ago

Version 1.17 should fix the remaining issues hopefully. You also won't have to provide all the files like AM2_CPU anymore. You can even skip some text-related files. In this case a warning is shown. Let me know if it works.

Hello, I want to translate Ambermoon into Chinese. I know you have limited time. Could you please describe more about the instructions related to translation in the readme? I tried to translate it, but I don't know how to replace it into the game. For example, how to unpack it at the beginning, how to package it, how to replace it into the current project, etc. After reading the related projects and files, the description is too scattered, and now I have no clue.

Pyrdacor commented 7 months ago

Hi. I am on a vacation right now. Is it ok if I help you from 15th of April onwards when I am back? Please remind me again then if I am not responding. I will help you with all the details then.

yottayuan commented 7 months ago

Hi. I am on a vacation right now. Is it ok if I help you from 15th of April onwards when I am back? Please remind me again then if I am not responding. I will help you with all the details then.

Thank you for your reply, Pyrdacor. Just according to your time. I'm not in a hurry。

Pyrdacor commented 6 months ago

Sorry for the late reply. Chinese will be pretty tricky to be honest. The original Amiga game uses a limited amount of glyphs (around 100 currently) which includes letters, numbers and symbols. Moreover you have runes which encode letters. Not sure if this is even possible in Chinese. As far as my Chinese knowledge is, every Chinese symbol represents a word.

The next problem is that the normal font has a size of 5x6 pixels per glyph. You won't be able to display Chinese with it. So I guess it is impossible for the original game.

For the remake we have a few more options. For languages with diacritics like french I already increased the glyph size to 10x12 (double size, half pixel resolution). This is still not enough for Chinese but maybe I could extend it further which means a bit effort on my end.

I only want to make sure it is technically possible so you won't waste time translating and we can't integrate it into the game later.

As there are quite many Chinese symbols, we would need some large mapping table from letter to glyph.

I would suggest we start with some example texts and I try to render the glyphs in the remake somehow.

But to be honest, my time is currently (and actually since almost 4 years) very limited and my to-do list is huge. But I also need some side tasks to keep me motivated.

But honestly speaking, adding Chinese seems to be a huge effort and I am not even sure if we can make it. Which does not mean that I don't want to try it. ;)

So if you are patient, we can try to approach this step by step and I will try to find some time to investigate the Chinese language integration from a technical perspective.

yottayuan commented 6 months ago

English To Chinese,such as: Grandpa -> 爷爷 I'm also a C# programmer, and now I'm learning your project. It'll be a long way for me, because I have two kids, time is also limited. Could you please describe more about the instructions related to translation in the readme? such as how to translate english to french? I really want to know the details。

a1exh commented 6 months ago

Thanks to the work of Pyradcor it is much easier to translate the game because all text have been extracted and now live in their own files.

Start here :

https://github.com/Pyrdacor/Ambermoon/tree/master/Disks/Bugfixing

You'll see separate directories for English, German, French, Polish and Czech.

Inside each is a directory called "AllTexts" and inside subdirectories corresponding to the original filenames, sub-file and sub-msg.

Embedded within each text string there can be markup which is described briefly in the translation readme.

https://github.com/Pyrdacor/Ambermoon/tree/master/Translations

Pyrdacor commented 6 months ago

Yeah basically what Alex said. The linked readme should be sufficient to translate the intro, the extro and all other remake-related texts.

Beside that you need to translate all other in-game texts. You can just use the English texts in https://github.com/Pyrdacor/Ambermoon/tree/master/Disks/Bugfixing/English/AllTexts and translate them all to do so. The problem is that those texts are stored in the original Ambermoon container format and it expects an encoding which has only one byte per character. It has no support for multibyte character sets.

However you won't be able to test your translations in-game until I support Chinese glyphs. This is what I meant in my previous message. You can translate everything, but you will need glyph graphics, a mapping from letters/words to glyphs and some other stuff. And the current formats won't even allow more than 225 characters/symbols in total.

I doubt that we can ever support Chinese for the Amiga version. For the remake it might work. But it will be some effort and most likely involves a new text container format. The latter is not a problem per se. I also invented a new text container for intro and extro texts for the polish and czech versions. So this can be done with some effort. But of course remake-only then.

If you are interested in the technical part we can talk about it of course.