I'm writing a turn based game that has some simulation elements. One task i'mI'm hung up on currently is with path finding. What I want to do is, move each turn, move an aiAI adventurer one tile closer to his target using his current x,y and his target x,y.
In trying to figure this out myself I can determine 4 directions no problem by using
dx = currentX - targetY dy = currentY - targetY
dx = currentX - targetY
dy = currentY - targetY
but I'm not sure how to determine which of the 6 directions is actually the "best" or "shortest" route.
For example, the way itsit's setup currently, I use East, West, NE, NW, SE, SW but to get to the NE tile iI move East then NW instead of just moving NW.
I hope this wasn't all rambling. Even just a link or two to get me started would be nice. Most of the info i'veI've found is on drawing the grids and groking the wierdweird coordinate system needed.
Thanks in advance Tim