Original Post
For a (tile-based) game I''m writing, the player has a sort of a secondary character that can be sent to specific locations to perform tasks. However, there''s always the problem of there being something in between. If I just have the character walk in a straight line, he could get stuck. I''ve seen games like this where a stuck person just ignores the command and returns to the "party", but that seems like a bad idea; what if the player is in a hurry and instructs the character to perform some vital task? Thus, I need an algorithm for finding a path from one tile to another despite obstacles. My initial thought is to have a sort of recursive function which, if blocked, would recurse to either side looking for an unblocked path, and would store the path in some form of structure as it went. But this too seems like a clunky and possibly slow way of doing things. Can someone help me / point me to a link or article to help me?
+------------------------------------------------
| Thp :: Threep2742@worldnet.att.net
| "Nature uses only the longest threads to
| weave her patterns, so each small piece
| of her fabric reveals the organization of
| the entire tapestry." -- Richard P. Feynman