Multiplayer advanced bullet system - projectiles or line traces?

Hi friends,

I’m in the planning stages for a multiplayer FPS, where I’m currently trying to figure out what the best approach for building an advanced bullet system is. Some of the specifications for the system are as follows:

  • Realistic bullet drop
  • Penetration mechanic
  • Ricochet
  • Fragmentation/Spalling

My initial instinct was to use a recursive line trace, computing the velocity and drop manually on each frame and using that data to determine where to spawn the next line trace on the next frame. I imagine this will make calculations like dotproduct, penetration, etc. easier. However, I have two big worries with line traces: replication and visualisation. I’m going to be building a test project to prototype this, but I imagine getting tick-based line traces to synchronise across multiple clients and a server is no easy feat, and the thought of having to write a custom implementation for this kinda scares me. Secondly, i worry about displaying an accurate visual to the players without resulting in a jaggy projectile trace or path.

I’m also exploring the use of a projectile built with the ProjectileMovementComponent, who’s obvious benefit is that all the simulation is done by the component and visualisation is handled as well. My concern here is with the collision detection and implementing more advanced features like penetration, ricochet or fragmentation.

I’ll likely try playing around with both, but I wanted to see what people’s experiences were in the hope of gaining some insight and encountering some wisdoms haha.

Thanks for your help!

~ Ellie

It’s good until you need something custom or until performance demands it. For my system I did use traces to calculate the actual state of penetration, bounce, where to spawn decals, to get impact vectors etc. On the projectile itself I write the logic of its behavior. Does it bounce, split, how often, does it do anything crazy etc. If you go the ratchet n clank route, resistance FOM etc where everything seems custom and crazy you will have to.

How you visualize it is a different story, it’s a different system. You wouldn’t trace 50 times for a minigun to match the visuals if you don’t actually need it. If you feel comfortable programming make your own?