Replicating Quickly-Changing Values

Does anyone know the best practice for replicating values that are changed often to clients?

As in a money value that is being updated every second and is in turn displayed on the client.

In the past, I’ve done this by storing values (IntValue, BoolValue, etc…) inside the player and reading them from the client, taking advantage of Roblox’s built-in replication. However, now I am simply storing values inside a table on the server.

RemoteEvents are an option, but I am worried about the performance implications behind firing one every second times however many players are online.

I want these values to be as up-to-date as possible, so I would like to avoid any intervals and the like.

Thanks for any help in advance.

I think you could have a value inside of the player or something like that and have the server change that value, correct me if I am wrong, because I am a little confused on what you are trying to acheive

That is what I’ve done in the past, however, I no longer store data in values inside the player.
All data is simply inside a table on the server.

I just want to know the best method for communicating data from inside that table to the respective client.

In that case, I’m not sure how to help you. I think you would have to use a remote event unless there’s another method that I don’t know about. Sorry!

That doesn’t force you to not make a value inside the player that the server updates.

You are right, but is that the best approach to this?

I wish I had more insight into how Roblox’s replication works internally and how different it would be than using RemoteEvents.

Basically, would using values have better performance than RemoteEvents?

Using a value would probably be less intensive than rapidly firing a remote event, because usually remote events are laggier on lower-end devices

There isn’t really a difference between the built-in replication and remote events? Other than remote events are controlled by the developer and not the engine. Where have you heard remote events are laggier?

Also, remote events are bunched up before being sent to use less bandwidth, so they might be slightly outdated, but it doesn’t matter unless you have 0 ping.

I guess I just made it up in my head. I think I googled “are remote events laggy” and I got “yes, when you rapidly fire them.” But that was a long time ago.

I probably got it from here: Can firing Remote Events to the Client too much cause Lag?

Remote events can make a game laggier, if you fire them really fast for a while, not because someone is on a low-end device. There’s more data to send → longer time for data to reach the client → longer time for the client to read all the data.

2 Likes