|
WHAT IS 3D RAD? CLICK HERE TO FIND OUT!
|
|
|
CarAI
The CarAI object will drive your vehicles along a pre-defined path,
trying to avoid collisions with obstacles and other vehicles by applying artificial intelligence algorithms.
Optionally, the A.I. alogorithms can be 'reversed' or 'mixed' to achieve different behaviors like
trying to run into specified targets or drive away from certain objects, either forward or in reverse.
To use this object in your project, the first step is setting up all vehicles in the project so that they can be
driven by using human input controls.
This is necessary because the CarAI object, just like a human being, cannot
drive a car that doesn't provide proper handling.
Once you have tweaked your cars, for each vehicle you want to control, just add one CarAI object to your project.
Then link it to the car object to control, to the Path to
follow and to all obstacles to avoid.
Please see this tutorial for details.
After you have linked the CarAI object to all these elements, double-click the CarAI object
in the Object List to open the following property dialog:
Working At Start
If this option is not checked, artificial intelligence (and the
controlled vehicle) will only operate after the object is started by another object,
like for example EventOnInput.
Obstacle dodging
Minimum scanner depth.
The distance, in meters, at which an obstacle can be detected depends on controlled vehicle's speed.
This factor specifies the distance when vehicle speed is zero.
Max. scanner amplitude.
Typically, maximum scanner amplitude should be about vehicle width / 2 (meters).
The bigger the factor, the higher the chances to detect a small obstacle. However,
setting this factor too big may cause the vehicle to react on obstacles that aren't actually on vehicle's path.
Driving carefulness.
The bigger the factor, the sooner the vehicle will react to avoid collisions.
The value must be between 0 and 10.
Max. front deviation angle.
This value, in degrees, between 0 and 180, will determine how far from the ideal path the controlled
vehicle can go to try avoiding a frontal collision.
Setting this value too big may cause unsteady driving.
Setting it to low may prevent the vehicle from avoiding obstacles.
Max. side deviation angle.
This value, in degrees, between 0 and 180, will determine how far from the ideal path the controlled
vehicle can go to try avoiding collisions with other vehicles on its side.
Setting this value too big may cause excessive reaction.
Setting it to low may prevent the vehicle from avoiding contacts.
Deviation return time.
Approximate time, in seconds, required to return to the ideal path, after a deviation (see above).
Enable unblock maneuver.
If this option is checked, the controlled vehicle will try to free itself when stuck somewhere.
Path following
Minimum throttle.
If this parameter is lower than 1, the vehicle will slow down when turning.
Minimum value is 0. Maximum value is 1.
Maximum throttle
You can prevent the controlled vehicle from going full-throttle on straights by setting this factor to any value below 1.
Minimum value is -1. Maximum value is 1. Use negative values to make the car go reverse.
Brakes
If this factor is above 0, the controlled vehicle will apply the brakes when an obstacle is detected.
Minimum value is -1. Maximum value is 1.
Path fuzziness
If this factor is above 0, the controlled vehicle will follow a slightly different path from
the one defined in the linked Path object.
The bigger the value, the bigger the alteration. Maximum value is 1.
Randomizer
If these factors are above 0, the corresponding parameters on the left (Minimum throttle,
Maximum throttle and Brakes) will be randomized by applying a variation.
For example, if you set Maximum throttle to 0.7 and its randomizer value to 0.3,
when the simulation is started the actual Maximum throttle used will be between 0.4 and 1.0.
Note that final value is still capped within its range. So, for example, if you set
Maximum throttle to 1.0 and its randomizer value to 0.3, resulting value will
be between 0.7 and 1.0.
A.I. Mode
Avoid.
Follow the path, trying to avoid the obstacles.
Chase.
Drive towards the closest target, but try to avoid direct collisions with it.
Typically, the Brakes parameter in the Path following section is non-zero
to cause the vahicle to slowdown or stop when close to the target.
Note that any path is ignored when this AI mode is used.
Target.
Try to run into the closest target. Note that any path is ignored when this AI mode is used.
Flee.
Drive away from all objects specified as OBSTACLE/TARGET in the Relationships list,
but also follow the specified path if possible.
Relationships
This list defines how the CarAI object relates to the objects linked to it.
The following relationship types are supported:
IGNORE. Do nothing.
DRIVABLE VEHICLE. This object is the vehicle to manage.
This is typically a Car.
Only one single vehicle can be managed by one CarAI object.
OBSTACLE/TARGET. This object is an obstacle to avoid.
This is typically a dynamic RigidBody object in the project or
another vehicle.
Do not set the road/terrain object as an obstacle, or your AI vehicle will get really confused!
PATH. This object is a Path to follow.
If multiple paths are set this way, one is picked randomly among them, when the simulation starts or,
run-time, when the CarAI object is reset.
Other dialog controls
For information about the remaining controls, please click here.
INTERNAL PARAMETERS
The following internal parameters can be accessed by using event objects like
EventOnValue or Script:
Maximum throttle, between 0 and 1
A.I. mode (0-3, write-only)
|
|