Bullet Latency Problem

So I am making a First Person Shooter and I’ve ran into this huge problem that effects the most important aspect of the game Shooting . My TracerSystem as I like to call it is implemented in this manner .

(Client) Creates CFrame(s) with spread
(Client) Simulates Physics
(Client) Fires to the server with the CFrame(s) in a table
(Server) Does sanity checks
(Server) Fires the table to other client(s)
(Other Client(s)) Simulates Physics

There is no issue on the client who creates it because they simulate their tracer physics as soon as its created on their end but there is a noticeable high latency for other players as it takes more than 2 seconds for others to see a single tracer or sometimes not even see it with an average ping of 300ms.

I am trying to achieve a 32 player game and each player could be firing the event every 0.25 seconds (minimum cool down) with a maximum of 5 CFrames in the table but due to this problem I cant even achieve a 5 player game.

I thought this was an issue on my implementation but I tested in Studio and did not face the problem.

So I’ve come to the assumption that maybe the table containing the CFrame(s) is reaching the bandwidth limit or maybe even exceeding it

PS: There are other events but they fire small data and aren’t fired that often.

1 Like

i am also working on a first person shooter, the way i have kind of fixed this issue is by localising most things to the player so its client side and Had only hitboxes and that stuff on the server side, i also added in a feature to give the player a message that their ping was too high to actually play the game. Idk if roblox has servers around the world or if its only in the us, but you could send the player to a server which is closer to their location.

Roblox servers are in the US only and I am handling most of the things on the client except for the hit detection. The server only does a few sanity checks like ammo and fires all the client.

I forgot to ask how to fix this problem on the OP , So whats the best way to fix this problem is it by some how compressing the CFrames or is there other means?

local function CompressPacket(CFrameData)
    local CompP = string.format("%f,%f,%f" , CFrameData[1].Position.X , CFrameData[1].Position.Y , CFrameData[1].Position.Z)
    local CompAA = {}
    for i , v in pairs(CFrameData) do
        local Axis , Angle = v:ToAxisAngle()
        CompAA[i] = string.format("%f,%f,%f,%f", Axis.X , Axis.Y , Axis.Z , Angle)
    return CompP , CompAA

So I am using this compression and it seems to be working well but is there any way to improve it?