Jump to content

  • Log In with Google      Sign In   
  • Create Account

#Actualferrous

Posted 01 March 2014 - 02:15 PM

Alvaro has the right of it for true turning costs, though I think he may just want to prevent zigzagging, so you could alter the F cost to make it more expensive to move to a node if it involves moving in a different direction than the last move.  Maybe store the dx/dy for each move, then compare it to the new potential, and roll it into the F cost?

 

(Also, if you haven't done so already, you may be able to fix your problem by just making diagonal moves more expensive that straight moves, check this thread for more info)


#1ferrous

Posted 01 March 2014 - 02:14 PM

Alvaro has the right of it for true turning costs, though he I think he may just want to prevent zigzagging, so you could alter the F cost to make it more expensive to move to a node if it involves moving in a different direction than the last move.  Maybe store the dx/dy for each move, then compare it to the new potential, and roll it into the F cost?

 

(Also, if you haven't done so already, you may be able to fix your problem by just making diagonal moves more expensive that straight moves, check this thread for more info)


PARTNERS