Network Event Replication Best Practices

If I have a Multicast event on my character, and I want to play a sound, can I send the sound through the Multicast Event input properties without causing problems?

It’s not like it’s sending the file over the network right? Just the reference to it, which should be pretty small, and only happen when the event is called?

Id like to avoid setting up multiple Multicast events just to play different sounds if I can. Like having a MC_PunchSound, MC_KickSound, MC_DieSound. Id rather have an MC_PlaySound, and just call that with whatever parameters I want, from the actual initial input events.

What would you say would be the best practice in this case?

Thanks for your time,

Everybody that has the game has a copy of that sound, when you multicast it (passing the sound) server is just telling other clients to play that sound. Would be very un efficient to send the whole file every time you need to play the sound :stuck_out_tongue:

Haha, I figured, I guess I was just wondering if in the grand scheme of network traffic, sending a file path reference and a few float variables over the network every time i wanted to play a sound, was good practice or bad practice. Im not running the events on tick or anything, I just dont know much about network traffic sizes yet.

Thank you :slight_smile:

Personally I’d create an array for your sounds and RPC the key associated with the sound. The event playing the sound would use the key to find the sound in the array.

Sounds Array -> Get (key) -> sound

Don’t be afraid of using a reference since they normally are just 8 bits while a int32 is … well 32 bits.
Whatever you do don’t use String, Name or Text but if you really have to then use string.