Marius Gedminas wrote:
My personal snag with A* is that the NPCs seem to know too much about
the map and directly walk the most optimal path without exploration.
One possibility to solving this is to have the npc move as it's
performing the algorithm. i.e. as your search explores a path, the
character walks along that path. This could probably be implemented
fairly cleverly by using generators. You'd probably have to experiment
with different algorithms to find a more "realistic" approach - I
suspect that A* would involve lots of wandering since it assumes
constant access time for all known branches (whereas the character has
to walk up and down the tree). DFS would probably be more realistic.
--Mike