Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCUMM: Fix Sophia speaking with Indy's voice when looking at him #4139

Conversation

dwatteau
Copy link
Contributor

Context

In Indy 4, you can play as Sophia in some scenes (for example, in the Azores).

But if you look at Indy with her, she'll speak with Indy's voice, in the Talkie version.

The culprit seems to be script 68-161:

(48) if (Var[181] == 2) {
(42)   chainScript(162,[]);
(48) } else if (Var[181] == 11) {
(48)   if (VAR_EGO == 2) {
(D8)     printEgo([Text(sound(0x865362C, 0xA) + "No thanks.")]);
(18)   } else {
(D8)     printEgo([Text(sound(0x8638E5D, 0xE) + "There's nothing to look at.")]);
(**)   }
(18) } else {
       # Here:
(D8)   printEgo([Text(sound(0x8638E5D, 0xE) + "There's nothing to look at.")]);
(**) }
(A0) stopObjectCode();
END

I'm not sure what Var[181] is, but when using the "Look at" verb, we reach the last else block. But this default case uses the same sample for Indy and Sophia, hence the wrong voice when playing with Sophia…

Proposed workaround

Fortunately, script 68-4 has a dub for the exact same line, with Sophia's voice.

So I just reuse its audio content if _actorToPrintStrFor is 2 (= playing as Sophia) in this scene, and if the current dialogue line points to the audio offset that we expect. I'm not changing the text itself.

AFAIK, there's only a single, identical MONSTER.SOU file for all talkie ports of this game (DOS, Macintosh, FM-TOWNS), but checking the audio offset is still safer, especially for fan translations or any eventual fandub or unknown version of the game.

How to test

  1. Play any talkie version, start the game with boot param 6005, use Esc to skip the fake intro
  2. Talk to Sophia, ask her to take the lead (opt. 2)
  3. As Sophia, use the "Look at" verb on Indy
  4. She should now speak with her own voice

(I've tested the DOS/English version from GOG, my old Macintosh/English CD, and a French fan translation)

@eriktorbjorn
Copy link
Member

I assume this will try to apply to the patch to the Amiga version as well, but I guess that won't make any difference since it should never find the offending string?

@dwatteau
Copy link
Contributor Author

dwatteau commented Jul 28, 2022

I assume this will try to apply to the patch to the Amiga version as well, but I guess that won't make any difference since it should never find the offending string?

I don't have this version, but I thought it would always have the Floppy variant (which I'm excluding), looking at this:
https://github.com/scummvm/scummvm/blob/branch-2-6/devtools/scumm-md5.txt#L283

But otherwise yeah, I try to write my workarounds so that they're loose-enough to be applied on translations (incl. fan translations) and other variants when it's possible, while keeping some safety checks if I rely on some hardcoded values.

@eriktorbjorn
Copy link
Member

I don't have it either, I just looked at this bit of detection_tables.h, quite possibly misreading it:

	{"atlantis", "Floppy", 0, GID_INDY4,    5, 0, MDT_PCSPK | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, UNK, GUIO2(GUIO_NOSPEECH, GUIO_ENHANCEMENTS)},
	{"atlantis", "Amiga", 0, GID_INDY4,  5, 0, MDT_AMIGA, 0, Common::kPlatformAmiga, GUIO3(GUIO_NOSPEECH, GUIO_MIDIAMIGA, GUIO_ENHANCEMENTS)},

1 similar comment
@eriktorbjorn
Copy link
Member

I don't have it either, I just looked at this bit of detection_tables.h, quite possibly misreading it:

	{"atlantis", "Floppy", 0, GID_INDY4,    5, 0, MDT_PCSPK | MDT_ADLIB | MDT_MIDI | MDT_PREFER_MT32, 0, UNK, GUIO2(GUIO_NOSPEECH, GUIO_ENHANCEMENTS)},
	{"atlantis", "Amiga", 0, GID_INDY4,  5, 0, MDT_AMIGA, 0, Common::kPlatformAmiga, GUIO3(GUIO_NOSPEECH, GUIO_MIDIAMIGA, GUIO_ENHANCEMENTS)},

@dwatteau
Copy link
Contributor Author

Ah yes indeed, Floppy is in the description field and not the variant field, for the Amiga version of Monkey 2, my bad.

I'll just explicitly exclude the Amiga version in my check, better safe than sorry!

Thanks for noticing this.

When playing as Sophia in some scenes (such as in the Azores), using the
`Look at` verb on Indy would make her speak with Indy's voice, because
the script triggering this sentence for this verb didn't check or
include a line for the case when VAR_EGO is Sophia.

Fortunately, a different script does have this exact same line dubbed
for Sophia, so we can reuse it, as long as the audio offsets have the
values that we expect (and I'm only aware of a single MONSTER.SOU file
for this title, always in English and identical on all ports).
@dwatteau dwatteau force-pushed the fix/scumm-indy4-sophia-look-at-indy-wrong-voice branch from b2c3bcf to 675db0c Compare July 28, 2022 19:17
@bluegr
Copy link
Member

bluegr commented Aug 4, 2022

Nice work, thanks! Merging

@bluegr bluegr merged commit 63a5010 into scummvm:master Aug 4, 2022
@dwatteau dwatteau deleted the fix/scumm-indy4-sophia-look-at-indy-wrong-voice branch August 5, 2022 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants