Replicating multicast sounds with lag

So I’ve come to a bridge that I can’t seem to pass. Probably a very simple solution but I can’t seem to find it. The problem is I’m attempting to play a gunshot sound which is replicated to all clients without server delay in the case of lag. I’m using the pktlag command to induce lag into the project and delay client1(around 300ms).

Whats happening so far:
-Client1 shoots weapon
-Server 300ms later detects client1’s decision to fire
-Client1 and all other clients hear nothing until the server detects the input 300ms after client1 technically shoots

What I would like to happen:
-Client1 shoots weapon
-Client1 hears gunshot sound
-Server 300ms later detects client1’s decision to fire
-All other clients hear replicated gunshot sound

I feel it’s quite simple but replication seems to be a real pain right now.

Hey there. I doubt you’re still working on this problem, but I had the same issue and discovered a pretty straightforward solution. Simply use a client-side event to play the sound and set a non-replicated boolean that can be used to track whether the sound event is being handled on the owning client. Then you can use a branch in the multicast event so that the second sound event exists for all players except for the client.

Additionally, if you would like to test the functionality, you can set a few seconds of delay onto the multicast and listen for an echo between the clients. You will find that it will not echo for the owner, and the others will only hear the echo. This is a good representation of the extreme lag that might exist and how the sound system will handle said lag.

Best option is to never replicate audio. There’s literally no reason to do so.

Replicate the “Action” that ultimately plays the audio. Or better make the audio play based on deterministic behavior or action.