Pathfinding operator

The Pathfinding operator can be used to find a clear path from a particle’s position to a destination point in space

While the pathfinding operator has a “bottleneck avoidance” parameter to help particles find paths around other particles, it doesn’t have an inter-particle collision parameters, to completely prevent particles from colliding while following their paths. To prevent such collisions, use a Particle Physics operator in combination with a Pathfinding operator to better simulate inter-particle collisions.


Pathfinding Rollout

Pathfinding

  • Velocity: controls how fast particles will travel to reach their destination.

  • Variation %: the per-particle percentage of variation to apply.
  • Inertia %: controls the rate at which particle velocity vectors are allowed to change direction each frame. Higher values mean particles will be more likely to maintain their current direction.

Increasing the inertia value can help to smooth particle trajectories and prevent particles from performing overly sharp turns as they follow their path. Values that are too high will prevent particles from effectively following their path.

  • Damping %: controls how much velocity from the prior time step to retain in velocity calculations. Higher values will retain less prior velocity.
Advanced
  • Heuristic: controls which heuristic is used to traverse faces in the pathfinding algorithm. “Distance squared” will often find destination points faster, but may generate less optimal paths while doing so.

  • Max face search: when enabled, limits the number of faces a particle may examine when searching for a path to the specified value. Lower values may result in the pathfinding algorithm termining the search for the destination point before it is found, but may improve performance in cases where pathfinding meshes are extremely dense.

  • Update interval: when enabled, particle paths will be updated every N seconds, where N is the specified interval value. Disabling this option means a particle will only search for a path to its destination once (when it enters the event).

  • No path smoothing: when selected, paths will not be smoothed and will lead from face-center to face-center to the destination point.

  • Smooth paths (funnel): when selected, a funnel algorithm will be used to smooth paths from source point to destination point. The funnel algorithm (aka “string pull” algorithm) tightens paths across faces as long as a proper line-of-sight across faces is maintained (no border edge is crossed).

  • Smooth paths (midpoint): when selected, paths points will be shifted from face centers, to adjacent edge midpoints.

  • Enable path relaxation: when enabled, paths will be normalized (if normalization is enabled) and then relaxed by the specified strength/iteration values. This process is performed after (and in addition to) any initial path smoothing.


Test TRUE if

  • Distance to end of path less than: particles will satisfy the test condition if the distance to the end of their path is less than the specified value.

  • Distance to destination less than: particles will satisfy the test condition if the distance to the their destination is less than the specified value.

A particle’s destination point may not actually exist on the pathfinding mesh, meaning that the end of their path on the pathfinding mesh may not be equal to their specified destination point. That is why two test parameters were added - one for distance to path end and one for distance to destination. That way, you can test if a particle is near the end of its path even if it’s far from its destination, and vice versa.

Uniqueness

  • Seed: the seed value for all varied parameters.

Display Rollout

  • Show path: when enabled, path lines will be displayed in the viewport.

  • Show path points: when enabled, path points will be displayed in the viewport.

  • Show traversed faces: when enabled, faces traversed by the pathfinding algorithm (including faces that were examined but discarded during the path search) will be marked in the viewport.

  • Show traversed face weights: when enabled, the combined avoidance multipliers of traversed faces will be displayed in the viewport.

  • Show line to destination: when enabled, a line between a particle’s position and its destination will be displayed in the viewport.


Meshes Rollout

  • Pathfinding meshes: these are the meshes that will be traversed during the pathfinding algorithm’s search for a clear path from particle position to particle destination. The start point of any given path will be the nearest point between a particle and the pathfinding meshes, and the (ideal) end point of any given path will be the nearest point between a particle’s destination and the pathfinding meshes.

The pathfinding algorithm maps out adjacent faces and their proximity to the destination point as it searches for a path from a particle’s starting location to its destination. If a single, connected set of faces do not lead to the destination, the pathfinding algorithm will not be able to find a suitable path to the destination. You can use a tyMesher object (in “pathfinding mesh” mode) to create a suitable pathfinding mesh, although any mesh with proper face connectivity will suffice.

Surface snap

  • No surface snap: particles will never be snapped to the nearest point on a pathfinding mesh.

  • Snap to surface on first frame: when enabled, particles will be snapped to the nearest point on a pathfinding mesh on the first frame that they enter the event.

  • Snap to surface on all frames: when enabled, particles will be snapped to the nearest point on a pathfinding mesh on all frames that they are in the event.

  • Snap projected position: when enabled, the projected position of a particle (its position post-velocity-integration) will be snapped to the nearest point on a pathfinding mesh. This prevents fast-moving particles from overshooting the pathfinding mesh as they move over its surface.


