How should combat detection be handled?

Should combat detection be handled on the client or server? Is there any reason to pick one over the other? Mostly being fist/melee combat.

2 Likes

You could do it client-sided, but just have some server sided sanity checks to make sure the info being passed from the client makes sense.

Like, making sure the distance between both characters are < some number.

1 Like

i would say client sided as if you were to do it on the server it will lag or moslty take lot of time based on your ping and most roblox users have high ping like 200ms+

I’ve done this before using a raycast hitbox module. I do all my hit detection on the client, to improve latency and all my sanity/security checks on the server. I’d recommend doing this as it has a balance between latency and security. Doing the hit detection on the server is alright but in my opinion, it’s terrible. There’s a ton of latency sometimes up to a second.

My Stats from doing my combat on different networks
Client Latency: 0.01 - 0.03 ms
Server Latency: 0.2 - 1 second

CLIENT

  • Handle User Input
  • Handle hit detection

SERVER

  • Handles hit detection furthermore, dealing damage and checking if the hit was within a certain distance.
  • Handle pretty much everything else
2 Likes

Thank you all for the replies. @MrchipsMa @C_Sharper @KingofHolywater

They all helped and I will use this information to help me create a good combat system.

1 Like