Should hitboxes be handled on the Client or Server in my PVP/PVE game?

I’ve always thought that handling hitboxes on the client with server checks was more optimal than handling them on the server to avoid unnecessary server load for optimization. However, I recently read a post that claims otherwise, stating that client-side hitboxes could give players a significant advantage or disadvantage when playing with high ping. Now, I am a bit lost as to which direction I should go in.

Should I handle hitboxes on the client for the sake of optimization, or should I handle hitboxes on the server for the sake of fairness to all players and to possibly avoid some sort of hitbox extending shenanigans, as it’s impossible for a server check to be 100% accurate?

For context, I am working on a PVP and PVE combat demo to practice backend development.

2 Likes

Client for sure, just have a requirement check for the distance on the server against hackers & lag switchers, you can also have a latency (ping) check for lag switchers. Handling it on the server is going to feel laggy and you need to hit in front of the character you see, if you are using a gun system this will be even worse. There are many threads discussing this, but client comes the majority of the time on top, even if it is not the perfect solution.

Also handling everything on the server will create an unfairness for people with worse pcs / internet speeds as some cannot afford to optimise or improve it.

2 Likes

I suggest server-sided handling of hitboxes. This is because it will be a lot more fair for all the players. Just because someone has bad internet doesn’t mean everyone needs to struggle.

But handling hitboxes on the server will generally make the combat feel “less smooth” for everyone playing, I’m really not sure if I’d rather have high-ping players have possibly a slightly larger hitbox over everyone feeling like their game is “delayed” if I were to handle them on the server.

Well you said you’re making a PVE and PVP, players are most likely not going to be exploiting in a PVE and even if they are it doesnt effect other players because players are working together towards a common goal, but PVP has the potential for more exploiters so you’re obviously going to need to rely on the server more

The idea is for the game to be a sort of RPG-ish game in which you can fight both players AND enemy NPCs (with combat pretty much functioning similarily for fighting with both).

If you would proceed to do this and let’s say you fight someone from the other side of the world (probably a friend) with the server region in their favour you will not be able to hit them unless they stop moving. This is quite literally a stupid way to go about it.

To make it fair just allow players with a certain latency to actually hit players and players with a latency too high do not allow them to hit anyone.

For PVE chosing the server would be unnecessary, unless you want to check every move the player makes. So if you use both PVP and PVE I would say use the client.

Even so the roblox anti-cheat got a lot better, the only thing you really need to be careful about is checking the distance & latency (against lagswitchers). Other than that the server does not really matter and will create more negative feedback than handing everything on the client.

Alright, I personally agree with this reply the most as of now, so I’m gonna mark it as the solution. I’m not sure if this will close the post but if it doesn’t I’ll still proceed to read arguments for handling the hitboxes on the server (or further arguments for the client) if there are any new ones commented.

Thanks :smile:

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