Hello, I was wondering if there was any good way of significantly reducing the performance load of hundreds of projectile actors? Currently the actors do not get destroyed (which is something that will be addressed in the future) however is there any way rendering wise to reduce their performance load? pretty new to unreal so any tips would be greatly appreciated
Example of why I need help to graphically optimise
(Potential volume warning)
Destroying the actors will probably speed it up - does it still run slow if you fire just one or two arrows after firing about as many as you have in the video? If so, that is what it will be. You could maybe also add some LODs to the arrows so they use less triangles further into the screen.
I second that. As a first cut, clean up those actors. You can at least test if that helps out by setting the life span of the cannon ball actor on begin play with the SetLifeSpan blueprint node (assuming youâre in blueprint of course). Set it to whatever you think is reasonable and the actors will be auto-destroyed after the timer runs out.
You need to profile the performance drop. Itâs much more likely a CPU bottleneck than a GPU bottleneck. My guess is that your projectiles are simulating physics, and a large number of simulated bodies is causing the frame drop.
Whether itâs a GPU or CPU bottleneck, destroying the old projectiles will help.
thankyou very much for the tips, ill attempt to apply them when the work day starts again tmrw, ill reply how it went, the game is goin to be quite chaotic as the amount of cannonballs is going to be the general amount as there will be several enemies with atleast two or three layers as much but then again im talkin about several enemies.
Besides the number of actors absolutely destroying the framerate, would i assume correctly that spawning that amount of actors in a single frame would cause additional lag as well? as well as any ways to optimise the actual âshipâ itself when it comes to that amount of child actors on the parent actor?
I added LODâs and that improved performance thankyou, do you reckon that that the number of actors being spawn on a single frame possibly be a reason as well for the frame drops?
Glad that worked out. Like @BananableOffense suggested itâs likely due more to the fact that all of the actors are simulating physics vice just being alive. I would suggest you start looking into instanced static meshes. From what I can see you have the perfect case for it as all of the cannon balls fired are following the same trajectory just with an offset based on the cannon they were fired from.
In a nutshell, instanced static meshes allow you to create a single blueprint with multiple instances of your objectâŚin your case the cannon balls. At that point you can spawn a single actor, with physics being simulated on just that actor, and all of your cannon ball instances go along for the ride. Youâll of course need to add the logic at runtime to spawn the actor with how ever many cannon balls you need and then just offset their transform to be in the position you want. Sounds like a fun puzzle to solve. Below is a good example of this. He creates an astroid belt with 35000 astroids and manages to maintain 120 fps . All of this of course assumes that you donât really need to simulate physics on every actor, which is what it looks like from the video. Good luck!!