Menu

#5172 SCI: QFG3: Crash in conversation

closed-fixed
5
2012-10-07
2010-08-06
No

Quest for Glory 3 (Dos/English)
ScummVM 1.2.0 51782
Windows 7 x64

When talking to Uhura in the village after using the dispel potion on the leopard-woman, if you choose the question about "Woo", the game will crash. No other dialogue will. It's not terribly critical, but it was kind of surprising. Crashes with the message:
"[VM]kMemory: signature mismatch via method ::export 6 (script 999, room 440, localCall 0xffffffff)!"

Discussion

  • Ethan Sherr-Ziarko

    • milestone: 1192551 --> SCI: Quest for Glory 3
     
  • Filippos Karapetis

    Um, the save game says "qfg1:, is that for qfg3?

     
  • Ethan Sherr-Ziarko

    Whoops >< fixed.

     
  • Filippos Karapetis

    That save game is when you're about to be judged... perhaps it's a different one?

     
  • Ethan Sherr-Ziarko

    Geh, sorry. I guess they're numbered a bit differently than I thought. Made a new save, this one should be the right one at last.

     
  • Ethan Sherr-Ziarko

    the right one

     
  • M. Kiewitz

    M. Kiewitz - 2010-08-10

    Could you please check what sierra sci is doing in that case? Maybe its a gamebug. I would try to patch it in that case. Otherwise we need to figure out whats going wrong.

     
  • M. Kiewitz

    M. Kiewitz - 2010-08-10
    • assigned_to: nobody --> m_kiewitz
    • status: open --> pending
     
  • Ethan Sherr-Ziarko

    Can't seem to reproduce this in dosbox. You might also be interested to know that the character saves generated by ScummVM don't work in the original interpreter.

     
  • Ethan Sherr-Ziarko

    • status: pending --> open
     
  • M. Kiewitz

    M. Kiewitz - 2010-08-10

    The saves are of course not compatible. The only save-files, that can be used from sierra sci are the export-character files from quest for glory series.

     
  • Ethan Sherr-Ziarko

    I was talking about the character exports :)

    I guess they are only compatible SCI -> ScummVM, not the other way around.

     
  • M. Kiewitz

    M. Kiewitz - 2010-08-11

    ScummVM export files are compressed (like all ScummVM created files are). If you uncompress them, they work just fine in sierra sci.

     
  • Filippos Karapetis

    I tried fixing this call, but then the game crashes later on anyway in other places. This looks like some sort of buggy script, so we should better patch it or ignore all of its incorrect calls

     
  • Filippos Karapetis

    • assigned_to: m_kiewitz --> nobody
     
  • Filippos Karapetis

    Fixed in r4766774, it was a script bug which made it loop indefinitely, thereby reading garbage data and crashing

     
  • Filippos Karapetis

    • assigned_to: nobody --> thebluegr
    • labels: 415217 --> Script bugs
    • status: open --> closed-fixed
     
  • Filippos Karapetis

    Reopening this, as this script patch caused a nasty bug in another conversation in the game (bug #3377429).

    Here's the problematic patch, for reference:

    // Script 23 in QFG3 has a typo/bug which makes it loop endlessly and
    // read garbage. Fixes bug #3040722.
    const byte qfg3DialogCrash[] = {
    5,
    0x34, 0xe7, 0x03, // ldi 3e7 (999)
    0x22, // lt?
    0x33, // jmp [back] ---> BUG! Infinite loop
    0
    };

    const uint16 qfg3PatchDialogCrash[] = {
    0x34, 0xe7, 0x03, // ldi 3e7 (999)
    0x22, // lt?
    0x31, // bnt [back]
    PATCH_END
    };

     
  • Filippos Karapetis

    • assigned_to: thebluegr --> nobody
    • status: closed-fixed --> open
     
  • Filippos Karapetis

    • summary: QFG3: Crash in conversation --> SCI: QFG3: Crash in conversation
     
  • Willem Jan Palenstijn

    This is very likely a script bug.

    When I tried in the original, saying "Woo" worked without a crash, but afterwards I couldn't speak to Uhura again.

    I looked at the relevant script, and it seems the Teller script object works with lists of options/subconversations in uhuraTeller::arrays (The current one is uhuraTeller::curArray). Each array is a list of integers corresponding to conversation options. When such an integer is negative, it is interpreted as an option with a submenu (and its absolute value is the message number for the option). The array uhuraTeller::keys contain the conversation options that trigger each array in uhuraTeller::arrays.

    (So keys[1] is the conversation option leading to opening the subconversation in arrays[1].)

    The problem here is that the option for "Woo" is -75, but there is no -75 in uhuraTeller::keys, so it runs out of bounds while trying to locate it. [ SSCI most likely found it somewhere later in memory and then set uhuraTeller::curArray to some bogus value, breaking conversation. ]

    A fix would be changing this -75 to +75 in the locals of script 440.

     
  • Willem Jan Palenstijn

    One complication is that -75 is also the trigger for some puzzle points, and this is handled inside uhuraTeller::doChilld, which is the function handling submenus. So simply replacing -75 by +75 will break getting points for asking about Woo...

     
  • Willem Jan Palenstijn

    New strategy: force a return in uhuraTeller::doChild after handling the hero::solvePuzzle call, and prevent the submenu from actually being opened.

    This is now hopefully fixed in d1e2d61b781aab5a0cc832a05a0981765fc4b0fe.

     
  • Willem Jan Palenstijn

    • assigned_to: nobody --> wjpalenstijn
    • status: open --> closed-fixed