It’s very cool to hear other approaches to firing mechanisms as I don’t see it discussed thoroughly in the forums especially in multiplayer. It sounds pretty similar to my approach with the client/server side of things.
It sounds like I have rotations and pitch replicated a bit differently and separately from the firing since I’m not using base aim rotation, but it generally seems to arrive at the same point.
To keep the server load down, I basically allow the player to decide all of the firing directions and line traces using the replicated pitch and rotation values and validate the hits from the hit point back to the player to prevent cheating. There is a caveat to this as I am at an impasse with the validation as I have large player counts in my game. The server is already loaded with replicated physics-based pawns and calculations like aircraft and vehicles also so I generally have to sacrifice some validation so I can reduce the server hardware footprint and save money. However a beefy dedicated server can handle pretty much anything, but with a cost deficiency lol.
But referring back to the projectiles and not digressing too much from the topic, I use this firing setup to feed the values into the spawn actor function on both run on owning client and server/multicast so the start points and projectiles are in sync.
I spawn two separate copies of the projectile with a parent child relationship with identical projectile movement properties. The location, pitch and rotation values are fed in with the values from my function above.
The server-side copy is simply a multicast visual with a mesh and particle effects, audio and stuff.
The client-side copy is where the damage magic and calculations occur. It’s an empty invisible collision with the same server projectile movement that basically communicates back to the player to fire a separate damage system at the hit location when it hits wherever.
It’s bandwidth requirements are nearly nonexistent as the server is really just spawning a very simple actor executed by the client that gets destroyed upon impact with a particle effect and a client executed server/multicast explosion at the hit location. That is with an “explosive” projectile.
The bullet projectiles are a lot less intensive as it’s just a mesh and an impact particle and decal devoid of an elaborate explosion particle system.
I use a number of client-side requests since I’m tracking a ton of different stats and things in real time and use the server to validate parameters such as projectile types, damage values, damage types and other stuff. Essentially like the teacher at school asking students to show their work instead of simple answers, but I digress lol.
Cheers!