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
[0.17.68] Stacked sound exceed expected volume
Re: [0.17.68] Stacked sound exceed expected volume
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.
Unsure however if that fix was specific to achievements or all sounds.
Re: [0.17.68] Stacked sound exceed expected volume
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
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
This does sound like a duplicate of that bug.
Re: [0.17.68] Stacked sound exceed expected volume
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.
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
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
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
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
That's perfect!Klonan wrote: ↑Tue Oct 01, 2019 1:15 pmWhats wrong with this:
https://lua-api.factorio.com/latest/Lua ... play_sound