Re:Pathfinding Demystified
by ggambetta on Friday May 16, 2014 @08:14AM
(#7755039)
If "trying to move closer" is enough, maybe you don't even need a pathfinding algorithm - if the target is to the right move one step to the right, if the target is above move one step up, and so on?
[ Parent
| on HN ]
That's basically what I have with the addition of a small collision check. If there is a collision tile between the seeker and the target it tries to move sideways but this has the effect that it only takes three adjacent tiles to stop the seeker from reaching the target. I would like something smarter than that but still preserve the efficiency.
Re:Pathfinding Demystified
by datashaman on Friday May 16, 2014 @08:42AM
(#7755131)
What if there are obstacles in the path? You'll need a more complex algorithm to deal with the possibility of getting stuck in corners.
Well, he did say "It doesn't really matter if it gets stuck".
Re:Pathfinding Demystified
by datashaman on Friday May 16, 2014 @09:25AM
(#7755315)
puts glasses on ah. :-$