Archived

This topic is now archived and is closed to further replies.

AI pathfinding: A suggestion

This topic is 6021 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I was thinking about pathfinding. If you take any rpg you''ll notice that if you let them walk to a far off point on their own they will generally attempt to take the straightest path and bump into stuff, then try to go around it. So why can''t you have two characters, one that isnt'' displayed but walks ahead where the first character will follow, and if the ghost character bumps into something then it sends a signal to the main character and he will avoid the object and take another path, so the path he walks will be a lot smarter, and will solve the problem of bumping into objects. And the more ghost character you have, the smarter, so you can have a ghost of a ghost of a ghost etc... that will try as much possibilities to get from A to B, so the more ghosts the smarter the movement.

Share this post


Link to post
Share on other sites
Having two player-pawns is hardly necessary, when you can do your pathing based on an oversize collision hull built around your model. You''ll have a BB for world collision, and another, larger one (say, an extra unit/tile or two in each direction, or character + x% radius) for pathing. You could certainly use a comparative "as-the-crow-flies-test" pathing algo, but you''ll probably still find the oversize collider to be useful too.
I''m sure this thread will be flocked with pathing tutorials soon enough.

-----------
-WarMage
...junk on the drob...

Share this post


Link to post
Share on other sites
Forget bump-and turn (even invisible pawn bump-and-turn). For good pathfinding, A* is the algorithm you''ll want to use. It finds the shortest path, every time, and the character then follows it.

The only time A* wouldn''t really work is when you''re dealing with very large maps, because it would take too long to calculate a path. In this situation, bump-and-turn could be effective.

Aside from that, A* is the way to go.

See http://www.gameai.com/pathfinding.html

Share this post


Link to post
Share on other sites