On all my previous games, i’ve done hitbox detection on the server out of reflex, cause of exploiters etc. But recently i’ve been considering doing it on the client because it’s way more fluid there. I am thinking I could do that if I am able to support it with some server-sided sanity checks but I am not sure.
Ideally you do both. Detect it on the client, and if it hits, send it to the server to validate whether or not it should’ve hit.
On the client, you can make some kind of instant feedback so it feels responsive while the server calculates everything and actually deals the damage.
For example, you could play particle effects or animations on the client whenever you hit an enemy so that it doesn’t feel clunky waiting for the server to tell the client to make those effects. This way you can keep the gameplay feeling smooth while having maximum security.
There are other posts about this on the forums, which I’m sure you can find with some searching - definitely some very helpful stuff. I don’t have anything at hand, but it shouldn’t be hard to find.
I’m not sure if I’m just not understanding, but what’s the point of checking on the client if you’re going to recheck on the server again? Is it just so the vfx comes out faster and looks cleaner? (sorry for bumping)
My current system is Client to Server which then uses Spatial Query to detect people with hitboxes which then uses a damage module. Is this bad or unoptimized? I also am not sure if I want to move to client hitboxes because wouldn’t the player on the other end being hit see the hitbox being inaccurate or way bigger than it is? And if I do a sanity check on the server with magnitude or something, aren’t server hitboxes delayed or sluggish too?
A plan I have in mind if I want to switch to client hitboxes is using a hitbox detection module that returns all characters hit in a table, and then firing to the server with this table to then loop and damage the table (to reduce server firing).