So this is something that I’ve been wondering about, since firing Events to the Server using :FireServer() can cause lag if it’s done a lot, will this be the case if you fire a Remote Event to the Client using :FireClient()?
I think this depends on how much you fire it and what that event does when fired.
If you are firing a remote to change some text, it shouldn’t lag much at all.
However, if you are rapidly firing a remote to render explosions, etc. then that could cause some problems for people wioth lower end hardware.
I believe FireServer causes more lag because it affects the server and all the clients, meanwhile, FireClient is only affecting one client. It could still affect the client you’re doing it to, depends on how good they can handle it- performance wise.
And the server replicates to all clients :l
The FireServer calls a server function, and whatever happens in that function… like moving a part would be replicated on all clients, I didn’t say the data replicates but what it does as a function is.
You are right, however the kind of lag which OP meant is one that might happen when you are sending data to the client/server. What the peer does after receiving the data is a different story.
Like they said, it depends on what your doing though. Firing a lot of remote events/functions will cause connection lag, along with the lag that you produce when the remote event/function signal reaches the server. The amount varies form client to client because it all depends on bandwidth.
The wiki talks about how remote function/event affect bandwidth here:
For most devices and connections, a Roblox server can only send and receive about 50 KB/sec of data to each client, not including physics updates. That said, it is highly recommended to maintain a lower value during normal gameplay as sudden spikes in data transfer can cause lag and an overall subpar user experience.
Every time a remote event is fired or a remote function invoked, a packet of data is sent over the network between the server and client. This packet is counted towards the 50 KB/sec limit. If too many packets are sent (remote event or function used often), or too much data is sent per packet (lots of large arguments to the event or function), the latency of the connected clients can be adversely affected.
That’s not necessarily true. And in particular, with Remote Events, FireServer() does not replicate the transfer of that Remote Event to all clients, it’s between the client that fires it, and the server.
Not necessarily. It all depends on what you do with the data that gets passed to the server. For example, storing the data in a table on the server-side, or doing something with DataStores would not replicate to the clients. Now, if you made some part move in the game with that data, then sure.
But in the end, FireServer() is simply a way for a client to communicate with the server, and also pass values over to it, it does not really do anything more than that.
Note: I’m not trying to cause any arguments, only trying to clarify for any newcomers getting confused by the information in this post.
Yes.