| 
		
	
		| Melvin   Member
 
 Posts: 245
 Threads: 38
 Joined: Jun 2012
 Reputation: 
5
 | 
			| Enemy not following - Walking into walls 
 
				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!
 
 |  |  
	| 02-10-2014, 10:25 AM |  |  
	
		| Radical Batz   Posting Freak
 
 Posts: 953
 Threads: 145
 Joined: Dec 2013
 Reputation: 
25
 | 
			| RE: Enemy not following - Walking into walls 
 
				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.
			 |  |  
	| 02-10-2014, 10:43 AM |  |  
	
		| RaideX   Member
 
 Posts: 212
 Threads: 33
 Joined: May 2013
 Reputation: 
7
 | 
			| RE: Enemy not following - Walking into walls 
 
				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
 
 If you don't draw first, you don't get to draw at all...  -The False Shepherd 
				
(This post was last modified: 02-10-2014, 10:49 AM by RaideX.)
 |  |  
	| 02-10-2014, 10:49 AM |  |  
	
		| Mudbill   Muderator
 
 Posts: 3,881
 Threads: 59
 Joined: Apr 2013
 Reputation: 
179
 | 
			| RE: Enemy not following - Walking into walls 
 
				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:52 AM |  |  
	
		| Melvin   Member
 
 Posts: 245
 Threads: 38
 Joined: Jun 2012
 Reputation: 
5
 | 
			| RE: Enemy not following - Walking into walls 
 
				 (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   )
			 
 |  |  
	| 02-10-2014, 05:04 PM |  |  
	
		| Mudbill   Muderator
 
 Posts: 3,881
 Threads: 59
 Joined: Apr 2013
 Reputation: 
179
 | 
			| RE: Enemy not following - Walking into walls 
 
				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 |  |  
	
		| LordOfDragons   Senior Member
 
 Posts: 501
 Threads: 14
 Joined: Aug 2013
 Reputation: 
13
 | 
			| RE: Enemy not following - Walking into walls 
 
				 (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.
			 
 The question that will never be answered:SOMA WHY ARE YOU SO BEAUTIFUL? ;_;
 |  |  
	| 02-10-2014, 07:00 PM |  |  
	
		| i3670   Posting Freak
 
 Posts: 1,308
 Threads: 74
 Joined: Oct 2011
 Reputation: 
36
 | 
			| RE: Enemy not following - Walking into walls 
 
				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 |  |  
	
		| Melvin   Member
 
 Posts: 245
 Threads: 38
 Joined: Jun 2012
 Reputation: 
5
 | 
			| RE: Enemy not following - Walking into walls 
 
				 (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.
			 
 |  |  
	| 02-10-2014, 11:57 PM |  |  
	
		| Mudbill   Muderator
 
 Posts: 3,881
 Threads: 59
 Joined: Apr 2013
 Reputation: 
179
 | 
			| RE: Enemy not following - Walking into walls 
 
				A screenshot of your level editor could maybe help. share pl0x?
			 
 |  |  
	| 02-11-2014, 12:10 AM |  |  |