Advertisement

Couple of problems with my pathfinding..

Started by January 10, 2004 09:52 PM
19 comments, last by ddh 21 years, 1 month ago
quote:
Original post by ddh
Okay that could be the problem then. I''m adding the parents f value. I will rewrite my code to store G values, and give it a wirl then. Is the +1 really necessary if all moves cost the same? I didn''t think it would be since it was a constant value.


If you dont add this transition cost, then all nodes will end up with the same ''g'' cost as the root node, i.e., zero. Your search would then only be based on the heuristic estimate.

quote:
I would like to thank everyone for being so helpful. I really didn''t expect that.


Mmm, I wonder why you thought that?!

As for another way to solve your inaccessible goal, you can either a) (as suggested) preprocess your map; or, b) perform a bidirectional search. If the goal is inaccessible, then the root and goal trees will not meet up before they expire the search space. Some intelligent bookkeeping will prevent you from overlapping your start and goal search trees and the overlap test serves to find the end of the search.

I still honestly think you''re wasting your time with A* on tile maps this small. Have you checked how your search time scales with map size for you implementation and compare this to other search methods?

Cheers,

Timkin

This topic is closed to new replies.

Advertisement