Destination Rollout

Destination

  • Custom vector: when selected, the destination point of a particle will be the vector value assigned to it in the specified custom property vector channel.

  • Object (closest point): when selected, the destination point of a particle will be the closest point on any of the specified destination objects.

  • Object (closest pivot): when selected, the destination point of a particle will be the closest pivot point of any of the specified destination objects.

  • Object (random pivot): when selected, the destination point of a particle will be a random point on one of the specified destination objects.

  • Target position: when selected, the destination point of a particle will be the position of its target particle, if it has a valid target assignment (in the specified custom property float channel).

  • Wander: when selected, the destination point of a particle will be a constantly changing random point on the surface of a specified destination object.

Wander

Wander mode generates random paths/motion by continually reseeding a particle’s destination point, based on various criteria, causing particles to “wander” around by continually changing their path/destination.

  • Constrain reseed radius: when enabled, the destination point of wandering particles will always be within the specified radius from the particle’s current position.

  • Reseed when on destination face: when enabled, wandering particles will choose a new destination when they reach the nearest face of their current destination.

  • Reseed within destination proximity: when enabled, wandering particles will choose a new destination when they come within the specified proximity threshold to their current destination.

  • Reseed after time elapsed: when enabled, wandering particles will choose a new destination every N seconds, where N is the specified reseed time value.

  • Variation %: the per-particle percentage of variation to apply.

Destination tracking

  • Save destination: when enabled, a particle’s destination value will be saved to the specified custom property vector channel.

Uniqueness

  • Seed: the seed value for all varied parameters.

Avoidance Rollout

Bottlenecks

  • Enable bottleneck avoidance: when enabled, the specified avoidance multiplier will control how much particles will attempt to avoid each other while searching for paths to their destination.

Higher values means particles will make more of an effort to try and find paths around each other. This parameter works best when the average size of a face in the pathfinding mesh is roughly the size of a particle.

Angles

  • Enable angle avoidance: when enabled, the specified avoidance multiplier will control how much particles will attempt to avoid pathing to steep faces, relative to the face they’re currently on.

If a face is perpendicular to another face, it will have a relative angle of 90 degrees. If a face is parallel to another face, it will have a relative angle of 180 degrees. If a face is so steep that a particle would need to travel upside down in order to move to its surface, it will have a relative angle of less than 90 degrees. By leveraging the angle avoidance parameters, you can prevent particles from choosing paths that would require them to travel upside down (relative to their starting face) to move from one face to another.

  • Angle min/max: the angle curve will be interpolated based on a face’s angle relative to these min/max values.

  • Angle curve: controls how much the angle avoidance parameter will affect overall face weight, relative to the angle min/max values.

Slopes

  • Enable slope avoidance: when enabled, the specified avoidance multiplier will control how much particles will attempt to avoid pathing to steep faces, relative to the world.

Adjusting the slope avoidance parameters allows you to control how difficult it will be for particles to choose paths up steep slopes. Higher values means particles will make more of an effort to find paths that avoid steep slopes.

  • Slope min/max: the slope curve will be interpolated based on a face’s world-space angle relative to these min/max values.

  • Slope curve: controls how much the slope avoidance parameter will affect overall face weight, relative to the slope min/max values.

Material IDs

  • Enable material ID avoidance: when enabled, the specified avoidance multipliers for material IDs 1-5 will be applied to any faces on the pathfinding mesh with a matching material ID.

The material ID avoidance parameters allow you to manually define areas on a pathfinding mesh that should be more difficult to traverse than other areas. By increasing the material ID avoidance values for matching face material IDs, you can encourage particles to avoid certain areas of a pathfinding mesh. The higher the value, the less likely a particle’s path will include faces with the matching material ID.

Random

  • Enable random avoidance: when enabled, avoidance multipliers for faces will be multiplied by the specified random variation.

Increasing the random avoidance value will make faces on the pathfinding mesh more difficult to traverse by a random amount. This allows you to add variation to the paths that are generated for each particle. The denser the pathfinding mesh, the more noticeable the effect of random avoidance will be on generated paths.

  • Exponent: the random variation amount will be raised to this power, allowing you to increase or decrease the overall spread of random values.

Tools Rollout

  • Extract paths as splines: clicking this button will convert particle paths (at the current frame) into an editable spline object in the scene.