Too many RemoteEvents good or bad?

Im plannig rewrite system for my game. So instead of using 1 remote, can i use many remotes?
Speaking about optimization:

  1. Will many remotes lag my game.
  2. Will it lag my game if it placing in character (so every player would have own remotes)

Speaking about security

  1. Somehow its easy to me secure many remotes than 1

Main question - Can i use many remotes and dont worry about optimization.

2 Likes

Too many RemoteEvents cause lag.

1 Like

It’s better to use alot of RemoteEvents instead of not using them at all ^^

What if im not gonna fire them too often. I need it for Moves. For fighting game.
For example if player press F it will fire FMoveRemote.

1 Like

You can literally just fire a remote whenever the player presses any key. Then on the server, you can check his key.
You would only need one remote, then.

But ig firing one remote TOO often its bad.

Too many remotes can be bad, but using only one for everything will be inefficient and confusing. Every ‘system’ or ‘task’ should get its own remote, i.e. one for inventory and shop-related stuff, one for the combat system, one for each vehicle, etc.

4 Likes

Interesting. Speaking about 1 remote. Rapid firing can cause lag?

1 Like

Yes, spamming remotes can cause lag too. Some people who make weapons use methods to work around it and reduce the number of events, like doing hit detection on the client, then having the server verify and take damage accordingly.

In other words, anything that is important should be done on the server, and if something doesn’t have to be sent through a RE, the client can do it instead.

1 Like

Hmm. Soo. If im firing remote every time when player pressing key, will it do lag too?

uis.InputBegan:Connect(function(inp,pro)
	if pro then return end
	if inp.KeyCode == Enum.KeyCode.Unknown then
		remotes.Keys:FireServer(inp.UserInputType, "Began")
	else
		remotes.Keys:FireServer(inp.KeyCode, "Began")
	end
end)
uis.InputEnded:Connect(function(inp,pro)
	if pro then return end
	if inp.KeyCode == Enum.KeyCode.Unknown then
		remotes.Keys:FireServer(inp.UserInputType, "Ended")
	else
		remotes.Keys:FireServer(inp.KeyCode, "Ended")
	end
end)

It won’t make a noticeable difference. The most important factor is how much you’re sending, and how often. Don’t worry about using many separate RemoteEvent or RemoteFunction objects - keep it readable and understandable for yourself.

Firing a remote every time a player presses a key is fine. There are a few other threads about all of this, you should try searching to find some. There’s a lot of interesting behaviour of remotes that might help you.

You may need to worry about optimisation later if you notice any kind of lag, but typically you shouldn’t stress yourself about it too much, or else you end up over-optimising and making your code much more difficult to read.

1 Like

Sincei have server lags. Im worrying about it right now. Thats why im asking.

Try to narrow down where you end up sending a lot of data to the clients or to the server. Too much data being sent to the clients can be just as bad as too much being sent to the server. Typically it’s worse, I think, since the roblox servers should be able to handle a lot more data than each client.

1 Like

So basically im able use seperate remotes without worrying about lag?
If yes its good news for me. Cuz i can use own AntiExploit method for it

Separate remotes doesn’t mean less lag. It’s pretty much the same as using less remotes. The only difference is in how easy it is to understand.

10 Likes

Alright. Thanks for helping me. Have a nice day.

3 Likes