To the best of my understanding, what's going on is that a Beautiful Doom (hereafter referred to as BD) RealBullet subclass actor is spawned at some point (RealBullet itself being a subclass of ZDoom's FastProjectile) that plays a whizzing sound if the projectile is closer than 192 units to the current camera during a given tic. However, when the sound is being calculated at a given tic, it appears that the actor has been destroyed already.
When GZDoom crashes, looking at the FSoundChan object in the SoundEngine::CalcPosVel() frame, it references BD's whizzing sound, while the actor pointed at by the channel has been clobbered, presumably because it's been destroyed. It seems to me that the best temporary fix is to put an A_StopSound(CHAN_AUTO) in an OnDestroy() override in BD's RealBullet class. However, that seems to put the onus on the script developer to understand GZDoom internals (which could change anyway), when GZDoom should be smart enough to clean up references to a destroyed actor. In my mind, one of the following two things probably ought to happen in GZDoom:
- It should prevent complete destruction of an actor until any sound it is playing has finished playing.
- It should immediately stop playing all sounds emanating from an actor upon destruction.
The first solution seems to be the most difficult and also potentially the most problematic from the standpoint of contravening the script writers intentions. The second one would just require the actor code to stop all sounds immediately in Destroy().
Regarding your statement _mental_:
_mental_ wrote:Most likely, it’s a mod bug. This crash usually indicates that actor destroys itself during execution of its own Tick() function.
I should note that GZDoom's own fastprojectile.zs (in wadsrc/static/zscript/actors/shared) calls Destroy() in several places in FastProjectile::Tick(). So while this
may be the source of bugs in GZDoom, it doesn't appear to be explicitly prohibited given the pattern in GZDoom's own source code.
Thoughts?
To the best of my understanding, what's going on is that a Beautiful Doom (hereafter referred to as BD) RealBullet subclass actor is spawned at some point (RealBullet itself being a subclass of ZDoom's FastProjectile) that plays a whizzing sound if the projectile is closer than 192 units to the current camera during a given tic. However, when the sound is being calculated at a given tic, it appears that the actor has been destroyed already.
When GZDoom crashes, looking at the FSoundChan object in the SoundEngine::CalcPosVel() frame, it references BD's whizzing sound, while the actor pointed at by the channel has been clobbered, presumably because it's been destroyed. It seems to me that the best temporary fix is to put an A_StopSound(CHAN_AUTO) in an OnDestroy() override in BD's RealBullet class. However, that seems to put the onus on the script developer to understand GZDoom internals (which could change anyway), when GZDoom should be smart enough to clean up references to a destroyed actor. In my mind, one of the following two things probably ought to happen in GZDoom:
[list=1]
[*]It should prevent complete destruction of an actor until any sound it is playing has finished playing.
[*]It should immediately stop playing all sounds emanating from an actor upon destruction.[/list]
The first solution seems to be the most difficult and also potentially the most problematic from the standpoint of contravening the script writers intentions. The second one would just require the actor code to stop all sounds immediately in Destroy().
Regarding your statement _mental_:
[quote="_mental_"]Most likely, it’s a mod bug. This crash usually indicates that actor destroys itself during execution of its own Tick() function.[/quote]
I should note that GZDoom's own fastprojectile.zs (in wadsrc/static/zscript/actors/shared) calls Destroy() in several places in FastProjectile::Tick(). So while this [i]may[/i] be the source of bugs in GZDoom, it doesn't appear to be explicitly prohibited given the pattern in GZDoom's own source code.
Thoughts?