I agree that a good AI needs a good pathfinding system. Else they walk against walls etc.
I'm following Skaters topic a long time yet and I read about his path finding workshop.
Cyberkid, I hope you want to share your pathfinding with us if it is finished.
And Ronny, I'm really excited to see what you are going to make. It must be almost the same as Half-Life.
And if we can make something like that, we can create a much better AI.

But now about my advanced(?) state_hunt. It is not really difficult. You just change state_hunt into this:

code:

function state_hunt()
{
MY._STATE = _STATE_HUNT;
create(<arrow.pcx>, PLAYER.POS, _last_know_target_loc);
ent_marker = MY.ENTITY1;
// calculate a direction to walk into
temp.X = ent_marker.X - MY.X;
temp.Y = ent_marker.Y - MY.Y;
temp.Z = ent_marker.Z - MY.Z;
vec_to_angle(MY_ANGLE,temp);
MY._TARGET_PAN = MY_ANGLE.PAN;
// turn towards target
MY_ANGLE.PAN = MY._TARGET_PAN;
MY_ANGLE.TILT = 0;
MY_ANGLE.ROLL = 0;
force = MY._FORCE * 2;
actor_turn();

hunt_transitions();
patrol();
}


Now change
"scan_sector.PAN = 360;" in
"scan_sector.PAN = 180;"
(actors.wdl, actor_patrol).

Also remove all
"IF(MY._HEALTH <= 20) { EXCLUSIVE_ENTITY; wait(1); BRANCH state_escape; }"
(war.wdl).

This is not necessary, but escape looks horrible, they just walk away until they hit a wall and then they do nothing.

I shall explain what these changes do:

If an enemy now loses the player, he starts patrolling over a path from positions until he finds the player.
He first turns towards the player to move into the right direction. He only scans in front of him, so he doesn't make big turns, this looks bad. This is a lot better than the standard state_hunt that just approaches the player until it gets stuck in a wall. But with the new state_hunt you have to add a path of positions in your level, this is rather difficult and costs a lot of time. But then you're having a better AI. Of course there are better solutions with other ways of pathfinding, but this is a good start, especially for A4 users like me. Hope everyone wants to help improving this code or thinking of better ways of pathfinding in A4.

Also check out http://www.conitec.net/ubbcgi/ultimatebb.cgi?ubb=get_topic&f=1&t=002434 for more pathfinding.