Opened 3 hours ago

Last modified 45 minutes ago

#15514 new defect

SCI: KQ5CD Issue with the audio when adding text dialogues multilingual

Reported by: LaZar00 Owned by:
Priority: normal Component: Engine: SCI
Version: Keywords:
Cc: LaZar00 Game: King's Quest 5

Description

ScummVM Version: any (tested with 2.0.0 (GOG version of KQ5 CD), 2.1.0, 2.8.1)

Game/Language: KQ5 CD Talkie English (GOG version)

OS: PC Windows 11

Bug:
I decided open this ticket to report a strange behaviour in King's Quest V CD Talkie english version under ScummVM.

This version has NOT dialogue boxes for spoken dialogue in game. I decided to do add them modifying the code with SCI Companion 3.0.1.7. I had success adding them and show the dialogues with the audio and it works well in ScummVM and DosBox (for one unique language).

Ok, now here comes the issue and the reason I decided to open the ticket.

I added the feature to show multilingual text (in my case English/Spanish). This feature works for example when we have a string like "{Hello#SHola}", and when selecting the language (lang=en or lang=es) scummvm should show "Hello" for english and "Hola" for spanish.

Ok, what I have done for make this possible? I have added into Main.sc the properties for parseLang and printLang to 34. I have also a switch in "about" window for change among language 1 (english) and language 34 (spanish).
Using this method, this DOES NOT work in ScummVM, BUT, surprisingly, it WORKS in DosBox. I can change the language and I can see the texts with the language specified in printLang y parseLang when set in Main.sc.

So, this is a big difference between how sci engine works in DosBox and how it works ScummVM (at least for this specific game).

I think that somehow, in this game specifically [KQ5 CD Talkie english], the language is set by DoAudio kernel function (in scummvm). So, if we use another language, it looks for that audio, and as it does not exists, does not makes the change. But what scummvm should do is use the default language (english) as it does commonly with the texts.

Do you think you could apply this to ScummVM? To make the sci engine work as in DosBox?

If you have any further questions don't hesitate to ask. And sorry for my english, I'm not native english speaker.

Attachments (1)

kq5cd-DoAudioSetLanguage.jpg (146.7 KB ) - added by m-kiewitz 99 minutes ago.
kq5 cd kDoAudio / Language disassembly

Download all attachments as: .zip

Change History (4)

comment:1 by m-kiewitz, 100 minutes ago

I just checked disassembly of the KQ5-CD SCI interpreter version.

It tries to load the audio-resource-map (AUDIOxxx.MAP). If it fails, it reverts TO THE PREVIOUS language and loads that (again).

It also defaults to language 1 (US English) on startup.

It also returns the audio language that was successfully set in acc.

Last edited 99 minutes ago by m-kiewitz (previous) (diff)

by m-kiewitz, 99 minutes ago

kq5 cd kDoAudio / Language disassembly

comment:2 by m-kiewitz, 85 minutes ago

Summary: [KQ5 CD] Issue with the audio when adding text dialogues multilingualSCI: KQ5CD Issue with the audio when adding text dialogues multilingual

comment:3 by sluicebox, 45 minutes ago

¡Hola, LaZar00!

That's impressive that you're making a KQ5CD mod with text and speech *and* in Spanish. Can it display text while playing speech at the same time?

I agree that you should be able to toggle between English and Spanish text with KQ5:printLang while separately controlling which audio files to use with kDoAudio \ kSciAudioLanguage. You've figured out a lot!

While the KQ5CD interpreter code for this is straightforward (Thanks, Martin!), our code is trickier because of all the versions it supports. I am cautious about making changes there, so I think we need a test case so that we can make sure we're fixing this for you while not breaking anything else.

I will try to manually recreate the scripts you've described (decompile, alter, recompile), but if that doesn't work, I may ask you to privately share your mod so I can make the right adjustment.

Note: See TracTickets for help on using tickets.