When A* [seemingly] isn't enough...

Started by
4 comments, last by 020644 16 years, 5 months ago
Here's the problem. I have a 2D map in the form of a simple grid. I need to find the shortest distance from point A to point B. Seems easy so far... The problem is that movement is not restricted to 8 directions! It seems that this would be a common problem, and it also seems that the solution to this problem should start with the A* path. Can anyone give me a nudge in the right direction?
Advertisement
A* doesn't place any restriction on the number of paths between the nodes. What exactly is your problem?
Units can move at any angle. Sorry if I'm being dense!
You can try A* in 8 directions and then add path smoothing (i.e. remove nodes from the path if doing so still represents a valid path).
Quote:Original post by 020644
Units can move at any angle. Sorry if I'm being dense!


Not if your map is a 'simple grid'.

How about you explain, nice and explicitly how your map is structured...
strtok's solution works.

Telastyn, while the game map is a stored as a simple grid of passable and non-passable tiles, units on the map can move in any direction and aren't constricted to moving "tile-to-tile".

Thank both of your for your help! :)

This topic is closed to new replies.

Advertisement