Graphics Reference
In-Depth Information
9 AI Manager
When computer scientist John McCarthy coined the term artificial intelligence (AI) in the
mid-1950s, I doubt anything like the path-finding killer robot cars we will be building in
this topic would have been on his mind.
he AI Controller in this topic is a basic state machine, focused on function rather
than on any kind of emotional simulation. For it to work for the example games later on
in the topic, our AI controller will be able to perform several diferent actions. It will need
to be able to control a vehicle (as in a body, a spaceship, or other moving entity) by turning
and moving forward and backward and using vision to try to avoid obstacles. When we
need the controller to follow a specific path, it should be capable of turning toward and
moving in the direction of waypoints.
Achieving this will require the controller to act differently in several different states.
The BaseAIController.cs states are as follows:
1. moving_looking_for_target
Moves forward, continuously checking the distance between this object and the
target. If the distance is below a set chase distance (maxChaseDistance), then the
AI uses raycasting to check the line of sight between object and target. If the target
is visible, the AIState changes to chasing_target.
Two “feeler” raycasts will be made out from the front of this object, looking for
obstacles. If an obstacle is found on the right, the AIState changes to turn left. If an
Search WWH ::




Custom Search