Blueprint Only
I am experimenting with figuring out an optimized way to handle projectile pooling with static meshes
Let’s say 1000’s of projectiles for sake of argument
I have done some research, but still not clearly understanding the best way to go about this
I have made an Object Class “Projectile_Manager” to handle the pooling logic as well as updating projectile positions
Projectiles are simple static meshes with simple collision (capsules or sphere)
At first, I was just going to test spawning Static Mesh Actors (Nanite Enabled) but then figured better optimization would be to somehow use Instanced Static Meshes, but in researching, it seems you cannot specifically disable visibility for specific instances for instanced static meshes? (Disregard changing alpha on material, as the object would still be rendered no? Not to mention higher cost for transparency?)
With UE5 and Nanite, would spawning Static Mesh Actors not be so much of a concern anymore? And thus, save me development time instead of developing a static mesh instancing system?
For static Mesh Instancing, if I cannot set visibility for individual instances, would I just simply need to move the transform of projectiles of screen so they will be culled ad I wont have to set visibility?
And, ISM have to come from a static mesh component, which I was thinking perhaps I would have my projectile manager be a single actor hidden in game, but then all the instances would be hidden as well no?
It would take me forever to test all the scenarios, so was hoping I could get some feedback on pros and cons or what is/not possible?
Right now, I am working with the projectiles as Data Assets for the projectiles information, but have also wondered if I should just make a custom child class of StaticMesh Actor for each projectile type with a standard base class instead of using data-assets? I use a soft reference to the data asset to keep track of projectiles using a map of data asset → struct(static mesh actor array)