So I’m currently making a FPS framework and I want to know what is the best way to replicate bullet to other clients.
I know that replicating to all client is better than replicating to server but I have a few concerns (ig).
Wouldn’t it cost a lot of receive kb/s data?
Is it the best way to replicate?
Would it start to lag when theres like 50 peoples firing at once
I know like 2 ways to implement this. One is just sending data when a bullet is shot (with sanity checks ofc) but this will increase receive kb/s data.
The other one is to do a repeat until, basically the idea is a client will shoot and send data once and send data again when the client stops shooting. But this comes with some flaw such as, if the client is lagging it would appear the client has like 10 million rounds.
The method I’m using now is to replicate a bullet every time a signal is sent which cost around 20 kb/s
I’m using FastCastRedux, it has a built in PartCache module. So I’m not TOO worried about bullet issues, I’m more worried about bullet replication. Since the one I have right now it just Cast a bullet with the information given by the client.
Whoa that’s a lot, how are you measuring the kb/s? Currently, I’m using JsonEncode to measure byte size of the data like in datastores then averaging via elapsed time in this other post where I’m sending 3 numbers and a instance, 3 times for 3 Motor6Ds for every 0.2 seconds and I got only 1.2 kB/s. Is there a better way to measure it?
Otherwise, even though it’s large it’s still within the 50 kB/s budget per client. Have you considered the “if it ain’t broke don’t fix it” approach? Are you actually receiving the problems in game yet? Is it worth your time and effort to make the best replication system yet?
But otherwise yeah you got the concepts down for reducing bandwidth, send less information and interpolate the rest through this method:
Of course it’ll come with the aforementioned drawback but you can solve it through further server side logic like if they exceed the mag limit for that particular gun then stop replicating the weapon bullets.
I use roblox’s performance stats in the settings. I looked in phantom forces recv, and it’s around 40 kb/s which is pretty good in my opninion considering theres like 50 player ingame.
Yes I have tested with 2 clients. The gun shoots at 1200 rpm. It’s still hangs around 20kb/s
I feel like it is. I’m just trying to find out what is the best method to replicate bullets. Because I’m trying to make a decent FPS framework.