Archive 17/01/2023.

Preventing entities from overclustering

throwawayerino

I’ve got a player with a group of AIs after it. Problem is when the player moves they all follow the same path and clip into each other. Would physics collision help fix this?

Dave82

Are you using the CrowdManager and CrowdAgents ? Don’t use physics, it will mess things up even more. Can you show some code ?

throwawayerino

I experimented with physics and so far nothing exploded. I am using FindPath() for each character. Are CrowdManagers more efficient/better for moving targets?

Modanung

CrowdManagers are meant to be used for groups of entities. Sample 39 demonstrates their use.

Alternatively you could apply the basic rules of swarm behaviour to your AI:

  • Move in the same direction as their neighbours
  • Remain close to their neighbours
  • Avoid collisions with their neighbours

Casting spheres could help with determining which neighbours each AI should “pay attention to”.

GodMan

I used a simple capsule for my NPC’s. They use a crowd-manger just fine. You do have to be careful with the physics though. It causes strange behavior.

Also I believe their is a limitation to using a crowd manger, for example the agents can only go to one position or track only one position ieg: track the players position.