About Store Forum Documentation Contact



Post Reply 
Character stuck inside obstacle
Author Message
fatcoder Offline
Member

Post: #1
Character stuck inside obstacle
I've noticed that if you place a large obstacle over a character on the terrain and then call actionMoveTo for the character, sometimes the character gets stuck inside the obstacle and doesn't move.

I believe the Chr object is using Game::World.path().nearestWall() to find the nearest point outside the obstacle to move to first, then start moving from there. This works fine for small obstacles or if the character is close to the edge of the obstacle. However if the obstacle if very big (like you place a house down over the character) and the character is in the middle of it, then it doesn't work.

I think the search radius needs to be increased when the Chr object uses nearestWall?
11-29-2011 06:03 AM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #2
RE: [BUG] Character stuck inside obstacle
can you post some screen of the issue?
11-29-2011 09:17 AM
Find all posts by this user Quote this message in a reply
fatcoder Offline
Member

Post: #3
RE: Character stuck inside obstacle
OK, here you go.

   

The white box is the Chr object and the blue wireframe box is the large obstacle that was placed on the terrain. The green area is the nav mesh.

Basically, I placed the large obstacle over the Chr. Then I called actionMoveTo on the Chr and tell it to move to a spot on the nav mesh (outside the obstacle). It just sits there and does nothing. actionMoveTo fails.

As I previously said, this only fails when in the middle of a large obstacle like this. If the Chr was a bit closer to the edge of the obstacle, then actionMoveTo works, and the Chr first moves to the closest edge of the obstacle before continuing on its path.

I have a feeling that Chr must be using nearestWall internally and the radius it is using to check for a wall is too small. So if the Chr is far enough inside the obstacle, then it fails.
11-29-2011 12:05 PM
Find all posts by this user Quote this message in a reply
Post Reply