I am making a Multiplayer FPS Shooter and I am trying to figure out a good practice for shooting and damage.
Currently I am using a Gameplay Ability to check if there is a round in the chamber, check fire mode (safe, semi, full auto) and then shoot a line trace however I would think that this could be very bandwidth heavy especially if its multiple automatic weapons. (nothing like a mini gun)
I have read a couple different ways to do this but I am unsure what the best a better way for bandwidth and to prevent cheating.
-
Have the client shoot and have the server check if the client can hit the location - Wouldn’t this be the same as having the server just do the trace in the first place? I am not sure how I would validate if the client could hit the location by the server (I would need to do something like this so the client isn’t hitting people on the other side of the map or behind some kind of object that they can’t shoot through)
-
I could have a start firing tag or bool and a end firing tag or bool. Set the firing rate based off the weapon so the server will fire a line trace ever X.XX time.
If you have a better method please let me know.
Lastly the final issue is that when I currently shoot one round it shoots 2 line traces and causes damage twice. I have read “servers authoritative proxy (copy of your character) needs to have the ability too. So server applies the ability and replicates it to you and all simulated copies of you”. How would I stop this from happening twice in the gameplay ability?