Unhandled exception in FMOD with FS + HTH2 + autoload
Posted: Thu Jan 14, 2010 1:21
I'm not sure where to report this. On the one hand, the problem happens in GZDoom when trying to play a mod that's not compatible with ZDoom (High-Tech Hell 2). On the other, the crash is in the sound system, which would make it a ZDoom problem as well. All GZDoom tests made with official build 1.4.1.
Anyway, steps to reproduce: start hth2.zip in GZDoom, go directly to MAP02, activate the switch to open the cargo bay door, and you get a crash. At least, I do.
The MSVC debugger tells me it happens here:
In game, this happens during the FS script:
The first message (about the "gargo doors" [sic]) is displayed, then it crashes, and the message about the teleporter never happens. So it seems obvious that the problem comes when running the startsectorsound(49, "amb50") instruction. Commenting it out allows to continue... But not for long since the same crash happens again, caused by something else, once you step on the teleporter.
So at this point I thought that maybe there was something wrong with the sounds from that wad. I copy the sound lump in a test wad, identified as "problemsound" in SNDINFO, and I use this custom actor to test in a ZDoom-compatible way:
When activating the object, no bug in ZDoom. No bug in GZDoom as well. It's not the sound file.
Then I did a test of HTH in GZDoom, but by cleaning my autoload to keep only lights.pk3 and brightmaps.pk3. A half-victory: I could play past the switch, and even past the teleporter, but it crashed with that same error when picking up one of the SSGs. Encouraged by this result, I tried with nothing in the autoload at all: no crash.
And there I just don't understand what's the actual culprit.
Attached is a crash report obtained by autoloading just brightmaps.pk3. But I also get a crash at the same place (just after the teleport) with just lights.pk3.
Anyway, steps to reproduce: start hth2.zip in GZDoom, go directly to MAP02, activate the switch to open the cargo bay door, and you get a crash. At least, I do.
The MSVC debugger tells me it happens here:
Code: Select all
unsigned int FMODSoundRenderer::GetSampleLength(SoundHandle sfx)
{
if (sfx.data != NULL)
{
unsigned int length;
--> if (((FMOD::Sound *)sfx.data)->getLength(&length, FMOD_TIMEUNIT_PCM) == FMOD_OK)
{
return length;
}
}
return 0; // Don't know.
}
Code: Select all
script 90
// entry doors -90
{
if (x90 == 1)
{
x90 = 2;
wait(20);
setcamera(283, 12, 142, 0);
timedtip(200, "radio: sorry,\n the gargo doors are not at use.");
wait(85);
setcamera(152, 175, 140, 0);
wait(50);
//startsectorsound(42, "amb50");
startsectorsound(49, "amb50");
linetrigger(26731, 42); // Floor SR HnF Norm Txtr Num Up No
tagwait(42);
lightlevel(151, 232);
silentteleport(329, 42);
wait(100);
timedtip(350, "use this teleporting\n device to enter the complex");
wait(100);
clearcamera();
x91 = 2;
wait(250);
timedtip(5, " ");
}
}
So at this point I thought that maybe there was something wrong with the sounds from that wad. I copy the sound lump in a test wad, identified as "problemsound" in SNDINFO, and I use this custom actor to test in a ZDoom-compatible way:
Code: Select all
Actor ProblemCauser : SwitchableDecoration 1337
{
Activation THINGSPEC_Switch
Radius 16
Height 32
+SOLID
+USESPECIAL
States
{
Spawn:
Inactive:
BAR1 AB 6
Loop
Active:
FCAN A 0 A_PlaySound("problemsound")
FCAN ABC 4 BRIGHT
Goto "Active"+1
}
}
Then I did a test of HTH in GZDoom, but by cleaning my autoload to keep only lights.pk3 and brightmaps.pk3. A half-victory: I could play past the switch, and even past the teleporter, but it crashed with that same error when picking up one of the SSGs. Encouraged by this result, I tried with nothing in the autoload at all: no crash.
And there I just don't understand what's the actual culprit.
Attached is a crash report obtained by autoloading just brightmaps.pk3. But I also get a crash at the same place (just after the teleport) with just lights.pk3.