I'd really like to know how you'd go about optimizing this? 20 actors each spawning 8 projectiles per 0.1 sec which are then destroyed 0.8 seconds later, all done through blueprints Gif: https://gyazo.com/eab053741012405926193c6302ef84a7

Pictures: enter image description here enter image description here

I thought about pooling but not sure if it's okay to have 1000 projectiles on standby since I know spawning and destroying is costly but going though all, picking one to re-locate and initializing the projectile per character might also be a problem, what cha say? other options? I can totally do pooling if that's the only way

Would really appreciate some tips/practices. Thank you all!

  • 1
    \$\begingroup\$ I suggest you test pooling and continue from there :) \$\endgroup\$
    – Vaillancourt
    Aug 2, 2020 at 5:14
  • \$\begingroup\$ Pooling seems an optimal solution: although you have a certain number of pooled objects, they are just stored in memory but are not executing code unless spawned back in the game. And alll you need is to set a projectile position and direction, then start playing its animation, and that's cheaper than instantiating projectiles continuously. \$\endgroup\$
    – liggiorgio
    Aug 2, 2020 at 13:06
  • \$\begingroup\$ I can't express how much better performance pooling has. If you think changing an object's position, or iterating through an array of 1000 objects is heavy, wait until you hear what happens behind the scenes when initialising a new object and destroying it. \$\endgroup\$ Aug 7, 2020 at 9:21


You must log in to answer this question.