Does the 50kbps data limit *only* apply to remote events or also server-side object creation?

I had a important question because I am thinking of a efficient way to send data over to clients (server to client only) and I was stuck with the question:

Does the 50 kilobytes per second limit only apply to remote events or does this also apply to objects and such created on the server?

Basically what I plan on doing is make a custom humanoid NPC wielding a gun.
The NPC uses raycasts and such to move around, optimized and all, but unimportant for now.

I want to have about 400 - 600 of those NPCs and they’re all wielding guns and ranged weapons and such.

And to replicate their gun firing and such, I am unsure to if I should use remoteevents or create string object values instead with a string value containing the data for bullet direction, etc, encoded in JSON or something and just use childadded on the client.

Should I use remote events to replicate those 600 NPCs firing full automatic guns or should I use remote events instead? Will creating stringvalues containing a string of bullet info also count up towards the 50kbps limit?

What would be the best way to replicate it and keep the traffic low and not clog up the queue with thousands of bullets as well?

Does it matter much if I use stringvalues or remoteevents to replicate all of this, what is faster and more efficient in a case like this?

Edit: I know physics and remote events have their own bandwith, but I’m talking about object creation and the remote event 50kbps limit, not physics.

4 Likes

Apologies for the bump, thread hasn’t been answered in about 2 days and can’t seemingly find the answer on my own.

This is a good question.
While I don’t know the answer to this question, I do have some advice when it comes to networks:

As I found out in this post, it would be a good idea to use multiple remote events instead of a single remote event or function.

Sending strings through the internet has a cost.
You should be able to use this information to create a test and answer your question.

Send 500kb worth of strings through a remote event, then see if it affects server-side object creation.

I’d love to know the answer.

I’m basically curious to a few things.

Does 50kbps limit only apply to client > server or server > client as well?

Does it only apply to a single remote or does it apply to all remotes all together?

Is it faster/better to use stringvalue objects instead with a jsonencoded string or containing numbers you can split up with string.split()?

What would be the best, fastest and most performant way to replicate 600 NPCs using full-automatic guns and such in a game that needs to be semi-fast paced?

Can I use the same methods used for my 600 NPCs with full automatic guns on players as well or do players need a seperate/own unique way of replicating their actions?
(Example, use remote event to send a bullet to the server but use a stringvalue object to replicate where the bullet needs to be visualized + particles/bullet holes.)

(I prefer being able to archieve all of this without using someone else’s module to replicate my stuff, some people link me to other people’s modules telling me to use that for my game.)

Sorry gotta bump again, this still has not be answered in days, neither was I able to really find the answers on my own.

I am not very sure as well but firing constantly in studio will give out a notice saying that remote event is firing lots of time(pretty sure its just a notice that its firing lots of time and does not supress limit). As I tested doing this in game server while firing every time when player press w, a, s, d to move and there is no problem what so ever. So my hypothesis is that firing data that is that small wont take a lot and the limit is kind of impossible to reach unless you are sending the whole table or so. Oh yea I sent like “MoveFront” strings every time I fire with only a wait() delay and with no issue. Correct me if I am wrong tho…

Edit: I don’t think you really need to even use remote events for NPC, afterall they should be on server side so every player can see it

1 Like

So information I have found so far is that remote events can fire at 20 times per second, which is, alright, seems decent.

ALready knew about the 50kb per second thing, but apparently the fastest speed you can fire them at also seems to be 20 times per second, if you fire them more than that I’m guessing it slows down or queues them if I’m correct.

But still don’t know if that’s just client < server or also server > client, there’s no good clarification about that.

For so far, i still have no idea on if it’s acceptable and alright to use StringValue objects for example because I surely may have or use some things in my game that are going to fire at much faster rates or send over more data or such.

I know I don’t have to replicate NPCs because their position already replicates if the server moves/teleports them.

But what I want to replicate is their weapon fires.
Like said before, having like 500 NPCs (all custom humanoid to speed up game) wielding full automatic machine guns is gonna end up firing like 1000s of bullets/projectiles in a very short time which is a thing I am concerned about because with a 20 fires per second on remote events those many projectiles and such are surely gonna outrun those limits.

But what about stringvalues on the server?
I just make a stringvalue in replicated storage and use ChildAdded event to check on client if it was added, read values, string.split the string, convert numbers to numbers, etc, then visualize stuff on the client.

I still don’t know if this would be more efficient than remote events.
I do know for a fact that using strings I can make my values even smaller in byte size, use only rounded numbers for example and have spaces to seperate them looking like 123 270 672, this would be a 3D position in workspace for example for projectiles to fire/hit at.

Correct me if I’m wrong somewhere, I’m trying to find information and results so I know what is best for my game to have the least lag and be able to replicate certain data at high speed/frequencies.

I still don’t get why you want to fire remote event to fire a projectile, its all suppost to be server sided. Remote event should only be fired if there is information that needs to be sent between server and client, such as if the projectile actually hits, then it sends the info. You can just do loop every sec the projectile fires if the player character is near and not if its far.

Well, obviously, I have to tell all clients to visualize the bullet client-side, if I make a part with a beam and sound effects on the server and animate it there it’s going to cause a lot more lag.

Things like projectiles giving off light and traveling through the sky is a visual animation effect, when doing it on the client players will also be able to set their locat settings to how detailed and smooth they want the animations to be.

This is way more optimized and faster and decreases the server load, but I’m still looking if I should use remote events or stringvalues with ChildAdded.

1 Like

There is no practical limit of 50kbps.
In case of high speed, it will exceed 200kbps in high speed network,
The slow network loads at 20kbps.

316.12KB / s

2 Likes

I would guess that Roblox doesn’t currently support 400-600 NPCs firing automatic weapons if you want to track each bullet individually. I’m not sure any game actually does this (but if you know of one, that is interesting).

Last time I tried something like this I made a paintball game with guns that rapid fire. I forget which account it’s on, but the same guns are in this place, to give you an idea: Turkey Blaster - Roblox.

Anyways you can have about 20 players spamming bullets in a server with those guns before it gets laggy.

Probably having 400-600 NPCs running around will be laggy by itself. 50 kbs is not a lot.

Also there’s no point in running any of your code faster than 20 Hz, as that is the network send rate. Hopefully that gets fixed soon. For things like guns it introduces a lot of trigger lag.

9 Likes

Obviously I will try to use optimalization techniques.

But basically all I really need to do, is having NPCs send a start and end position to each client,
and the client will then, completely client side, draw the bullet and tween it from start to end with some particles before making it dissapear.

So this should not lag too much on the server since all the server really does is sending the start and end position to each client, but I have to know the most efficient way to do it.

I was thinking of making a queue system where if certain NPCs fire at the exact same time, their start/end positions get put into tables and send to the client all at once so the client can have a loop run through the table and handle multiple bullets at the same time that were fired in the same time frame for example.

But no idea if that would be super efficient.

I don’t think batching will add much efficiency. But I’m old and stupid, so try it.

8 Likes

Alrighty then makes sense, It really depend on the person.

Now my question still remains, does inserting objects, etc have the same bandwidth limit? If I were to insert objects on the server and do a .ChildAdded on client, would this also count to a 50kbps limit or does this have different limits/rates and such?