How to handle responsiveness in a combat system with high ping?

So Im quite new to making fighting games and had searched up a lot before trying anything, so I spent a couple weeks and got this

looks good so far, and while testing it outside of studio my ping happened to be quite high (105 ms). I suddenly got struck with this awful desync problem between the animation and the hitbox


(im replicating my ingame ping inside the studio btw)

My hitbox system is server sided, so the client sends the input to the server but plays the m1 animation locally for fluidity, then the server spawns the hitbox and does the rest yknow blah blah. I wouldnt have honestly bothered on fixing this since im pretty new to it but after checking if other battlegrounds struggled with the same issue I happened to see this.


It is not butter smooth but at 105ms the responsiveness is still crazy fast, and I have no idea on how the majority of fighting games handle this, so I was hoping to get some info here. Help!

2 Likes

I play animation on server which hopefully is the right way to do this

2 Likes

Ill try it but I assume that’ll do what shenanigans does, if your ping is quite high, the input to the server delays a bit but the animation gets synced with the hitbox in compensation, sounds good enough.

Does it work for you tho?

I would just use signals tho and play the animations on the client. This way, there is less computation on the server which is beneficial since it’s a combat game. As most of the experienced developers say, as much as possible, let the client handle the visual effects and animations

Most games do the Hitboxes and Animations on the Client. If you do everything on the server you usually sacrifice gameplay smoothness with, well, slow inputs. Looking at Jujustu Shinanigadsfsdlf, it’s likely doing Client Sided hitboxes while also probably validating the hitboxes on the Server.

What about exploiters? Well generally, you should put gameplay smoothness over dealing with exploiters as exploiting is less likely to happen and players probably hate it more when their inputs are slow.

There’s also Server Authority which basically kills exploiting while also keeping smooth gameplay but that’s whole nother topic which I wouldn’t recommend new developers to deal with. It’s also still in beta so it only works in Studio and not in actual Roblox games.

2 Likes

Have you tried generating the hitboxes on the client & validating on the server?

That’s one thing I’ve talked about recently in another post. Playing animations in the client is specially terrible for support and accessibility for high ping players. You would not have such a desync if you just played it in the server, which would also allow you to have more control and better event detection for the action.

Please note doing everything on the client is not the best if there’s a big tradeoff smoothness vs synchronization. It’s a combat system, it’s not supposed to be just and only visual appealing like some tree wind movement system. Players need and want to know what the server thinks they’re doing; they want to know whether they’re laggy for the rest of the players or not; they need to know when their hitboxes will effectively start in the server.
This is valid even for low ping players because even at low ping you can see some slight annoying delay, and building it that way assumes players are always at the lowest ping possible, which isn’t true.
And specially if you don’t want your game to be fully vulnerable, your server needs to know whether player is currently doing an action or not, whether they’re under certain state or not. Relying on just some RemoteEvent to damage players can make your game really vulnerable even if you do some checks here and there because if the action is purely client-sided the server has no way of confirming whether they’re currently doing an attack and if it’s even reached the hitbox start point.
Again, as I said in the linked post too, it’s not like animations look choppy when played in the server. They’re still pretty decent; and at least the player knows much more accuratedly when the server detects they’ve started doing some action.

3 Likes

Ive marked the solution on the other comment because he suggested that change first but you also proposed it so thanksss, heres how it turned out.


(ping used in the video)


works literally the same way it does in shenanigans, dope.
Id rather sacrifice input responsiveness instead of animation and overall fluidity.

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.