Struct RVODestinationCrowdedBehavior

Public

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

Inner Types

Public Methods

ClearDestinationReached ()

Marks the destination as no longer being reached.

Public
OnDestinationChanged (newDestination, reachedDestination)
Public
ReadJobResult (jobResult, index)
Public
RVODestinationCrowdedBehavior (enabled, densityFraction, returnAfterBeingPushedAway)
Public
Update (rvoControllerEnabled, reachedDestination, isStopped, rvoPriorityMultiplier, rvoFlowFollowingStrength, agentPosition)
Public

Public Variables

densityThreshold

The threshold for when to stop.

Public
enabled

Enables or disables this module.

Public
lastJobDensityResult
Public
lastShouldStopDestination
Public
lastShouldStopResult
Public
progressAverage
Public
reachedDestination

True if the agent has reached its destination.

Public
reachedDestinationPoint
Public
returnAfterBeingPushedAway

If true, the agent will start to move to the destination again if it determines that it is now less crowded.

Public
shouldStopDelayTimer
Public
timer1
Public
wasEnabled
Public
wasStopped
Public

Public Static Variables

DefaultPriority
Public Static
MaximumCirclePackingDensity
Public Static
MoveBackPriority
Public Static
StoppedPriority
Public Static