Close Combat Hitbox: Client or Server? (OverlapParams Loop)

This question was asked a lot in scripting support before. They mostly have this as the answer:

Client:

  • smooth
  • more accurate
  • performant, removes weight from the server
  • vulnerable to hackers

Server Sided

  • Inaccurate sometimes with positioning and hit detection
  • exploit protection
  1. Does “accurate” only apply to fighting npc? Its client → server → client, so client hitboxes should be accurate for the attacker. But it’s attacker’s ping + opponent’s ping for the person getting hit. Does that mean players could get hit after dodging, and the game becomes unplayable if the attacker is lagging? How do big battlegrounds/fighting games do it?

  2. Should hitboxes be handled on the Client or Server in my PVP/PVE game? - #2 by KJry_s
    Distance check on the server sounds like hitbox detection (or player distance) on the server. If you do it on the server why also do it on the client?

The reason Im posting this instead of bumping another thread is becuase I’m not asking generally. I’m doing a looping Overlap Params on the server. The overlap params is correct & works regularly, but messes up & attacks multiple times when the attacker is moving & doing m1 combat. I think its becuase of the time it takes for remote events to send because theres no issues with the overlap params.

I did overlap params because it’s the fastest, but does looping it defeat the puropose of performance? Should I do the hitbox on the client or do regular raycasts in the shape of a box on the server.
(I tried the raycast hitbox module theres a delay between the moving attachments & the following rays hitting & doing damage)

Who says you can’t do it both on the client and on the server? This is actually more common than you think. You use expensive, high-accuracy hitreg on the client, and on the server you use a faster and more tolerant hitreg just to make sure the client isn’t doing anything funny. You check for both results before actually doing any damage calculations, and have the server time-out the client’s hitreg if it takes too long for them to reply.

It’s naturally more likely for the server to register a hit, which compensates for latency issues. This solution isn’t going to solve close-range cheats like killaura, but it will easily prevent the blatant kinds of hacks like attacking someone from 3 miles away.

1 Like

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