Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple Issues Help Enemy not following - Walking into walls
Melvin Offline
Member

Posts: 245
Threads: 38
Joined: Jun 2012
Reputation: 5
#1
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!

[Image: 25F7U37.png]
02-10-2014, 10:25 AM
Website Find
Radical Batz Offline
Posting Freak

Posts: 953
Threads: 145
Joined: Dec 2013
Reputation: 25
#2
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
Find
RaideX Offline
Member

Posts: 212
Threads: 33
Joined: May 2013
Reputation: 7
#3
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
Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#4
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
Find
Melvin Offline
Member

Posts: 245
Threads: 38
Joined: Jun 2012
Reputation: 5
#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 Tongue)

[Image: 25F7U37.png]
02-10-2014, 05:04 PM
Website Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#6
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
Find
LordOfDragons Offline
Senior Member

Posts: 501
Threads: 14
Joined: Aug 2013
Reputation: 13
#7
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
Find
i3670 Offline
Posting Freak

Posts: 1,308
Threads: 74
Joined: Oct 2011
Reputation: 36
#8
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.

"What you think is irrelevant" - A character of our time

A Christmas Hunt
02-10-2014, 07:11 PM
Find
Melvin Offline
Member

Posts: 245
Threads: 38
Joined: Jun 2012
Reputation: 5
#9
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.

[Image: 25F7U37.png]
02-10-2014, 11:57 PM
Website Find
Mudbill Offline
Muderator

Posts: 3,881
Threads: 59
Joined: Apr 2013
Reputation: 179
#10
RE: Enemy not following - Walking into walls

A screenshot of your level editor could maybe help. share pl0x?

02-11-2014, 12:10 AM
Find




Users browsing this thread: 1 Guest(s)