Performance: Projectiles with Mesh and Material OR just effect?

Hi,

i am at a point where i have to create projectiles.
In my game there will be a lot of projectiles cause there are a lot of space ships and each of them
can fire a lot of projectiles within seconds.

For prototyping purposes i have created a projectile template with actor as parent, a capsule component, a static mesh component and a projectile movement. I have given the mesh a material with a glowing color. Looks pretty nice.

But now i do not know, if i shall keep this projectile or delete the mesh and attach an effect to it.

It is just a performance issue cause in the game there will be 10k-30k projectiles at the same time.

Does anyone has experience with that?

Thanks in advance and have a nice day :smiley:

if you want 10-30k projectiles at once, besides the collision module that will eat your performance like a fat frog eats flies, if you’d add meshes to that, you’d have 10.000-30.000 drawcalls from that…
that just wont do.

So shall i use effects? How can i detect a Hit without collision? Overlap?

Thanks in advance

well… anything can be an effect, meshes, ribbons, beams, that bird that just passed your window, etc.

As for the overlap/hit detection (i dont know which one is more performant) make sure its set up so that it only needs to look for the stuff it should impact/contact with, and not everything in your level. that will help.

you could also fake having more projectiles than there are by grouping i.e. 4-5 rockets/lasers as one effect with one collision.

I would suggest just testing and see how far you can push it.

Thanks. I will try. Merging projectiles is not possible cause all weapons have different rates of fire. But i will increase the rates so that less projectiles can be fired in a second.

One last question: The projectiles shall keep different values like weapon type, dmg, crit%, etc. Does variables within projectiles decrease performance very much?

Thanks in advance

I would make the projectiles a childactor of a parent that has all that math.
It should be fairly cheap.