mstfmrt07M
Normal2y ago
12 replies
mstfmrt07

Syncing Sounds?

Hey everyone 🤟🏻 In our multiplayer soccer game, we need to synchronize sound clips and and some values that are needed for those sounds to be played (such as power of a kick, or a random index of from bunch of audio clips) Actually most of the settings (such as Pitch/volume over power, list of possible random audio clips for a single action) are set in a ScriptableObject; so all I need to have is "name of the sound to be played, random index(if there are multiple clips), and power of the action"

We've experienced kind of a similar issue with animations; and our solution was to synchronize a set of so-called "Animation Packages". Whenever an animation is triggered by a player, an anim package (consists of animationType enum, intensity, value and a selector value) is added to the realtime set, and other players would "simulate" that animation on their side.

My question to y'all is whether it sounds logical to pass around those data for playing a single shot audio clip.

I'm also considering to use the values from animation sync, player's rigidbody speed, plus a float variable called "actionPower" which can have value between 0-1 (but this option leaves me with having only one action power at a time) This way I can easily assume that if a player plays an animation, he/she is most likely to perform the action of that animation. Anyways, what do you guys think about it? Has anyone experienced a similar challenge before?
Was this page helpful?