Skip to main content
gamedev.net
🔒 Locked

Pathfinding Algorithms

Started by Thp Jul 8, 2000 at 9:13 PM 1 replies 350+ views
Original Post
Thp
Thp
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
+------------------------------------------------| 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
ragonastick
ragonastick
Have a look at this page:

http://xenon.stanford.edu/~amitp/gameprog.html

Many articles on pathfinding using A*

"Only a fool quotes himself"
Andy Owen

My Homepage (Non games related)
My Current Project (Games related... I think)
Trying is the first step towards failure.
WitchLord
WitchLord
I think you should investigate a little about an algorithm called A* (A star).

Smart Moves: Intelligent Path-Finding

Amit's Game Programming Information

- WitchLord

(I was a bit slow this time )

Edited by - WitchLord on July 8, 2000 10:38:44 PM
AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - <a href="http://www.angelcode.com/tower" rel

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.