After testing the crowd manager and agents a bit deeper i found some limitations and possible bugs/paradox effects that i really can’t track down what would happen if i do certain things. Maybe we should create another tutorial/discussion topic and discuss these issues because sooner or later other people will face the same problems.
-
SetEnabled doesn’t seem to work with crowd agents. Your only chance to stop the crowd agents from updating and moving is removing the component from the node. That could be a real pain once you plan adding more complex logic to your enemies instead of moving along a path to a certain destination
-
Due to this behavior, another question arises. Consider the following example (Angelscript code)
CrowdAgent@ ca = node.GetComponent("CrowdAgent");
ca.Remove();
This will indeed remove the agent from the crowd but ca still holds a reference to it. So once ca goes out of scope the CrowdAgent object will be deleted. But what happens if in the meantime the crowdManager is removed or recreated ? Will the agents be notified of this change or still use their invalid crowdManager_ weakPtr (which was deleted previously) ?
-
We need more helper functions to have more control over the agents. For simple demo purposes where agents follow a simple path until they reach their destionation the current state is ok but adding logic to enemies requires lot more control and access (length of the current path , path points). How can i activate my agent only if the distance between the player and the agent reaches a certain value without knowing the path distance ?
-
Crowd can only have one target. So if you have two players and you want both of them to be attacked by a crowd of enemies at the same time you can’t do that.
-
I think the ground distance should be irrelevant in crowd navigation. Right now the agents won’t move if the ground isn’t close enough to their feet (still can’t understand how it works but maybe i’m doing something wrong ?) The y position of the agents should be controlled by gravity and the path should be calculated on a ZX plane
So these are the limitations i found in the navigation system. If someone had found some workarounds for these problems feel free to post it here
Thanks