Hello,
First off, apologies if this has already been answered before, I looked for a similar topic in 3d but nothing turned up from my searches.
I am building a 3d game, in which I would like a large amount of enemies to chase the player : ~50 enemies at the same time would already be a nice target. To guarantee quick pathfinding, I am using a custom made FlowField-based approach.
The pathfinding or collision detection with the terrain works really well with one enemy or large amount of isolated ones. However, when they collide with each other, or when the player collides with them, the game slows down to 10 fps with even as little as 5 enemies (and gets worse with more enemies).
The enemies themselves are for now represented each by a KinematicBody, with as children one Cylinder CollisionShape and a Capsule MeshInstance. Each body is moved using move_and_slide_with_snap
.
The problem is only encountered in situations where they collide against each other continuously for a few frames (for example when they reached their goal, when they are crammed in a small space etc.).
Am I doing something obvious wrong here ?
I tried to be as straight to the point as possible because this doesn't seem to be related to my project in particular, but if this is an uncommon issue I'll happily recreate a thread with more specific details.