Can I Modify Specific Particles in Niagara? (Version 4.26.1)

Hello everyone,

I have been running into limitations while making a 2D bullet hell (shoot-em-up) game, featuring thousands of projectiles on the screen at once made with Paper2D sprites.

As you can imagine, this really pulverizes the Draw Call performance, and I have decided to try using Niagara to draw the bullet sprites alongside the bullet actors, since this seems to be the only way to draw multiple sprites in one draw call (if there is in fact another way, please let me know).

My plan is to create an emitter with an initial burst of 4000 bullet sprite particles (the max amount I plan to use), and have them start off invisible and lasting indefinitely. Every time an enemy bullet is fired, I want the bullet actor to select a particle by numerical index, make it visible, control its position, and choose what sprite to use through C++. If the actor is destroyed, it makes the particle invisible again and stops moving it.

My question is, is this possible?

And if so, how would I be able to go about doing this? It’s pretty rough finding the right methods to accomplish this. Is there a ‘GetEmitterParticleByIndex(int)’ method somewhere?

If I cannot get particles by index, can I instead just spawn a single particle from the bullet actor and keep a reference to it so it can be controlled?

Please let me know, as my game project hinges on this one issue. If this cannot be solved, I may have to switch to another engine, or god forbid make my own.

Thanks!
~Sol

Hi,

I was looking into it myself sometime ago and I don’t think that there is a way to reference a particular particle.

Based on what you’re trying to do Niagara may not be the best solution. you may control the position of the system and emitter, but the particles themselves are somewhat beyond your reach as their data can be used only within the Niagara itself (e.g. when you need to communicate the position to another emitter).

Also, moving the 4k sprites would still produce a decent amount of draw calls, so I’m not sure what’s your gain here.

The alternative to Niagara (to preserve the draw calls) would be Instanced Static Meshes (ISM) or Hierarchical ISM. These components are used with Foliage and are optimized for drawcalls when use same material.

You can find info on these components here:

However you should know, that updating hundreds of instances simultaneously would still produce the FPS drop, so make sure you create all instances at once and update the position for them in pools.

Also there are a set of limitations to them on mobile, baked lighting (although I don’t think it would be the case for you), etc.

1 Like

Thanks a million! This saved my project haha.

I was able to get 4000 bullets to render while still maintaining 60FPS.

Thank you!

Glad I could help

1 Like