Caching client for better response times?

Hello everyone i am looking for an improvement to a functional part of the player combat. I have implemented a way which waits for the response and starts playing the animation alongside the ‘Fire’ (which is attachment to an invisible part). At higher ping(330ms) it was too long to be considered ‘fast paced’ therefore i was thinking about a way to “cache”(?) the player or is this too far fetched and have deal with it
Here is an video showing what i am trying to explain. There is a small pause between the actual execution and the spinning.

Animation Callback(Local):

        Track:GetMarkerReachedSignal("StartFiring"):Connect(function(paramString)
        if paramString == "FireStart" then --"FireStart" is an event when the hands are 
 above 
        the player
            Track:AdjustSpeed(0)
            local returns = FirebendRequest:InvokeServer("DeployFire",0)

            Track:AdjustSpeed(1)
        end
        if paramString == "FireEnd" then -- Last frame of the animation
            Track:Stop()
            local returns = FirebendRequest:InvokeServer("EndDeployFire",0)


            ControlModule:Enable()
           player.PlayerGui:WaitForChild("ScreenGui").Frame.FireSpinCooldown:TweenSize(UDim2.new(1, 0, 0, 20),nil,Enum.EasingStyle.Linear,12,false,callback)
            player.PlayerGui:WaitForChild("ScreenGui").Frame.FireSpinCooldown.BackgroundColor3 = Color3.new(255,0,0)
        end
       end)

Server sided response:

    elseif  desire == "DeployFire" and userClientstate[player.Name] == 1 then
            local fire1 = ServerStorage.RightFireSpin:Clone()  
             local fire2 = ServerStorage.LeftFireSpin:Clone()
            fire1.Parent = player.Character
            fire2.Parent = player.Character

            userClientstate[player.Name] = 2
             for index = 1,#userToDamage do
	           userToDamage[index]:TakeDamage(10)
	           damageFire  = Instance.new("Fire")
	            damageFire.Parent = userToDamage[index].Parent.UpperTorso
               Debris:AddItem(damageFire,6)
               userToDamage[index] = nil	           
	           wait()
             end
            return 1

Thanks!

2 Likes

I mean, from my own opinion I’m not sure this is worth optimizing for 300 ping players. I mean, that’s insanely high ping…doesn’t matter what online game you’re playing with that, it’s gonna be laggy and delayed for sure.

1 Like

image
My default is around 300ms sadly, so perhaps i should just move on to other parts of the game…
and i’m not even sure how this will cope with other players in the game.

it’s hard to satisfy everyone and everything so it’s better if you were to just move on from this, then you can try it later, if the player’s internet isn’t that good then you shouldn’t bother since it’s the client problem but if it lags the whole server you could try and find more easier ways to reduce the lag, mostly when player enjoys the game they won’t mind it too much, good luck! :smiley:

1 Like

Very good point which i may have just went around it. I think it’d be amused if i could take a glimpse at the ‘average’ ping for most players in roblox and somehow work with that. In the studio i get lower ping due to the server hosted locally(Is there a way to increase it(simulation purposes)? ). i really appreciate the kind gesture for a newbie (Thanks!)

2 Likes