Open olofson opened 8 years ago
Actually, the explosions don't have sound effects currently. Maybe they should have? It makes logical sense. No noise without sprites! Uhm... Anyway, the problem with that is, there are a few different explosions, most of which are used by multiple enemies, and they're sometimes randomly selected. Maybe we should just have one single "explosion" enemy, which is instantiated with the desired animation and sound effect as arguments, and have the common logic for normal enemies handle that? That is, the 'death' sound effect is never played by an enemy itself, but rather by the explosion that replaces it as it dies.
Or, we remove the 'explosion' enemies altogether, and implement that as a new enemy state 'exploding', where it just stops calling the normal "AI" methods, and... well, explodes, instead. Cleaner, simpler, more efficient, and also eliminates #297 as an extra bonus! \o/
I think we have a winner.
When enemies playing continuous sound effects die, their sound effects are detached, and as a result, they're no longer updated as the listener moves. The most obvious and annoying example would be base cores.
This shouldn't actually be much of a problem, as enemies are not supposed to make noise after having been completely disintegrated...!
In most cases, the "no enemy" situation is already partially solved, as the enemies are essentially replaced with an explosion; another enemy type. Those aren't updating audio positions either, though, as those are one-shot detached sound effects - but that can be fixed, of course.
Either way, this is another hint that positional audio should really be an integrated feature in Audiality 2. That would eliminate all the extra script code and messages for updating all enemies. We'd just update the listener position and the sound sources that are actually moving, and that would probably happen out-of-band, involving no scripting at all.
So, conclusions: