A.I. Aritificial Intelligence . STEERING
The Artificial Intelligence is interesting for all. Robots like Terminator, R2D2, DATA  open from the cinema the possibility of  advanced Artificial Intelligence. But
are robots,  like  MARS ROVER that really use this AI . The MARS ROVER is a NASA bot , now is on MARS planet avoiding rocks, avoiding cliffs and looking for appropriate places to their secret purposes. Our Artificial Intelligence document will speak about this teme and  how to apply it on ours games.


We can find three basics AI groups , The problem of physical movement , What graphic I need  use to turn,  to move a unit , etc .This group is called a LOCOMOTION or motor skills. The group  that  decides how to arriving to some point is called  STEERING or task generation. The third group decides as using its abilities to complete their objective. This group is called MOTIVATION or action steering.



All games need implemet some for of steering, is using  to moving the objects around the our word.the first AI that more people implement is Terminator AI. The creature never thing about getting something (health,ammo,armour, etc) only select the more short way to arrive  from his enemy. This code is very easy to understand. 
Teminator Pseudocode:

IF X.Targer.Position >X.Terminator.Position -----> X.Terminator.Position =X.Terminator.Position +1
IF X.Targer.Position <X.Terminator.Position -----> X.Terminator.Position =X.Terminator.Position -1

IF Y.Targer.Position >Y.Terminator.Position -----> Y.Terminator.Position =Y.Terminator .Position+1
IF Y.Targer.Position <Y.Terminator.Position -----> Y.Terminator.Position =Y.Terminator.Position -1

IF Z.Targer.Position >Z.Terminator.Position -----> Z.Terminator.Position =Z.Terminator.Position +1
IF Z.Targer.Position <Z.Terminator.Position -----> Z.Terminator.Position =Z.Terminator.Position -1

Is very easy implemented the inverse algorithm to evading a enemy, only change the  +1 to -1.
Of course is a very primitive system, really is very difficult that our creature arrive to anyplace if found some obstacle.

Bat sellection

The better  solution "STEERING",  is using a technique "PATH FOLLOWING" . On an environment 2D-3D the routes to arrive a target can be many. And some can be better that other,  because in this route you can find a armor, life,  because is the more sort route, etc. Or because it is not dangerous route. 
Route 1
Route 2

But like the "path following" works, first you need create the paths, each map for separate. A path is compound by  origin, a destination and a series of coordinates that indicate the route.Will we usually have an origin and multiple destinations, How we can know that is the best route?. Applying destinations values , this means that I need punctuated each "control point" or destination , in function for example that a door is open , that there are life, ammunition or anything.It is simple, but  is possibly that  using a graph we will understand more  .
Origin  and target
Figure 1.
paths links table
Figure 2.
In the figure 1 ,we can see a origin (Green circle) and a target (Red circle) ,the blue circles are a paths to follow, and the red lines are a paths links.
The figure 2 , is a path table , to walking around the map, we need making a physical connection among the corrects paths, for example to arribe  form "a" path  to
"w"path we need go by "b,e,d" or "h,e,d" or etc.., but the better route? , how I cand find? ,very easy , your  need to give a  path value he , and to add all the paths or contol points value, the more littlel value is the correct  route.
option 1
Figure 3.
Figure 4.
 In the figure 3 and 4 you can see an example, I have assigned  value 1 to all the paths, but  you can optimize this, in function at the distance that  needed to arrive from a point to another. In games like UT or Quake you can found in your route a healt or enemy for example, then the better router is change (f igure 5). to select the new route , you need add a new value to the next path , if the event is good a little values , if the event is bad a big value.

More routes
Figure 5.

by Necro_