I can tell you what will happen and when from my experience
But i do not know technical reasons for it so i can’t explain WHY only guess
When i was firing 1 bullet from gun into swarm of enemies everything was going fine
Until i decided go big or go home
SO i made spread shot firing 10 bullets at a time from my gun
And i more or less was experiencing same thing as TJ was
I am talking here not about firing sound but about bullet hitting enemies sound
This was bugging out for me
Because i wanted to check my available options before asking for help i checked play music and play sound actions (i was using play sound on channel)
Turned out just “PLAY SOUND” action did not have this issue
What i think is happening is that when you play sound on channel it is cuing sound to play not playing them all at once
And so this is why multi sounds do not work properly
While play sound action just plays sound of whatever whenever condition is meet
And last part trigger once
Ultra high volume does not come from volume but from sounds overlapping themselves
Because without trigger once he is spamming sounds left and right each frame
And until they get cued (using play sound on channel action) it gives you effect of like sound being ultra high and then since TJ lowered volume rest of his sounds are well low volume no surprise there
It is like you wold flush water and have leafs in sink
As long as NOT enough leafs reach sink that long water will drain smooth and fast
This have nothing to do with trigger once but you can observe same thing happening with separate 2 objects
If you have topdown game and you add dash button to your player using forces
Applying enough force will allow you to clip trough the wall when dashing into it
It is like engine is bugging out instead of separating 2 objects
You won’t be able to execute it each time but dash few times and you will be able to teleport to other side of wall/obstacle
It is like engine is struggling to do what events tell him to do
And just gives up sometimes
In case of play sound on channel it first gives up because lack of trigger once and just spam sounds even so it should be holding other sounds from playing until one sound is finished playing
On top of that above and this are just my assumptions
BUT well come on play sound on channel
Don’t you think channel should be occupied with playing sound when it is playing sound and should not play any other sound on that channel?
Remember how old dos games have number of channels you could use?
So you can have more multiple sounds playing than normally you would?
Same thing is happening here
Difference is that overlapping at 1st because of lack of trigger once
And first it bugs out then after it gets stuck it will keep channel just for one sound at a time
@TJCoffman, the upshot of all this is to use a trigger once as @ZeroX4 wrote. That will fix your issue. Keep playing sound on channels. This will stop any previous sound playing, and start the new one. Play sound (no channel) will overlap sounds resulting in a horrible cacophony of noise.
I’ve just tested this because it’s not something I’ve had issues with before, and replicated OP’s experience. The trigger once fixed the issue. Then any repeated clicks just stopped the current sound playing and played the new one from start.
I then had a go playing the sound (no channel) action and it played the new sound in addition to any sound already playing, like it’s overlaying the sounds.
That’s what I thought too, but it doesn’t explain why the initial burst of sound is loud and not any subsequent bursts of sound. Which is what I experienced with the quick test too. I haven’t figured out why this is the case.
Because it is trying to play all that sounds at the same time and they overlap
Open any audio editing software and shove in same sound multiple times in same moment of playing even audacity
And they will overlap how they should but also amplify the volume
Again let me repeat
In each case it is not happening constantly
Engine is chocking until it gives up and let something unwanted to happen
In case of play sound on channel it is trying AT FIRST to play all that sounds at once
Chocking until it realize NAH i should not do that
1 sound at a time on each channel
That’s why at 1st it give you burst of sound and then goes back to what you should hear
Same with that dash example (but in this case it is struggling to prevent it but sometimes gives up)
You can’t constantly dash trough wall
But you can keep dashing into the wall and at some point you will clip trough wall
I even have game project like almost year old of a user for who i was trying to solve it
Set force to something higher or increase time of dash (increase wait before you remove all forces from player)
I think it was space to dash
And try to dash trough fence
You won’t be able to do it each time but sometimes it will happen
Yes, and if you replay those multiple sounds you get the same result every time. But not in with GDevelop. It happens the first time, but not with subsequent attempts.
GDevelop isn’t some AI or have some ML that remembers what happened last time. It plays this sound repeatedly 60 times per second. It’s doesn’t check what’s happened earlier.
And the dash example isn’t a good analogy. You can’t layer dashes, and the dash against the fence involves 2 objects. Playing a sound doesn’t.
Anyway, the play sound action layers the sound with any previous sound that’s still playing. Play a sound on a channel stops the current sound on that channel and starts the new sound. All the OP has to do is add a trigger once to each button click event and it’ll sort out his issue. Regardless of how or what is causing the problem.
We think different way so examples can mean something else for us
Dash example was proving that engine allow unwanted thing to happen and that it is not only sound thing
As for sound itself MY BEST GUESS is that it have something to do with the fact we have option to preload audio files
So it is not like anything else in our projects
And before it is fully loaded decoded or whatever
Engine try to spam it just because you tell it to spam it
After it realize what you are trying to do WITH what type of resource
(by that i mean sound is recognized as audio file and now it is fully loaded decoded you name it)
It goes like
Hold on
One sound per channel at the time
Again just my guess i could be totally wrong but that is only explanation that makes sense to me