Controls if the agent slows down to a stop if the area around the destination is crowded.
The main idea for this script is to
Reduce the local avoidance priority for agents that have reached their destination once.
Make agents stop if there is a high density of units around its destination.
'High density' is defined as: Take the circle with the center at the AI's destination and a radius such that the AI's current position is touching its border. Let 'A' be the area of that circle. Further let 'a' be the total area of all individual agents inside that circle. The agent should stop if a > A*0.6 or something like that. I.e if the agents inside the circle cover over 60% of the surface of the circle. The 60% figure can be modified (see densityThreshold).
This script was inspired by how Starcraft 2 does its local avoidance.
A* Pro Feature:
This is an A* Pathfinding Project Pro feature only. This function/class/variable might not exist in the Free version of the A* Pathfinding Project or the functionality might be limited.
The Pro version can be bought here
Marks the destination as no longer being reached.
The threshold for when to stop.
Enables or disables this module.
True if the agent has reached its destination.
If true, the agent will start to move to the destination again if it determines that it is now less crowded.