I’m using Projectiles for almost all of my ordnance in my Hovertank game, which is all centralized around Multiplayer. It’s definitely possible to pull it off, but it really depends on your situation.
A few bits of advice I can give from my experience:
-
Spawning Projectiles is expensive. I strongly suggest pooling the projectiles and just reactivating them instead of spawning new ones. It’s slightly more difficult to manage, but there are huge performance and network gains to be made from that. A lot of Actor properties replicate their initial state when the object is spawned even if they aren’t used. It’s a good practice to get into anyway IMO - it’s benefited me massively. My weapon system is based loosely on ShooterGames, and it’s relatively easy to calculate how many pooled objects you need based on the weapons fire rate and the projectiles lifespan.
-
Write your own version of FRepMovement. The engines stock version is massively inefficient for things like bullets. My version only replicates a Quantized world-location and Velocity now for movement - everything else can be determined clientside from that information so long as it’s rotation follows velocity.
-
Use Variables instead of RPC’s where possible. Although RPC’s are reliable (if you make them so) and will execute in order - replicated variables cost less bandwidth, and the client will always mirror their state eventually. The engine can also decide how often to update the clients based on current bandwidth usage, whereas RPC’s are sent regardless.
-
Unreal Tournament has a complex but very good system for projectile replication, whereby they spawn Fake projectiles on the client and match them up to the servers versions to minimize the gameplay effects of latency. I still haven’t been able to make total sense of it, but it’s worth looking into if you don’t mind being overwhelmed initially. I want to try and get 10+ people into a custom UT match just firing link guns off into the distance to see how well it really performs.
–
If you don’t want ballistics or shot-leading to be huge contributors to your game, I would move to traces and fake the ‘projectile’ with a fast-moving bullet particle system. Believe it or not, the new Battlefront game, Gears of War and numerous other titles use this approach and when they marry up properly it can be virtually seamless. But of course, it means that bullets will hit a target 1km away as soon as they hit a target 1m away, so it’s situation-dependent.
You can even simulate ‘shot lead’ to an extent by modifying the end-position of the trace, and there are methods for doing arc-traces using relatively simple parabolic equations, good if you want to simulate bullet drop.