(01-26-2011, 08:28 PM)Seragath Wrote: Okey okey..Let me just understand this with a path node..If I place a path node somewhere on my map. Does any monster that walks by follow it (If it somehow detects the player) or am I forced to use the command "AddEnemyPatrolNode" So that the monster knows it's attached to that exact path node ?. If that's the case and "AddEnemyPatrolNode" is not needed at all...I'll get a better understanding why my monsters have horrible, horrible ai pathing.
Shev's response is not entirely correct. PathNodes will help monsters to navigate around obstacles even if they are not tied directly to each other, or if the monster is not tied directly to them, as long as the monster is tied to another node farther along the line. All nodes are used by all monsters when chasing Daniel or re-orienting to their former patrol routes after losing sight of Daniel, though they will not stop on nodes unless they are specifically told to do so.
For example, if you had ten nodes winding through hallways from PathNode_A to PathNode_B, and nodes A and B were not in line-of-sight of each other, but could be reached by following a series of the other nodes, the monster will follow the node path (calculated, I assume, by shortest total distance) until it gets to B.
If Daniel is seen along the route, the monster will abandon its path and begin chasing him. If he disappears, the monster will attempt to get back to its next patrol node (assuming Daniel appeared before the monster reached B, it would head towards B).
If the area is well-populated by nodes, the monster will be able to re-calculate a path based on its current position when it loses Daniel and be more successful in reaching B. Otherwise, it will have to path back towards those nodes that do exist or else attempt to walk directly towards B, only diverting in the case of walls or other obstacles.
Using a ShowEnemyPlayerPosition function becomes much more effective when there are nodes throughout the map, allowing monsters to path as quickly as possible to the player's location.
I believe, but have not tested, that monsters also use nodes during their "search" stage of chasing Daniel, i.e. right after he loses them and they are still actively looking for him (rather than "investigating" noises or "patrolling" between designated nodes).