acemod / ACE3

Open-source realism mod for Arma 3
https://ace3.acemod.org
Other
1.02k stars 739 forks source link

Cookoff sound effects sometimes do not obey speed of sound #9547

Closed amsteadrayle closed 10 months ago

amsteadrayle commented 1 year ago

Mods (complete and add to the following information):

Description: The cookoff snap/crack sound effect does not obey speed of sound and is audible before the explosion or impact that causes the cookoff.

Steps to reproduce: I have not been able to reproduce this in a controlled environment.

Expected behavior: The cookoff sound effects should be audible after the sound effects of the event that causes the cookoff.

Where did the issue occur?

Additional context: I have observed this numerous times over about two years of playing, across multiple modsets and versions. Here is video of two examples: (You may need to raise the volume a lot.) https://www.youtube.com/watch?v=fhsKUGzLHog

johnb432 commented 1 year ago

~~Are you sure the vehicles are detonating because of the AT hitting? Could it be something else killing them? Do you have Advanced Vehicle Damage enabled?~~

~~In Advanced Vehicle Damage and Cook off, ACE only processes what actually happens, i.e the projectile damaging the vehicle, it does not predict and make a vehicle blow up before a projectile hits. That's why, regardless of the answers to the questions above, I believe it's just desync of some sort. The fact that you can't reproduce the issue in a controlled environment could be an indicator for this.~~

I can't attest to other components of ACE, but I imagine they also use the same techniques as Advanced Vehicle Damage and Cook off.

See comment below.

jokoho48 commented 1 year ago

it is correct that the Cookoff sounds do not obey the effects of Speed of Sounds because PlaySound3d and Similar commands do not use the Speed of Sound in Arma. so this is knowns since a long while. a while back i started to implement new sounds and a new system for this but i think it got flagged down because someone wanted to write a system for that in CBA. ref: https://github.com/acemod/ACE3/pull/5327

amsteadrayle commented 1 year ago

Oh wow, I just assumed PlaySound3d used speed of sound. It's a shame that neither your rework nor the CBA implementation ever made it in.

johnb432 commented 1 year ago

Oh wow, I just assumed PlaySound3d used speed of sound. It's a shame that neither your rework nor the CBA implementation ever made it in.

It does, but not really. See https://feedback.bistudio.com/T176809.

jonpas commented 1 year ago

It does, but not really. See feedback.bistudio.com/T176809.

Please test from Revision: 151133

:tada: time?

johnb432 commented 1 year ago

🎉 time?

Partially.

https://github.com/acemod/ACE3/pull/5327#discussion_r1384018705

I think we should use all of the sounds that were made for that PR.

The idea I had in mind was to use a global event to make sounds play locally. Each client would calculate the distance to the object and choose the respective sound file (close, mid or far). The sound would be immediately played using playSound3D when the event is raised.

The downside is that if either the source or observer are moving fast from/to each other, it might result in the wrong sound played, meaning the observer would hear something not quite natural. E.g. jet moving fast to a vehicle cooking off, it starts by playing the far sound, but as the jet is traveling fast, it arrives at the vehicle cooking off and close would have been a better choice.

However, most sounds played are quite short, even very short, so it's unlikely the above is truly a problem.

PabstMirror commented 1 year ago

Profiling today (and probably 1.16)

Fixed: playSound3d was not taking into account the speed of sound on remote clients - https://feedback.bistudio.com/T176809

not sure how it handles speed of sound underwater 😜