Chesso,

Sounds like just the kind of thing I was going to implement in our competition entry.

I figured that I would have enemies 'patrolling' on pre-defined paths (or predefined areas). If they spotted you (I implemented a simple line of site system) they would then use A* path finding to get a path to your current location... if they spotted you again on their way, they recalculated their path. If they then lost you, they stood on the spot and looked around for you for a while before returning to a predetermined point and restarting their patrol behaviour. Otherwise, they would pursue you across the map until you either lost them, killed them or they were unable to get past an obstacle.

In reality, our enemies ending up just wandering around the map due to a lack of time, but I figured that the following plan would work...

1. Patrol an area (A), path (P) or stand guard (G)?
2A. Define the area that the enemy can patrol
2P. Define the path the enemy can patrol. This requires a starting point and a series of way points. You can either have the system precalculate the direction or you can use A* path finding to get a path to the next way point.
2G. Define the point where the enemy stands and the directions they look. This could be as simple as they stand here and periodically, they turn to face a new direction... you could be evil and make that action random so players can't spot patterns.

Obviously, these decisions will most likely be made in the editors, so you need to define some data storage for this. You can of course mix these up. The enemy will wander along a patrol path. At a point, he wanders around an area for a while before continuing on a path. He then reaches the end of a building where he stops for a period and looks around before going on his way.

To implement this I planned on having a statemachine built into the base enemy class that implemented all of this. It had various states to indicating whether the character was roaming, patrolling, guarding along with the direction they were facing/travelling. My A* worked by saying go in this direction for X steps. When it got to 0 it popped the next path component from the list and continued.

Sorry theirs nothing in the way of pseudo code, but just some thoughts I had when planning on implementing enemies.