A* Pathfinding Project

The A* Pathfinding Project is a powerful and easy to use pathfinding system for Unity 3D.
With this system you can give your AIs the ability to find smooth paths around obstacles! No more running into walls. And the system is multithreaded which means that it will barely affect the frame rate at all!
The system works for both Unity Free and Pro and comes in two versions, one Free and one Pro version.

Features

Many graph types

The system supports Point, Navmesh and Grid graphs. None of them are “hard-coded” into the system, but written as add-ons which means that it is easy to add you own

Multithreaded

The system can optionally be run in a separate thread which means that pathfinding will have barely no effect at all on the game’s fps

Path modifiers

Paths can be post-processed using path modifiers, for example using the funnel algorithm, raycast simplification simple smoothing using bezier curves or other smoothing algorithms

Automatic navmesh generation

The system uses Recast translated to C# to automatically generate stable navmeshes from any level geometry

Graph updating

Many graph types can be updated during runtime when, for example a new tower is placed in a TD game

Blazing fast

Search speeds over a thousand nodes per millisecond (see performance)

Grid Graphs

Grid graphs can be set up on any ground, they can be rotated and scaled however you want

Navmesh Graphs

Navmesh graphs are great because they provide very high accuracy and lighting fast searches while keeping a low memory footprint

List Graphs

Aka “Point Graphs” can be set up from a collection of Unity GameObjects, can it get easier?

Interconnected graphs

All graphs can be mixed an matched together using Links placed in the editor

Graphs saved to files

Graphs can be saved to files, both in the editor and during runtime and loaded later

Cached starts

No calculation time at startup, graphs can be cached and loaded from memory in a split second instead of an annoying lag at the start of the game when the graph is calculated

Choose your favorite heuristic

Several heuristics are supported, Manhattan, Diagonal Manhattan, Euclidean and you can of course skip calculating any heuristic at all to get a Dijkstra’s search

Custom editor makes setting up pathfinding a piece of cake

A custom scripted editor makes pathfinding simple! And it has fancy fading effects too.

Optimizations using #defines

Several settings can be “hard-coded” into the system to gain extra performance or just enable some debugging. And everything can be done in the editor

Low memory footprint

All graphs have been optimized for memory, and memory leaks are nowhere to be found. Compared to 2.9x version of the system, the memory usage is less than 15% (tested with Grid Graphs), and 2.9x had huge memory leaks, so those 15% soon becomes 10% or even less after some time in gameplay

Easy intergration

A path request is a single line of code! Need to smooth the path? Add a smooth modifier component, not a single line of code needs adding. The system handles that

Optimized and specialized search modes

Want your Resource Gatherer to find the path to the nearest resource, or do you just want your civilians find any path which takes them away from the evil enemies? You can do that in a single path request!
Search modes available are: Normal, Multiple Target, Flee and Random. But as with graphs, all of these are written as add-ons, they are not hard coded into the system which means that you can add your own specialized search modes without modifying the pathfinding core!

And a whole lot more!

Also includes a lot of utility stuff, Bounding Box Trees, Binary Heaps, a whole bunch of polygon and vector math functions, multithreading utilities, custom written serializer, #define parser, Bresenham’s line drawing algorithm and much more

Performance & Memory

The system is really fast. The search speed, that is how many nodes it can close (search) per millisecond is usually from 800 to 1500. Including overhead for searching for the closest nodes etc. etc. This means that a normal path often takes less than a millisecond to calculate. And to this comes that the system is multithreaded, so your frame rate will barely be affect by this at all in any case!
Memory usage is also optimized, almost no memory allocations are made during a path search.

Demos

Demo of the Example1 scene included in the project

Free versus Pro feature comparison

Comparison page

Download

Download the A* Pathfinding Project here

Documentation

Documentation can be found here powered by Doxygen

9 Responses to A* Pathfinding Project

  1. David Tredeau says:

    I had bought the pro version of Pathfinder have not gotten the link for the updated version. I think I may have mis-typed my email when I got it. So I decided to get the free version to move forward on my project. Anyway, I’m getting errors that I’m not sure how to fix.

    ‘Pathfinding.NavMeshGraph’ does not contain a definition for ‘Linecast’

    and

    `Pathfinding.BBTree’ does not contain a definition for `OnDrawGizmos’ and no extension method `OnDrawGizmos’ of type `Pathfinding.BBTree’ could be found (are you missing a using directive or an assembly reference?)

    • Aron Granberg says:

      Hi

      The link for the updated version is the same one as the one you first get when you purchase the pro version. In the email you get, there is a link which will work for all updates.
      That looks like something got broken when moving from the Pro version to the Free version. Try deleting the AstarPathfindingProject folder and importing the Unity Package again. That would solve it.

  2. Alec Thilenius says:

    Hi. Firstly, amazing plugin! Thank you!

    You will have to forgive me if this is somewhere obvious and I have missed it, but can the free version be used in a commercial game?

    Thank you in advance,

    Alec

  3. Ahmed Tamer says:

    Hey Aron,, how are you I’ve downloaded Your great Project 3.0.8 (the free version)
    but when I Had Imported the package into my free unity 3.0, Many errors Appeared.
    I don’t know why should I download A* Pf 2.0 first or why. Thanks

    • Aron Granberg says:

      Which version of Unity are you using? It is not supported for versions earlier than 3.3 (but 3.4 is recommended). 3.0 is seriously outdated.

      If you are using a supported version, what errors are you getting?

      • Ahmed Tamer says:

        Thanks Aron Now I know why the errors Appeared. I’m Using Unity3.0
        Any way the errors say:
        Assets/Astarprocess.cs(4,7): error CS0246: The type or namespace name `AstarClasses’ could not be found

        Assets/Astarprocess.cs(5,7): error CS0246: The type or namespace name `AstarMath’ could not be found

        And Many Errors like that I hope unity 3.4 will Help.. I Gonna Download it.
        Thanks Again.

  4. Michael S. Lowe says:

    Hello Aaron,
    How are you? I have an idea. Wouldn’t it be a great idea to develop a second project that does angle and rotation finding along with being able to set rotation constraints for Unity objects by clicking on nodes in a sphere of where the object can and can’t rotate to both worldly and locally, to be able to set how many nodes are in each sphere, and the project finds the best way for the object to rotate to the desired node while avoiding the constraints? This could be useful for an arm or a leg, and could help simplify Inverse Kinematics solutions.

  5. Aralox says:

    Hey Aron, thanks for the wonderful plugin, I really appreciate it.
    Keep up the excellent work,
    Aralox

  6. Tom Mortensen says:

    Excellent! :)

    Cheers,
    - Tom

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>