I have been thinking lately, and wondered what is the best way to handle shot with fastest? Using fastcast on client is best way to deliver smooth bullets to client, although this method suffers from security issues like hit detection.
Using fastcast on server is better but you suffer in terms of bullet presentation.
So what would be a good way to counter these issues? Remotes can take you as far but security issues arise through these methods which we ultimately don’t want
I use the sequence of the following, and it works perfectly as it should without causing issues:
Render the sound on the shooter’s side & Send remote to the server for verification Verify shot on the sever and send remote to all the clients except for the shooter Render the sound upon receiving remote on rest of the clients
Well as of current, I shoot remote to server with the cast, and verify that the cast has properties that only get inserted if you actually shoot, this also is combined with checks if the user has a tool etc equipped which then sends to all other client.
But would this method be heavy on clients? I’ve seen games suffer of high ping through high use of remotes.
No worries, it won’t be costly on the client-side at all since the client is not sending/receiving a large amount of data, nor as frequently as you might have to worry as long as you don’t send the large pieces of data every single time firing the remote event.
I do the shot verification twice via raycasting on both server and client every single remote event firing, but as of not I have never encountered the performance issue on both server and client.
A good idea also is to only fire the clients that would be able to see the gunshot.
If the gunshot has a range of about 500 studs then just fire the clients within a radius of 700 studs or so should suffice.
Personally I use my own module instead of fastcast as my game doesn’t really need a complex fast casting system. I usually have the bullet travel through physics on the server and then fire raycasts from where the bullet where to where it is now.