#14353 closed defect (fixed)

AGS: Unavowed - Game crashes at the Staten Island stage.

Reported by: Hukadan Owned by: criezy
Priority: normal Component: Engine: AGS
Version: Keywords:
Cc: Hukadan Game:

Description

In the Staten Island stage, at one point, the group has to jump into a boat (see screenshot). But when doing so, the game stops with the following message:

!System.AudioChannels: invalid sound channel index 0, supported 8 - -958271488!
Debugger started, type 'exit' to return to the game.
Type 'help' to see a little list of commands and variables.
ERROR: !System.AudioChannels: invalid sound channel index 0, supported 8 - -958271488!

I included a save game, but the game cannot be saved just before it happens. The save game starts when you have first to trigger the fire alarm with Eli. After few dialogues, you end up in the scene where the bug occurs.

OS: OpenBSD

Version: ScummVM 2.8.0git (commit: 8c01800e91f70ef970530a68b2c6b688900d36d7)

Please let me know of you need more information.

Thank you

Attachments (3)

scummvm-unavowed-00000.png (171.8 KB ) - added by Hukadan 20 months ago.
Screen shot of the game just before the bug
unavowed.zip (816.0 KB ) - added by Hukadan 20 months ago.
Save game
agssave.003 (1.7 MB ) - added by criezy 20 months ago.

Change History (11)

by Hukadan, 20 months ago

Attachment: scummvm-unavowed-00000.png added

Screen shot of the game just before the bug

by Hukadan, 20 months ago

Attachment: unavowed.zip added

Save game

comment:1 by antoniou79, 20 months ago

I can reproduce this on Windows with a fresh master HEAD build (2.8git).

There are two issues here:

A tentative fix is to change this line:
https://github.com/scummvm/scummvm/blob/0a90e4227c382b168337f2580da4f360ded639e9/engines/ags/engine/game/game_init.cpp#L373

From:

if (_G(loaded_game_file_version) < kGameVersion_360) {

to:

if (_G(loaded_game_file_version) < kGameVersion_350) {

However, I cannot tell if this is a good/safe fix.

  • do games with version >= 350 use more than 8 audio channels in general?
  • can other games with lower versions than 350 use more than 8 audio channels?
  • is unavowed detected as 350 but is actually a higher version?
  • is this a bug on the upsteam code (which also uses version kGameVersion_360 for the comparison)?
Last edited 20 months ago by antoniou79 (previous) (diff)

comment:2 by Hukadan, 20 months ago

Thanks. It did the trick.

comment:3 by tag2015, 20 months ago

Summary: Unavowed (AGS), game crashes at the Staten Island stage.AGS: Unavowed - Game crashes at the Staten Island stage.

comment:4 by criezy, 20 months ago

Another way to fix the crash is by changing this line:
https://github.com/scummvm/scummvm/blob/10a5566dab986315037da8da2fbf968901f7bee9/engines/ags/engine/ac/system.cpp#L169

from:
if ((index < 0) || (index >= _GP(game).numGameChannels))
to:
if ((index < 0) || (index >= _GP(game).numCompatGameChannels))

The number of channels was increased from 8 to 16 in AGS 3.6, but in previous version, there was actually a 9th special channel (at index 8) for crossfade. The numCompatGameChannels includes that channel.

I think this might be a more logical change than the one proposed above, but I would like to check that with upstream developers.

And by the way the version of the game I have has the same crash, but is detected as

Game data version: 49
Compiled with: 3.4.1.14

so the fix proposed in the previous comment would not even work for it, and I would need to use kGameVersion_341_2.

in reply to:  4 comment:5 by antoniou79, 20 months ago

Replying to criezy:

Another way to fix the crash is by changing this line:
https://github.com/scummvm/scummvm/blob/10a5566dab986315037da8da2fbf968901f7bee9/engines/ags/engine/ac/system.cpp#L169

from:
if ((index < 0) || (index >= _GP(game).numGameChannels))
to:
if ((index < 0) || (index >= _GP(game).numCompatGameChannels))

The number of channels was increased from 8 to 16 in AGS 3.6, but in previous version, there was actually a 9th special channel (at index 8) for crossfade. The numCompatGameChannels includes that channel.

I think this might be a more logical change than the one proposed above, but I would like to check that with upstream developers.

And by the way the version of the game I have has the same crash, but is detected as

Game data version: 49
Compiled with: 3.4.1.14

so the fix proposed in the previous comment would not even work for it, and I would need to use kGameVersion_341_2.

yes, this seems like the better and more appropriate fix.
The quitprintf line will have to be adjusted as well if this is adopted.

by criezy, 20 months ago

Attachment: agssave.003 added

comment:6 by criezy, 20 months ago

I have verified that upstream AGS crashes in the same way.
I have attached a savegame for it as well.

comment:7 by criezy, 20 months ago

Opened https://github.com/adventuregamestudio/ags/pull/1960

I will follow-up on that ticket with upstream AGS developers, and once it has been reviewed, I will backport the fix to scummvm.

comment:8 by criezy, 20 months ago

Owner: set to criezy
Resolution: fixed
Status: newclosed

Fixed both upstream and in ScummVM using a different fix than the one discussed above.

Note: See TracTickets for help on using tickets.