Really the title says what I'm asking- clear, concise and correct.
Is there anything faster than A* pathing?
http://theory.stanford.edu/~amitp/GameProgramming/Variations.html
If you try to do path finding on a target that's not reachable the A* algorithm iterates through every possible square in the scene, which is very slow. To solve that I use floodfill to check that the target is reachable. The floodfill checks that both start and target squares are both in the same area.
Things faster than A* include, for example, summing two numbers, calculating a dot product or doing nothing at all. Most problems have many good solutions, and the best one must be picked by you depending on the specifics. And even better than a good solution is avoiding the problem altogether, which is also sometimes possible.
If you try to do path finding on a target that's not reachable the A* algorithm iterates through every possible square in the scene, which is very slow. To solve that I use floodfill to check that the target is reachable. The floodfill checks that both start and target squares are both in the same area.
I was thinking a floodfill type to determine a solution and then A* only the nodes floodfill evaluated when finding the target.
If you try to do path finding on a target that's not reachable the A* algorithm iterates through every possible square in the scene, which is very slow. To solve that I use floodfill to check that the target is reachable. The floodfill checks that both start and target squares are both in the same area.
If your data is static enough you can just pre-calculate 'islands' so that you never do any work evaluating impossible paths.
For the OP, the key is really understanding your problem domain. E.g. On a simple top-down driving game, your 'pathfinding' could be as simple as caching a direction/speed vector for every point on your map. In a more general case though, A* is pretty hard to beat.
A* is really one of the fastest there are, but it can be used inefficiently, for instance imagine you have 5 actors standing more or less in the same place and they all want to go to the same destination, do you run A* for all 5 actors? if so, that is inefficient, but not because A* isn't fast enough.
Another example, imagine that in order to get from A to B you must traverse a room from one door to another walking around a table that is in between both doors, barring the prescence of a mobile obstacle, such as another actor, the path within that room will always be the same, are you running A* to find out what it is every time you need to traverse that room? also wasteful, it can be pre-computed on level design and saved into the room information.
There are tens or hundreds of tricks like these that improve performance without resorting to an algorithm other than A*, A* is fast enough, reliable, well known and documented and simple to implement for most (but not all) pathfinding requirements, its all about context.
Your question is "clear, concise and correct." but incomplete, why do you feel you need a faster algorithm? what are you using A* for? what is the context?
Your question is "clear, concise and correct." but incomplete, why do you feel you need a faster algorithm? what are you using A* for? what is the context?
I'm actually not going to use it at all.
I was looking at another devs blog and saw he used A* in his rts so I looked it up and watched a couple videos about it and was curious how the community felt about it and if there was something more epic out there.
The context is a mobile tank maze game for android which is a rewrite/upgrade to my first game to bring it a bit more modern. I'm drawing 225 blocks, background, shadows, up to 200 rounds of ammo, up to 50 rockets, all the interface buttons and displays, and tracking up to ~50 enemies
-on a phone or tablet.
Those numbers are tentitive so if all continues as it is now on my testing device, I might bump those numbers up- at least the number of enemies because at full power up, my bullets and rockets pour out of my vehicle like water and cut a smexy path of destruction. And I will need my foes to catch my wrath.
I have a grid based A* that uses an unordered list (written in C), it is the slowest implementation of A*.
In a 695x132 grid test grid, it takes 15138 microsseconds to find a path from the uppermost part to the bottom (running on a core 2 duo 8400, ubuntu 32 bits). Realistically, the monsters (that use the pathfinding) can only see as far as 20 cells, so this is the maximum size of a path in my game (which takes 54 microsseconds).
Answering your question: A* is an algorithm find the lowest cost of going from one node to another, using edges as connections, in a graph. For this problem it is the fastest algorithm you can find. The problem of pathfinding is not the same problem as the one that A* solves, it can merely be reduced to it. So you can use particular properties of the pathfinding to improve its performance (for instance, if someone asks for a very big path, you can break into multiple smaller paths, you can reuse paths for units that are close to each other, you can have a region map to instantly solve unreachable paths and many others).
If I were you I would try a very simple A* implemetation and see how it goes, then either try to improve it or limit the action radius of the agents.
Check this http://qiao.github.io/PathFinding.js/visual/ out. Check out the jump point search, with preprocessing and future information that algorithm is very fast. So it all depends on the context. But A* is a good starting point in most scenarios.
^That's a pretty cool implementation demonstration.
One of the units may still require a short path to the player, but don't need it right now. I published the game and you can see me spamming here: http://www.gamedev.net/topic/642744-afv-hail-of-gunfire/
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.