I'm currently trying to create a video game where characters are AI and are in a circular map with ressources on it.
I'm currently trying to calculate the shortest distance betwing 2 points on this map but my problem is that the map is circular : for example
if my map is 20*20 and i m in (0,0) the (19,0) point has a distance on 1 only. I've been looking on the internet but i didn't found answers for my problem. I have to take care of the orientation (North South west East) of my character too, in he has to turn to go to the point, the distance has to be longer.
Is there an existing formula ?
Thanks for reading !