Value objects auto-replication v.s. RemoteEvent custom replication

Simple question, which I think I already know the answer to but I would like to be sure:
If I have an IntValue object in the Workspace, let’s say it’s the Health value of an enemy in a game - this will replicate to the clients as I update the value on the server. How much more efficient is it to have RemoteEvents just send info to all clients instead of updating the variable?

What if I’m sending this lots of times every second - isn’t the frequency the client can receive these request ~30Hz? If I exceed that, will there be notable lag in this?

3 Likes

You probably won’t lag your users by setting *Value objects. Please just do that. It’s a lot more work to implement custom updaters for what will probably be very little gain.

If you find it lags and you can trace the source of the problem to your value objects, then you can think about optimizing.

4 Likes

Physics replication in particular is 30hz. Standard replication is instantaneous. (up to the server choking point)

Additionally RemoteEvents and functions replicate at 20 Hz iirc.

I agree with blobbyblob, don’t use RemoteEvents vs. value objects for performance gains, this is a pre-optimization. Use what is easiest for you to program.

3 Likes

What do you mean? Physics replication occurs at 30hz in the sense that it is always being sent between server and client. How would static instances have a replication frequency? Do you mean their maximum throughput?

RemoteEvent:FireServer() and RemoteEvent:FireClient() both will only send at 20Hz. If you try to send any faster they get sent at the same time (albeit, in order, although this isn’t guaranteed). Same goes for RemoteFunctions.

I’m pretty sure this is still the case, but I may be wrong.

So if you’re trying to use RemoteEvents to send data faster, don’t worry about it.

5 Likes