D
D
dollar2018-08-13 15:29:02
Algorithms
dollar, 2018-08-13 15:29:02

What is the fastest pathfinding algorithm?

There are no complex labyrinths in the game world. These are the continents, the islands. That is, the most difficult thing is the strait that needs to be bypassed. There are also separate obstacles - stones, trees, which are easy to bypass. But if the target is across the river, the algorithm should not look for a bridge on the other side of the continent. We need the fastest algorithm.

Answer the question

In order to leave comments, you need to log in

5 answer(s)
P
pi314, 2018-08-13
@dollar

https://qiao.github.io/PathFinding.js/visual/

D
Daniil Basmanov, 2018-08-13
@BasmanovDaniil

Everyone uses A* , occasionally JPS . If the speed is not enough, then optimize the graph on which the search takes place, for example, a uniform grid is replaced by key points.

O
Oleg, 2018-08-13
@slayez

My article about A*

G
GavriKos, 2018-08-13
@GavriKos

What is the fastest pathfinding algorithm?

it does not exist. It all depends on the inputs, which include: mesh size, size and density of obstacles, need to smooth the path, static/dynamic nature of obstacles, dimensions of the object itself (important/not important), fog of war (generally similar to dynamic obstacles, but not always), and a bunch of other factors.
Start with a-star if it matches the primary data.

V
vilasha, 2018-08-13
@vilasha

It seems to me that this algorithm is the fastest (I don't know the exact name of the algorithm, but the essence is as follows):
1. Write the equation of a straight line between the current coordinate of the object and the destination ( www.math.by/geometry/eqline.html).
2. We move along this straight line to the first obstacle
3. If we come across an obstacle, we start bypassing it, say, to the right. At each step, we check whether we are on our straight line
4. If we are back on the straight line, and this is not the point from which we started the detour, then we continue to go further along the straight line to the destination or the next obstacle.
5. If we are again at the point from which the bypass was started, or at one of the points on the straight line, which is further from the destination, which is the point from which we started the bypass (that is, we returned back), then we try to bypass the obstacle already on the left.
6. If here, too, we returned to the point from which we started our detour, then the desired destination point is unreachable.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question