PhysX Vehicle AI operator

The PhysX Vehicle AI operator allows you to assign rule-based controls to PhysX vehicles.

The PhysX Vehicle AI operator controls vehicles initialized by a PhysX Vehicle operator. Vehicles with cached inputs will be ignored by the PhysX Vehicle AI operator.


Goal Rollout

  • Goal mode: controls how vehicles determine their goal.

Nearest object: vehicles will attempt to move toward the nearest object in the object list.

Target particle: vehicles will attempt to move toward the specified target particle.

Spline follow: vehicles will attempt to follow along the specified spline(s).

Objects

  • Object list: the list of scene objects to use as vehicle goals, when goal mode is set to nearest object.

Target

  • Channel: the custom float channel used to look up a target particle by its ID, when goal mode is set to target particle.

Splines

  • Spline list: the list of splines to use as vehicle goals, when goal mode is set to spline follow.

  • Spline resolution: the number of samples used to approximate each spline, when calculating the nearest point along it. Higher values improve accuracy on splines with tight curves.

  • Look ahead: the distance ahead of the vehicle’s current position along the spline used to determine its immediate steering target, rather than steering directly at the nearest spline point.

Offset limits
  • Min/max distance: the min/max perpendicular distance from the nearest point on the spline, within which a vehicle’s goal will be bounded. A min/max value of 0.0 means the vehicle’s goal will be set to an exact point on the spline.

  • Variation %: the per-particle percentage of variation to apply.
  • Extrapolate open splines: when enabled, vehicles that reach the end of a non-looping spline will continue to be guided along its extrapolated direction..

  • Follow spline direction: when enabled, vehicles will follow the spline’s knot-order direction (first-to-last knot ordering) rather than toward whichever end is aligned to its forward chassis direction.


Off-course thresholds

Determines when a vehicle is considered to have gone off-course, so corrective steering behavior can engage.

  • Angle: the angle, relative to the vehicle’s goal direction, beyond which the vehicle is considered off-course.

  • Time: how long the vehicle must remain beyond the angle threshold before it’s considered off-course.

Arrival conditions

  • Distance: the distance to the goal within which a vehicle is considered to have arrived and will attempt to come to a stop.

Debug

  • Show line to goal: when enabled, a line will be drawn from each vehicle to its current goal in the viewport, and a circle will be drawn at the end of the line representing the arrival area.

Uniqueness

  • Seed: the seed value for all varied parameters.

Goal Noise Rollout

Goal noise perturbs a vehicle’s steering target with noise, producing more organic, less robotic goal-seeking behavior.

  • Noise mode: controls which noise algorithm will be used.

  • Noise texmap: the texmap that will be used by the noise texmap mode(s).

  • Noise preview: a preview image showing a 2D representation of the selected noise mode.

  • Strength: the strength of the noise (a multiplier on the default noise range of [-1, 1]).

  • Frequency: the speed at which the noise will evolve over time.

  • Scale: the scale multiplier for position values sent through the noise algorithm. Smaller values create larger noise patterns.

  • Roughness: controls the amount of extra detail applicable noise modes will generate.

  • Lacunarity: controls the scale of successive noise octaves for applicable noise modes.

  • Gain: controls the relative intensity of successive noise octaves for applicable noise modes.

  • Iterations/Octaves: controls the number of overlapping noise patterns that applicable noise modes will generate.

  • Phase: provides manual control over the evolution of the noise over time.

Steering Rollout

  • Smooth steering: when enabled, changes to the AI’s commanded steering angle are smoothed using the settings below, rather than being applied instantly. May reduce steering accuracy but prevents overly sharp turning.

Smoothing here uses a stiffness/damping spring model, rather than a simple ramp rate - this allows steering response to naturally vary with how far off-target the vehicle’s current heading is, rather than always changing at a fixed rate.

  • Stiffness: how strongly the smoothed steering value is pulled toward the AI’s actual commanded steering angle.

  • Damping: how strongly changes in the smoothed steering value are resisted, reducing overshoot/oscillation.

  • Min/max velocity: controls the velocity range within which smooth steering will be applied. If a vehicle’s velocity is below the min threshold, smooth steering will not be applied. If a vehicle’s velocity is above the max threshold, smooth steering will be fully applied.


Colliders Rollout

Collision avoidance lets vehicles automatically steer around obstacles (PhysX colliders or other vehicles) detected via raycasts, without needing to be routed around them manually via goal placement.

Object colliders may be added to the sim with a PhysX Collision operator. The PhysX Collision operator must be in the same event as the vehicle chassis rig particle being controlled by the AI, in order for the AI to detect collisions with it.

  • Enable collider avoidance: when enabled, vehicles will cast rays around themselves and steer to avoid detected obstacles.

  • Raycast count: the number of raycasts fanned out around the vehicle used to detect obstacles. Higher values improve detection accuracy and coverage at the cost of performance.

  • Look-ahead distance: the maximum distance ahead of the vehicle that obstacle raycasts extend to.

  • Minimum slope: the minimum slope angle, relative to the ground, that a detected surface must have before it’s treated as an obstacle to avoid, rather than driveable terrain.

  • Smooth avoidance: when enabled, changes to avoidance-driven steering are smoothed using the settings below, rather than being applied instantly.

Smooth avoidance

  • Stiffness: how strongly the smoothed avoidance value is pulled toward the actual detected avoidance steering value.

  • Damping: how strongly changes in the smoothed avoidance value are resisted, reducing overshoot/oscillation.

Debug

  • Show raycast lines: when enabled, obstacle avoidance raycasts are drawn in the viewport. White lines depict rays that hit nothing, red lines depict rays that hit an obstacle.

Boost Zones Rollout

Use tyIcon helpers (in “box” mode) to define boost zones - AI-controlled vehicles passing through them will have various parameters boosted (ex: throttle, max velocity, etc), using the boost settings defined in that tyIcon’s PhysX Vehicle AI rollout. For example, if you have AI-controlled vehicles driving up to a ramp and you want them to accelerate up the ramp in order to launch off the end of it, you can place a boost zone on the ramp and increase its throttle/velocity/torque multipliers. When an AI-controlled vehicle enters the zone, it will apply those multipliers automatically and remove them when it leaves the boost zone.

Zones

  • Zone list: the list of tyIcon helpers used as boost zones.