I finally need to hide pawns now but I’m not sure of the proper way of “pooling” them. Don’t know if pooling is the appropriate term, for this case they are all spawned on begin play but never be respawned once dead, the game ends when they are all dead.
I have flying pawns (fishes) which consumme a bit of fps (average 1.6 fps/pawn) and they are concentrated by flocks on the map. I can’t put a lot of them in a single visible flock due to their performance, but the problem is that invisible pawns consume ressources as well.
What I’ve done is set a culling distance for the skeletal mesh, and on a timer (2 seconds) each pawn checks if this distance is reached, if so they call unpossess on their controller, set animBP to none and disable tick. This is first call on begin play :
With 0 pawn, the average fps is 85-90, but with 50 in the same flock (and no other on the map) it decreases down to 10 fps. When all are culled it goes up to 30-35 which means that they still consumme a lot (this prevent me for placing other flocks on the map). I’ve noticed that unpossessed controllers continue to run the behavior tree, but I’ve tried to destoy them and it makes no difference on the fps (and I don’t known how to respawn them anyway), tried also to set the animation mode, no differences.
So my question would be : how can I make a distant and invisible pawn not consumme anything (or almost nothing)?
All I’ve found on google is to unpossess and set anim bp to none but apparently it is not enough.
PS: I don’t plan to have so much pawn on a flock for the moment, 5-15 would be enough, but I’d like to have several flocks on the map. I’ll wait 4.23 to see if automatic mesh instancing can help with skeletal mesh performance, or maybe consider to do vertex anim and instanced static meshes (but then the problem for me will be pathfinding, and vertex anim of course:o)