Opened 20 months ago
Closed 20 months ago
#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)
Change History (11)
by , 20 months ago
Attachment: | scummvm-unavowed-00000.png added |
---|
comment:1 by , 20 months ago
I can reproduce this on Windows with a fresh master HEAD build (2.8git).
There are two issues here:
- The debug message is wrongly formatted (easy to fix -- edit: fixed in commit: https://github.com/scummvm/scummvm/commit/10a5566dab986315037da8da2fbf968901f7bee9)
- The game needs an extra sound channel (a 9th one) but it is assigned a maximum of 8 based on the game's detected AGS version --which in this case is kGameVersion_350 (50)).
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)?
comment:3 by , 20 months ago
Summary: | Unavowed (AGS), game crashes at the Staten Island stage. → AGS: Unavowed - Game crashes at the Staten Island stage. |
---|
follow-up: 5 comment:4 by , 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
.
comment:5 by , 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.14so 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 , 20 months ago
Attachment: | agssave.003 added |
---|
comment:6 by , 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 , 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 , 20 months ago
Owner: | set to |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed both upstream and in ScummVM using a different fix than the one discussed above.
Screen shot of the game just before the bug