MoveComponent Severe Performance Issues?
I have been messing with the TwinStickShooter example project to learn how to use UE4. I have created an Enemy Pawn (AEnemy) which has a very simple behavior in its tick function: it finds the closest player and moves towards them. They also detect when they are overlapping with other AEnemy objects and push themselves away from each other.
My issue is that when I get to a certain threshold of spawned enemies (about 100 to 200), the game starts to lag horribly, and it only gets worse exponentially as they keep spawning. I understand how performance works in game engines, but this just seems like far too low of a number of spawned actors so I am just assuming I am doing something wrong here. This is what my profiler is showing:
Now, I don't know if I am reading this correctly since I am very new to the engine, but it seems like all the time loss is coming from the MoveComponent function inside of the Enemy class' tick function. I don't understand how this could be draining so much time though, since I am literally using the verbatim example from the player Pawn class that gets created with the example project:
Is this the wrong method of moving around pawns? Is the engine just not capable of handling 100-200 Pawns all moving around simultaneously? Am I just reading the profiler incorrectly? I have so many questions about this but I can't seem to find any existing answers on this subject on here or elsewhere on the internet... I hope someone can help me figure this out. Thanks in advance!
asked Dec 06 '16 at 02:56 PM in C++ Programming
Follow this question
Once you sign in you will be able to subscribe for any updates here