maze path~

Started by
4 comments, last by Black Q 21 years, 6 months ago
Howdy~ I see some NPCs(controlled by computer) could find its right way in a maze, how could it do that ?
Never end in learning~
Advertisement
Search for some introductory article about "A*" - that''s usually what people use for that kind of problem

-----------------------
Always down - Never out
-----------------------Always down - Never out
Well A* is unlikely to be the solution, it depends whether or not the NPC has knowledge of the world representation.

If you want your NPC to start from a state of ignorance and explore the maze in order to solve it then that is a completely different problem to an NPC having access to your program''s internal representation of the maze (in which case it is trivial to solve the problem).



ai-junkie.com
Mmmh, recursive fill algorithm ?
Simply try to "flood" the maze. Whenever you reach a point where you can go to more than one direction, then save that point in a stack of "to be explored" points. If the direction you choose leads to a dead end, simply start from the last saved point (marking the direction as "already explored")

I think

Sancte Isidore ora pro nobis !
-----------------------------Sancte Isidore ora pro nobis !
Maze solving has been an interesting research problem for many decades. Search the web and I am certain you will find more information than you could digest in a year!

Good luck,

Timkin
fup >> true - you''d probably want the NPC to behave realisticaly, or?

-----------------------
Always down - Never out
-----------------------Always down - Never out

This topic is closed to new replies.

Advertisement