Advertisement

Simple pathfinding system

Started by October 08, 2005 03:28 PM
2 comments, last by xEricx 19 years, 1 month ago
I would like to implement pathfinding AI for an FPS game. As of now, my monsters simply walk directly toward the player. If they hit an obstacle, they simply keep walking, banging their head on the wall! What I am really looking for is a means of determining the best direction to go in order to reach the destination without hitting a wall. Given: Player's position, list of all obstacles with dimensions, monster's position. Any suggestions?
hackerkey://v4sw7+8CHS$hw6+8ln6pr8O$ck4ma4+9u5Lw7VX$m0l5Ri8ONotepad++/e3+8t3b8AORTen7+9a17s0r4g8OP
When I read the title I was going to suggest something really simple.

But after reading your post, I think that A* is your only solution, or at least the only feasible one.

Check the articles of this site about pathfinding
------ XYE - A new edition of the classic Kye
Advertisement
A* isn't really absolutely necessary for pathfinding. A more fundamental problem for a fps type game might be building a map for the AI to use. Picking nodes, finding paths between nodes, and then moving from one place to another is simply a matter or going to a node and following the paths from node to node to get to the destination. To find a path from a starting node to an ending node, A* can be used, or a simpler algorithm like depth first search.
There are a few ways to pathfind from "A to B".

You should do a Google search on Pathfinding.

If you want in depth coverage of graphs / pathfinding methods, you might want to read Artificial Intelligence: A Modern Approach

To get some fun to read book with complete examples on how to use pathfinding and path following techniques that take care of dynamic obstacles, I highly suggest you to pick up Mat Buckland's excellent Programming Game AI by Example

Hope this helps

Eric

This topic is closed to new replies.

Advertisement