Calculating the Combined Steering Force

Every update cycle the steering force for each Vehicle is calculated. When steering behaviours are combined the overall change in the Vehicle's motion depends on the method used to calculate the overall force, the library has two methods for the user to choose from.

Before describing them a some points of note are -

  • every Vehicle has its own auto-pilot force calculator (sharing is not allowed)
  • the method to use can be different for different Vehicles because every Vehicle has its own auto-pilot - sharing is not allowed!)
  • each steering behaviour has its own weighting which affects the relative importance of different behaviours when calculating the overall steering force.

Weighted Truncated Sum

In this method the weighted force for each active steering behaviour is calculated and summed. The total force is capped by the vehicle's maximum force. Although a simple method it does have some disadvantages

  • every active weight is calculated on every update cycle
  • the behaviour weights can be very difficult to tweak
  • does not handle conflicting forces well.

The last once is the biggest problem, for instance an agent might be pressed against a wall from the pressure of other agents. The separation force might be greater than the wall's repulsive force and the agent is 'pushed' through the wall.

Weighted Truncated Running Sum with Prioritisation

This is the default method and is similar to the weighted truncated method but the steering behaviour forces are calculated in priority order. For each active behaviour the weighted force is calculated and some or all of it is added to a running total ensuring that the Vehicle's maximum force is not exceeded. As soon as the maximum force is reached no further active behaviours are considered.

The priority order is -

  1. Wall avoidance
  2. Obstacle avoidance
  3. Evade
  4. Flee
  5. Flocking
  6. Separation
  7. Alignment
  8. Cohesion
  9. Seek
  10. Arrive
  11. Wander
  12. Pursuit
  13. Offset pursuit
  14. Interpose
  15. Hide
  16. Path following