Download

recommendation for lots of projectiles

hello to all, i want to ask those who have experienced on what do you suggest in handling lots of projectile…
i’m thinking that making alot of actor projectiles would really be slow…

let’s say, in a space battle scene… there would be alot of projectiles flying around here and there.
i wonder what would be a faster and more efficient way in handling all the projectile rather than using actor blueprint with projectile movement…

correct me if im wrong, but im thinking maybe using particles with collision?
can particles trigger some events when particle collides with something?

please share ideas and recommendations… thank you :slight_smile:

It really depends on how fast those projectiles you want. With small target actors (below 200-300 units thick) you cannot go much faster than 2000-3000 units, else some projectiles just teleport through target.
Also another problem is will this be multiplayer game or purely singleplayer.

For multiplayer i suggest doing all battle logic on line trace, hitscan and delays that depend on distance (if this is space battle).
For singleplayer you can spawn up to 1000 physics projectiles easily, each with some simple particle effect and invisible mesh for physics and collision.

Do not use particles with collision for it, you get multiple problems when trying to get information back from them to your game logic, it is easier to do that other way around: make all game logic based on physics actors, and use particles just for visuals. For eg you do not need to shoot 100 physical actors, instead shoot 10 that do game mechanic stuff and then swarm of GPU particles for visual effect.

two words: Object Pooling

This.

In AIPD we had some weapons that fired a lot of projectiles, like 60 bullets per second per player (4 max local = 240 bullets per second).
We did several things to still hit 1080p / 60 fps on Xbox One.

  • Object Pooling
  • We wrote our own collision system which was much simpler but also roughly 100x faster
  • We rewrote the projectile movement component and removed parts which weren’t necessary for our purposes

So it is possible but it was a lot of work.

It would be just pure single player…
I see, particles are really for eyecandy… :o
Hmm, What do you mean by physics projectile, are they just actor blueprints with projectile movement (is this what you mean)?
any example i can look up about physics projectiles?

unfortunately… i am not good enough to do those other than using blueprints… :o

Nice. Looks like a good game and I’m glad to see a game released with UE4. I don’t think there are any in released yet.