Frictional Games Forum (read-only)
Question about PathNodes for enemies - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods - Development (https://www.frictionalgames.com/forum/forum-38.html)
+---- Forum: Development Support (https://www.frictionalgames.com/forum/forum-39.html)
+---- Thread: Question about PathNodes for enemies (/thread-9761.html)



Question about PathNodes for enemies - TimmayIsHawt - 08-14-2011

I was wondering, do enemies go in an order when they go through different path nodes or do they just go in a random order?


RE: Question about PathNodes for enemies - Kyle - 08-14-2011

They go in the order you set them in. In a function, it will do the first path node that is set up for the monster and then work it's way down the function following the order. If they went in a random order, there would be no easy way to set a monster up with path nodes. Tongue


RE: Question about PathNodes for enemies - TimmayIsHawt - 08-14-2011

Okay thanks Big Grin


RE: Question about PathNodes for enemies - Your Computer - 08-14-2011

(08-14-2011, 10:30 PM)Kyle Wrote: They go in the order you set them in. In a function, it will do the first path node that is set up for the monster and then work it's way down the function following the order. If they went in a random order, there would be no easy way to set a monster up with path nodes. Tongue

It should be noted that when adding a patrol node with AddEnemyPatrolNode(), you do not need to specify every single pathnode in the map. For example, let's say the user has 5 pathnodes in the map lined up in a straight line. In the script, he would only have to add the first and fifth pathnode with AddEnemyPatrolNode(). The AI would know what to do from there.


RE: Question about PathNodes for enemies - Phoroneus - 08-14-2011

(08-14-2011, 10:53 PM)Your Computer Wrote:
(08-14-2011, 10:30 PM)Kyle Wrote: They go in the order you set them in. In a function, it will do the first path node that is set up for the monster and then work it's way down the function following the order. If they went in a random order, there would be no easy way to set a monster up with path nodes. Tongue

It should be noted that when adding a patrol node with AddEnemyPatrolNode(), you do not need to specify every single pathnode in the map. For example, let's say the user has 5 pathnodes in the map lined up in a straight line. In the script, he would only have to add the first and fifth pathnode with AddEnemyPatrolNode(). The AI would know what to do from there.

To extend this a bit, it's not a bad idea to fill all of the area that a monster might traverse with a node grid. Most might never be used, but when monsters "investigate" a sound, they attempt to path to the node nearest the place that the sound was heard. If none are nearby, the monster doesn't go anywhere unless the area is in direct LOS. If the player puts stuff in the intended path, the monster will get stuck without a grid of alternate paths to take, so make sure all walkable floorspace that the monster might need to go to (such as every room the player could hide in) has a node grid above it.