I have spent a few days now trying to understand the concepts and implementation of Gameplay Abilities in the GAS by studying Lyra and tranek’s GASDocumentation GitHub repo, but I feel like I am missing some specific information to complete my understanding.
- I am making a hitscan gun. I input a mouse click which triggers a Gameplay Ability. The call is replicated to the server. Do I want to execute EVERYTHING on both the client and server, such as hit detection, applying gameplay effects, etc.? When it comes to gameplay effects especially, should the client apply those effects as well as the server, and will the server roll back the changes if the client were to cheat, or be under extreme lag (as long as the client is in the same prediction scope)?
Following Lyra’s example, only the locally controlled player begins to start tracing, and it appears that the server somehow validates the hits and replaces any invalid hits on the client (I find the process a bit difficult to follow). I am not sure why validation and rollback seems to be “manually” done here as opposed to just running traces on the client for prediction and running traces on the server afterwards for real hit detection and applying damage. I am confused on when the GAS actually does handle validation and rollback and when it does not because of this.
- I have a grabber character than can grab another player. The grabber has an active collision box in front of it on both the client and server. On collision, the grabber will activate a Grapple GameplayAbility. Now, because the call to the GameplayAbility is replicated, and it collides on both client and server, there will be a total of 4 calls (2 client, 2 server) to the Grapple ability. This is obviously undesired, so what is the typical solution to this feature? I could perhaps set NetSecurityPolicy to ServerOnly and just letting the server handle collisions?
Thank you for any answers!