Frictional Games Forum (read-only)

Full Version: Enemy not following - Walking into walls
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello Frictional Games forum, it's been a while

I've been looking a while for a way to fix this, enemies completely ignore the fact that there's a wall in front of them. So when chasing, they just walk against the wall (when the player moves behind corners etc.).

I'm assuming it has something to do with the pathnodes, but I'm not sure how to use them in a way that'll fix this problem. Every pathnode tutorial I look up only covers the looping enemies and the basic stuff. On the other hand, it might have something to do with the map modeling hence the multiple issues prefix.

I'm looking forward to you replies!
Did you make the path nodes kind of close to walls, maybe that's why it keeps running into the wall, This happened to me before.
Pathnodes work as guidelines for the enemies. When there are no pathnodes around the enemy will walk in the straight direction to the player (this is causing the enemy to walk into walls).

So to fix your issue you will have to lay out pathnodes for the enemy to go to. It'll automatically calculate the shortest way to the player or you can even tell it to go to specific pathnodes with the following function.

void AddEnemyPatrolNode(string& asName, string& asNodeName, float afWaitTime, string& asAnimation);
Adds a patrol node to the enemy's path.

asName - internal name of the enemy
asNodeName - path node
afWaitTime - time in seconds that the enemy waits at the path node before continuing
asAnimation - the animation the enemy uses when reaching the path node
Also try having some space between your walls. I've heard that has been an issue for some people, making the monster not calculate that there is a wall there correctly.
(02-10-2014, 10:49 AM)RaideX Wrote: [ -> ]Pathnodes work as guidelines for the enemies. When there are no pathnodes around the enemy will walk in the straight direction to the player (this is causing the enemy to walk into walls).

So to fix your issue you will have to lay out pathnodes for the enemy to go to. It'll automatically calculate the shortest way to the player or you can even tell it to go to specific pathnodes with the following function.

void AddEnemyPatrolNode(string& asName, string& asNodeName, float afWaitTime, string& asAnimation);
Adds a patrol node to the enemy's path.

asName - internal name of the enemy
asNodeName - path node
afWaitTime - time in seconds that the enemy waits at the path node before continuing
asAnimation - the animation the enemy uses when reaching the path node

Yea that's the problem
Quote:"When there are no pathnodes around the enemy will walk in the straight direction to the player (this is causing the enemy to walk into walls"

How will patrol nodes to the enemy's path fix my problem actually? How do I let the Enemy know that he is going to run into a wall? That's my main problem actually.
(Remember that I'm still learning it all, go easy on me Tongue)
Place some nodes around and he will know where to go. Enemies use nodes even when you don't assign them.
(02-10-2014, 06:38 PM)Mudbill Wrote: [ -> ]Place some nodes around and he will know where to go. Enemies use nodes even when you don't assign them.

That means you dont have to script anything? Just placing nodes will do it?
I already scripted some monsters so they walk a path without noticing the player, but i dont know if the enemy would walk correctly if you just place them.
Place a bunch of pathnodes, tell the monster which one it should go to and it will choose the shortest path according to the placement of the path nodes.
(02-10-2014, 07:11 PM)i3670 Wrote: [ -> ]Place a bunch of pathnodes, tell the monster which one it should go to and it will choose the shortest path according to the placement of the path nodes.
This still doesn't solve the fact that the monster will walk into walls and continues to moonwalk towards it until he lost interest in the player.
A screenshot of your level editor could maybe help. share pl0x?