Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#5796 closed defect (fixed)

SCI: User-translated files are ignored

Reported by: SF/tinekefrineke Owned by: bluegr
Priority: normal Component: Engine: SCI
Keywords: Cc:
Game: Quest for Glory 3

Description

For Quest for Glory III I translated some text (message) files in Dutch using SCIamano. Previously I did this for ScummVM with QFG I which worked fine, and when running QFG III in DosBox the translations are used, but not for ScummVM with QFG III.

I downloaded the code, located the problem, fixed it for my kids for Windows. The bug is in the resource.cpp, in the code where firstly ResourceManager::readResourceMapSCI0(...) is called and then ResourceManager::readResourceMapSCI1(...). Firstly resource.000 is read, and the translated message files are accepted. But then ResourceManager::readResourceMapSCI1(...) destroys the results by overwriting them with some data? patches? or so. This happens in the location where someone added a fix for pharkas/german. I made a working ScummVM for myself by removing these lines, but obviously this is no correct fix, now the original problem re-occurs.

Maybe the problem is a shortcoming of SCIamano, which detects no resources in the resource.map to extract, but as the original SCI-engine has no problems with the translated files, I submit this as a bug.

I found the problem in ScummVM 1.2.1, but it is still present in the current archive (1.3, I believe).

Ticket imported from: #3366295. Ticket imported from: bugs/5796.

Attachments (8)

resource.cpp (69.4 KB ) - added by SF/tinekefrineke 8 years ago.
Fixed file
resource-1.2.1.cpp (69.3 KB ) - added by digitall 8 years ago.
Original File as per v1.2.1
diff-against-v1.2.1.patch (2.9 KB ) - added by digitall 8 years ago.
Patch created against v1.2.1
current-git.patch (635 bytes ) - added by digitall 8 years ago.
Equivalent Patch For Current Git Master
102.msg (13.9 KB ) - added by SF/tinekefrineke 8 years ago.
Translated file
150.msg (4.5 KB ) - added by SF/tinekefrineke 8 years ago.
Translated file
230.msg (22.7 KB ) - added by SF/tinekefrineke 8 years ago.
Translated file
240.msg (60.1 KB ) - added by SF/tinekefrineke 8 years ago.
Translated file

Download all attachments as: .zip

Change History (19)

by SF/tinekefrineke, 8 years ago

Attachment: resource.cpp added

Fixed file

comment:1 by wjp, 8 years ago

Priority: normallow
Summary: Translated files are ignoredSCI: User-translated files are ignored

comment:2 by wjp, 8 years ago

Which form do your translated files take? Are they patch files? (I see your file mentions 73.msg?)

For future reference: the attached resource.cpp seems based on the v1.2.1 one.

comment:3 by digitall, 8 years ago

I have differenced the attached resource.cpp against the engines/sci/resource.cpp from v1.2.1 release.
Will attach this.

This contains a number of spurious differences, including some (including the 73.msg) which have no effect as far as I can see.

The only "active" change I can see here is to comment out the last part of the function: ResourceManager::readResourceMapSCI1(ResourceSource *map)
This function contains a FIXME preceding this change which indicates that the function has issues in selection of the correct resource when multiple copies of a resource are present.

comment:4 by digitall, 8 years ago

FYI, the translation tools referred to in the bug and one of the language patches can be found from these links:
http://erolfi.wordpress.com/tradusci/
http://gkpatches.vogons.zetafleet.com/

by digitall, 8 years ago

Attachment: resource-1.2.1.cpp added

Original File as per v1.2.1

by digitall, 8 years ago

Attachment: diff-against-v1.2.1.patch added

Patch created against v1.2.1

comment:5 by digitall, 8 years ago

Checked latest Git Master. The FIXME has been removed/corrected, but this code is still the same otherwise.
Attaching patch for latest Git master which should be functionally identical to previous patch.

by digitall, 8 years ago

Attachment: current-git.patch added

Equivalent Patch For Current Git Master

comment:6 by digitall, 8 years ago

Ah, rereading the original report..

So the issue is that QFG3 if translated by SCIamano works fine in the original interpreter, but with ScummVM SCI, this reverts to original language... probably due to later loading of patch file, or a different resource loading order?

comment:7 by SF/tinekefrineke, 8 years ago

Indeed. From the source code I understood that several resource files and their patches are read in the order resource 1 - patch 1 - resource 2 - patch 2. I use the SCIamano tool to extract the text (.msg) files as patches, then I translate them and place them in the game directory. I have no means of detecting which resource these extracted texts come from. The scummvm engine decides that my msg-file is a patch for the first resource file, and that the second resource file should replace this, because it also contains the same text data. As far as I know, it might even be correct, I don't know anything about the Sierra data structure. I suspect that sierra first loads all the resources, and then the patches, so this is a difference in order of processing.
(Sorry for the delay, holidays...)

comment:8 by bluegr, 8 years ago

Some questions:
- Are these patches you made external files, or have you changed the resource.* game files?
- Can you provide a patch to perform some tests with your translations?

As for the FIXME, it has been removed because it no longer applies

by SF/tinekefrineke, 8 years ago

Attachment: 102.msg added

Translated file

by SF/tinekefrineke, 8 years ago

Attachment: 150.msg added

Translated file

by SF/tinekefrineke, 8 years ago

Attachment: 230.msg added

Translated file

by SF/tinekefrineke, 8 years ago

Attachment: 240.msg added

Translated file

comment:9 by SF/tinekefrineke, 8 years ago

I attached four translated files, I place them in the directory with my other resources. One of them is quite near the beginning of the game, where the hero enters the market place and meets "Sanford and Son".

Sorry, I don't know what a FIXME is?

comment:10 by bluegr, 8 years ago

Fixed in rc9873da

Thanks to both tinekefrineke and tdhs for pinpointing the actual problem in the resource manager

comment:11 by bluegr, 8 years ago

Owner: set to bluegr
Priority: lownormal
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.