Page 1 of 1

[0.17.68] Stacked sound exceed expected volume

Posted: Tue Sep 10, 2019 11:04 pm
by Mylon
If more than one sound plays at once, the volume can get excessively loud.

A great example of this is playing multiplayer Warptorio (v0.88). The sound plays for each player, so when the warp button is clicked on a 10 player server everyone freaks out because it's far louder than it is in single player.

This also can be observed in multiplayer under high latency where attempting an action can cause a sound to play (such as a entity mined sound) multiple times

Re: [0.17.68] Stacked sound exceed expected volume

Posted: Wed Sep 11, 2019 4:27 am
by invisus
Sounds like a possible dupe of viewtopic.php?f=30&t=75498 which should be in the next release.

Unsure however if that fix was specific to achievements or all sounds.

Re: [0.17.68] Stacked sound exceed expected volume

Posted: Wed Sep 11, 2019 9:09 am
by Klonan
Well, thats how sounds work, I don't see what here is a bug to be fixed

If Warptorio is playing 10 sounds in the same tick, of course it would be loud

Re: [0.17.68] Stacked sound exceed expected volume

Posted: Wed Sep 11, 2019 11:48 am
by Mylon
This does sound like a duplicate of that bug.

Re: [0.17.68] Stacked sound exceed expected volume

Posted: Tue Oct 01, 2019 11:21 am
by PyroFire
Although this is mostly an issue with warptorio, i do like the idea of having a sound.play function that deals with the stacking problem internally.
It would have to be a param {no_stacking=true} though.

Funny to know the base game has a similar sound stacking problem.

Re: [0.17.68] Stacked sound exceed expected volume

Posted: Tue Oct 01, 2019 12:01 pm
by Klonan
PyroFire wrote:
Tue Oct 01, 2019 11:21 am
Although this is mostly an issue with warptorio, i do like the idea of having a sound.play function that deals with the stacking problem internally.
It would have to be a param {no_stacking=true} though.
Why not just only play the sound once?
If you are writing the code that tells the game when to play the sound, why not just write it to not play it more than once?

Re: [0.17.68] Stacked sound exceed expected volume

Posted: Tue Oct 01, 2019 1:13 pm
by PyroFire
Klonan wrote:
Tue Oct 01, 2019 12:01 pm
PyroFire wrote:
Tue Oct 01, 2019 11:21 am
Although this is mostly an issue with warptorio, i do like the idea of having a sound.play function that deals with the stacking problem internally.
It would have to be a param {no_stacking=true} though.
Why not just only play the sound once?
If you are writing the code that tells the game when to play the sound, why not just write it to not play it more than once?
Because there is no respect to surfaces.

https://lua-api.factorio.com/latest/Lua ... play_sound

Code: Select all

force.play_sound{path=path,position=vector(),surface=where???}

Is there a way to do this better?

Code: Select all

function entity.emitsound(e,path) for k,v in pairs(game.connected_players)do if(v.surface==e.surface)then v.play_sound{path=path,position=e.position} end end end

function players.playsound(path,f,pos) for k,v in pairs(game.connected_players)do if(not f or v.surface==f)then v.play_sound{path=path,position=pos} end end end
So i can do

Code: Select all

function forces.playsound(path,f,pos,fc) fc=fc or game.forces.player fc.play_sound{path=path,position=pos,surface=f} end

Re: [0.17.68] Stacked sound exceed expected volume

Posted: Tue Oct 01, 2019 1:15 pm
by Klonan
PyroFire wrote:
Tue Oct 01, 2019 1:13 pm
Is there a way to do this better?
Whats wrong with this:
https://lua-api.factorio.com/latest/Lua ... play_sound

Re: [0.17.68] Stacked sound exceed expected volume

Posted: Tue Oct 01, 2019 1:34 pm
by PyroFire
Klonan wrote:
Tue Oct 01, 2019 1:15 pm
PyroFire wrote:
Tue Oct 01, 2019 1:13 pm
Is there a way to do this better?
Whats wrong with this:
https://lua-api.factorio.com/latest/Lua ... play_sound
That's perfect!