Tag: algorithms

Why A-Star Pathfinding Sucks

Why A-Star Pathfinding Sucks

Looking to get a game character from A to B? Want it to work-out its own route around obstacles? This is called pathfinding, and everyone keep harping on about A* (said A star). This is an awesome technique, but it can also suck for beginners! Why? Because it’s much more complex and, in many simple cases, unnecessary. The table below shows how it stacks up against other pathfinding algorithms… As you can see, A* doesn’t win on all counts. Do you need movement cost – the ability to have areas where the character moves faster or slower like roads or swamps? Do you need blistering speed, or would 50% slower than A* be just fine? If the answer to these questions is no, and you’re just starting-out, why would you put yourself through the pain of learning A*? Apart from the added complexity of understanding and programming A*, there are some other ways in which it sucks. If you want to find a path from a start point to multiple possible end points, or from multiple start points to one end point (thing Defence Grid 2 or other RealTime Strategies), then A* sucks as it’s designed for point-to-point pathfinding. The […]

Read More