Multiplayer Open World Projectile vs. Instant Hit

Guys,

What are the community thoughts on a the impact/server cost of spawning real projectiles in an open world multiplayer environment. I know a lot of previous games have used instant hit solutions of different types to minimize load on server and for simplicity. However in our open world scenario there are several real benefits/usage scenarios of real projectile with weight and gravity impact (dynamically).

Any network/sever/MMO experts have some thoughts on the potential feasibility cost, or ways this has been done in the past?

regards

CW

Well, I would really stick to the design needs. Projectile-based weapons only make sense if you’re going to have ballistics and stuff. And even then you can pretty much ‘fake’ it and just go with instant-hit weapons.

Diamonds Are Forever. Spent bullets are not.

If you can get 64 players, all with guns (or whatever weapon shoots a projectile), shoot at the same time, in the same general space so that each player can see the other 63 shoot their projectiles. Then you might have an issue. Otherwise, if it’s fired and no one else is around to see it…

That being said, as long as the spent projectile does not have an infinite Lifespan, it shouldn’t be a problem. The projectile will likely expire before any real “jam up” in the server, due to multi-projectiles, becomes an issue.

Generally the consensus is that Instant Hit weapons take less resources as the clients and servers don’t have to worry about projectile from a projectile based weapon. I would use Instant Hit weapons for weapons like assault rifles and pistols and projectile weapons for weapons like grenade launchers and rocket launchers.

If you want to go for true realism though, then a projectile based system is by far the best solution … there is a blueprint on the market place called “Realistic Blueprint Weapons” … is very cool and includes penetration. 8-}

Out of curiosity, does anyone know how battlefield does their projectiles?

As far as I know … Battlefied, Americas Army Proving Grounds (Unreal Engine) uses instant hit … ARMA II and ARMA III use projectiles. Don’t quote me on this though. 8-{

Let me just pitch in here, I’m really not sure how you guys are replicating, but the server load is actually the exact same if you set it up in a smart way like I have, and how they most likely do it in Battlefield. While it’s great to use projectiles, DO NOT replicate their movement, in fact, DO NOT replicate the projectile at all. Instead of replicating the projectile, each time a player shoots their gun, have each client locally spawn a bullet (preferably with no collision), now when the instigator’s bullet hits, have each client locally spawn the decal, and so on…

Battlefield uses projectiles, which is why it is always an extreme pain sniping someone from a mile away.

So one more question on this. I get what is being described around line trace from a performance perspective. However if I want to simulate energy weapons (lasers, energy etc). I would have to spawn some form of actor to support it right? Is there a more efficient way to simulate the full concept of particle effects in connection with line trace weapons?

This was my understanding of BF4 (at least) is that it uses projectiles and not instant hit. If you google “Battlefield projectiles vs instant hit”, that will confirm that they are indeed projectiles and not instant hit (the first two I think were not true projectiles). Instant hit has no velocity ever, because there is no projectile (correct me if I am wrong, but just going by gun mechanics & physics in real life, and experience from UE4)

Lifespan is key, along with the way you script your blueprints/C++ from my understanding (I’m pretty green to UE4 still though, so a vet might have a different perspective).

PS: I’ve actually been messing around with spawning in TONS of cpu heavy projectiles on a decently intensive map (400 at one time across the map all within visible rendering distance), and have yet to even see a frame drop directly from the projectiles (even ones with several different triggered particle effects). I see more of a frame rate drop from the foliage on my map than the projectiles mass spawning in. But that is very limited testing obviously without players connected (just developing).

My personal suggestion is go for what you think would be best suited for your game in terms of mechanics.

What I am trying to figure out is if I will also lose the ability to do full particle effects (dont know enough about particles yet) in a scenario where I trace. I know how to tie a particle system to a projectile. I dont know if there is anyway to do similar complex particles systems in a trace scenario.

Also in regards to performance with projectiles again, just a bit more detailed info on some testing I did:

Check out the video linked for an idea of the performance test I simulated with projectiles. I just did a test of 900 projectiles (the ones shown in the video that fall from the sky, the atom looking ones, which have 3 particle effects on each one) being spawned in almost all at the exact same time, lost about 4-5 frames doing so, but in all thing considered; how likely is it that you will have 900 projectile actors at one time live in your game? If you made a projectile SMG that shot 500 projectiles a second I could see that being an issue, that would be better off with instant hit in that case.

If you make your maps into streamable submaps, you shouldn’t need to worry too much about projectiles impacting things. My logic is; If you can’t see the tree fall, did it really fall? Yeah the sucker fell, despite no one seeing it, but your gfx card didn’t render it because it wasn’t on the same submap :wink:

https://youtu.be/VkPN3cFUI7Y?t=31s

Note: The FPS isn’t amazing due to using a R9 290 currently (limited on budget atm). Also in that video I had motion blur on which doesn’t help the FPS situation. So keep that in mind. Motion blur off I get 40+ fps.

All things considered, you should be a-okay using projectiles for the most part even with intensive PFX on them on multiplayer without much impact. Just be mindful of each gun’s max firing rate when the gun uses projectiles :slight_smile:

As for the line trace w/ PFX:

I haven’t personally tried to use a line trace along with a pfx (yet), but that should be do-able from my understanding of things right now. I’ve seen quite a few games that use line-trace (mostly space flight combat games) along with particle effects. Exactly how it is done, not exactly sure off the top of my head and would need to research it (probably will later today).

Pretty cool. Now I guess that you are sitting on a local server? I think the problem that arise from these scenarios are when you have a group of 20 people in a firefight with different pings and connection conditions where replicating an actor is:

  1. Requiring more bandwidth
  2. Requiring prediction logic to hit correctly in bad scenarios etc

However, regardless of that it would be interesting to hear your future perspectives of this (and cool video…)

Yeah, bandwidth and most of the back end networking is stuff I didn’t really touch on at all, mostly because I don’t have enough experience with projectiles with it. But I would assume that if BF4 can pull it off, so could others :stuck_out_tongue:

Jamendxman3 did have a very logical point though about choosing to do it the way he does (good backup in case things get messy performance wise down the line in development). But again it all depends on what you want. I personally am going to go with developing full on with replicated projectiles until I see a need to do it the way Jamend pointed out. Personal preference though :wink:

I think if you spawned an actor with the trace length (invisible to view), you could attach the particle effects to that.

Battlefield uses projectiles on all weapons, don’t know about the others.