Question about gun security and replication

Hi, so I was trying to start planning how to create a nice gun system, that’s secure so exploiters can’t abuse it.

There were a few factors I was thinking of that I was having trouble figuring out how to attack.

One being, replication. So obviously, I’d probably want to draw a local-sided bullet just for visuals, as I would also do that for every client to reduce strain on the server, leaving the server to just handle hit detection.

However. If the client decides how much recoil to apply, and the bullet’s origin position and end position, and can pass those arguments to the server to replicate for other clients and to use for hit detection, that’s a pretty big security problem that could result in aimbotters.

But at the same time, if the client’s visual hits a target, but the server comes up with its own accuracy offset to use and it actually misses the target, that sounds like a terrible option as well.

Any ideas? Thanks!

you could use ray parametrization to see if the ray is even possible to be casted. So like what im saying is like cast your ray right (parameters are origin and direction) then do the standard plane trick with the normal and if that dot is not close to 0 and the client said they did it then we can confirm that there was some manipulation of the origin and the direction. Now I know that this isnt really talked much about but this is well known in ray tracers. Basically we can represent a ray hit as a point on a mathematically defined plane. If you need more help feel free to ask any questions

2 Likes

That sounds interesting, although I’m lost when it comes to mathematical-related operations such as this.

Not really sure how I’d go about implementing that.

I’d also assume you’d mean to keep going with the client passing through origin and directional data, but on the server to make sure those coordinates make sense.

I know its not in lua but this code shows the math behind the ray detection

1 Like