Handling Remote Events: Multiple or Single? Clarity or Efficiency?

Hey guys!

Before I dig into the post, just some context. I am fully aware of how Remote Events (REs) work and their use cases but I am just looking for the most appropriate form of implementation with regards to the network and efficiency.

Currently, I operate with multiple REs and I ensure each one has its own use case. For example, if I am doing a sword slash, I have a remote event for the sword SFX (SwordSfxRE), the VFX/Particles (SwordVfxRE) and, hypothetically, any data I want to communicate to the server or data manager (SwordDataRE).

In my brain, this makes sense, and it is how I have always handled remote events. People ask if they can get messy, not really. I folder them and ensure my structure is clean. Though there are issues that I want to address.

  1. System Changes: If I want to change the way I am handling SFX or VFX, I have potentially 20 or more remote events associated compared to some people who just use one and pass through a string value. Though I have heard that passing through strings is bad with a RE? Unsure.

  2. If lets say 20 players are swinging their sword at the same time, for each player 3 remote events are firing whenever they use their sword. On top of this, its technically MORE than 3 per player as if I want everyone to hear the sound, the SFX & VFX remote first have to send to the server before being broadcasted back to all clients. Are bindables more effective here?

I am worried the way I approach these systems backlog the server or aren’t maintainable and will slow performance. I also tend to fire a remote event to a server script that fires it back out to all clients and again, I am not sure how poor this could be on the network.

Is it better just to do a simple approach, one remote for ALL SFX for example:

SFXBroadcast:FireAllClients({
    Sound = "Name",
    Position = x,
    ExcludePlayer = player
})

How do you guys/what is the proper way to deal with remote events (SFX/VFX/DATA in particular) that need to be fired rapidly by lots of players, especially with it going from Local → Server → Local often. Do I move to bindables for this communication?

For things that happen very often, maybe a few times every second just use unreliable remotes instead, and make sure to optimize the sent data so you don’t have a high RECV

1 Like

Interesting, I dont think I have looked into Unreliable Remotes enough. How “unreliable” are they in terms of inconsistency? Do most developers handle SFX and VFX broadcasting through these?

They’re unreliable because they don’t attempt to resend packets that the receiver didn’t receive, it’s just TCP vs UDP

Capitalizing on multiple distinct remotes for different categories of requests is really good, since the engine already takes care of sending tag data on what each packet is and what its arguments are. You definitely don’t want to send more than what’s required, and doing events like your table example is a sure way to eat up bandwidth.

As mentioned before, you should separate gameplay-critical network requests from the ‘fanfare’ with unreliable events. Sending where the client swings a sword should be prioritized and done reliably. Sending which effects should play shouldn’t.

I think This post Should help you, this is a guide for network optimization, this does include remote events, which will answer your question.

You should also look at remote events optimizers such as BridgeNet

However, one rule to keep is that when it comes to SFX,ANIMATIONS,VFX,ETC, always use client.

To me most of everything your doing seems fine, but I would say using 1 remote for sword VFX would be better then 20 or more.