Remote events are designed to efficiently pass data every frame, as long as they are used properly.
While you can replicate data to the client every frame, this results in a large amount of unnecessary and redundant data being passed (for example updating the hitbox position by 0.000001 studs) which can cause lag to devices with low bandwidth.
Many scripters implement a threshold where x must change by a minimum of y in order for data to be passed.
For example you can use this logic with the hitboxes by updating only if they have changed a sufficient amount since the last update.
For fast-paced data like this, you should use UnreliableRemoteEvents. They have higher throughput & are a bit faster than regular remotes.
UnreliableRemoteEvent is best used for ephemeral events, including effects that are only relevant for a short time, or for replicating continuously changing data.
This is literally what it does
Oh my god, I swear the fact that Roblox abstracts so much stuff for you makes dumb replies like yours pop up (no offense, but it’s the truth).
Just send data when it truly changes or upon loading into the game, and use UnreliableRemoteEvent (no not upon loading hahha) because it does not use handshake and there is so much less overhead becouse of .
Did you reply to the right person? What do you even mean by “This is literally what it does”? I was talking about damage being done on the client vs done on the server like he was mentioning. @cardboardthethird are you doing the damage on the server, and then sending the updated value to the client for the ui and stuff?
Uh, well if he’s asking about sending remotes to update the damage value that probably means he’s using a custom health system and bypassing the humanoid health. I do that for my games too. Also, using UnreliableRemoteEvent is not a good idea for passing updated health information to the client from the server. They are really only for vfx and custom physics replication stuff, not for critical values like how much health you have
No, it’s not.
You need to understand how requests work in the first place.
RemoteEvent does a handshake to ensure the value is being sent, while UnreliableRemoteEvent just sends a value without a handshake.
I know the difference between UDP and TCP, and it’s if the packet arrived successfully or if we don’t care if the packet reached the destination. If you use unreliable remotes (UDP), the packet might get lost (packet loss) and the client stat values will desync from the servers values. So there could be a scenario where on the server you have 20% health, but on client because there was packet loss it shows the old value. (50% health) And that’s something you really don’t want in a pvp game. Also, normal remote events are fast enough and basically arrive instantly so you really don’t have to worry about using UnreliableRemoteEvent
It is VERY expensive, actually.
If you live in a 1st world country with very good internet, I am happy for you, but that is not the case for over 50% of people.
You need to account for streaming and if a certain object is streamed in the first place.
It’s not expensive, benchmark it. The amount of data being sent is miniscule. Bandwidth is cheap these days. Even if you had the remote event sending the entire harry potter series to the client as a string in a heartbeat loop it wouldn’t do a thing
If your internet connection is so horrible that 1 or 2 remote events being fired every frame is expensive then I genuinely question how your connection is even able to handle basic multiplayer gameplay at that point because everything else the engine does is many times more expensive.
It’s not a great idea to fire a RemoteEvent every frame. If you spam the server too much, Roblox can drop your events, which could cause hits or damage to stop working entirely. To avoid this, throttle your events or have the server handle validation at a controlled rate.