Hello there!
I think its about time to show you guys what i’ve been working on.
It is a very powerfull and easy to use pathfinding, based off TRA*, wich stands for Triangulation Reduction A*.
For those of you who dont know, TRA* is a quite fast pathfinding techique as it uses only a few of the mesh triangles to search with the A* algorithm. These triangles can be seen in pink on the next picture.
So this is basically a very fast pathfinding code. A test was run on that terrain wich had a resolution of 512x512 and a error tolerance of 1, wich means the actual generated mesh is never more than 1 pixel away from the actual mesh. Note that the mesh does not depend on the map size, but on the map resolution. So a small sized map with 512x512 resolution would have the same mesh resolution as a big sized map with 512x512 resolution. The above mesh was generated in 5 seconds.
The test results of the test are shown in the next picture.
The y-axis on the graph shows the time in ms it took for the code to find the path, and the x-axis show the length of the path. Starting and Goal points were randomly chosen. Map size is 64x64 world units, so if the x-axis shows 30 on the path length, it means the path has 30 world units of length.
The average time it took to find a path is somewhere about 0.4ms, and the average path length requested about 55 world units.
So yeah, thats fast, considering it can run on background threads, it can find a lot of paths in a single frame without overloading the main thread at all.
Now about the asset.

The asset is very, very easy to use, it comes with a window that has three options : error tolerance, max slope and minimum area.
Other than setting that up, the user has only to click “Generate Mesh” and it is all done. No coding needed, not dragging stuff around no nothing.
Of course you will have to write a line down on your code to tell where you want your agent to go, something like : Agent.SetDestination(Vector2 position).
Right now the mesh generation is not considering user placed obstacles (GameObjects), but i’l be working on that pretty soon, the code is already structured to support that, i just need to really write it down. I plan on allowing objects to be marked as either obstacle, or traversable obstacle, to allow bridges, ramps and such. Like i said, the code structure already supports that, i just need to put some geometry codes down.
This is mainly a 2.5D mesh, so it works on unity 3D projects, i havent tested it out on 2D, the only difference though would be the mesh generation process, wich would not take a map, but sprites and whatnot. I’m not sure if i am going that way though.
I mention Vector2 because the y coordinate of the vector 3 doesnt matter for the mesh itself, it ignores the y coordinate during its calculations and returns a Vector2(x,y) and a height value, wich would be the y value for unity’s vector3.
Some mesh features :
QueryPoint(Vector2 point, float radius) → Returns the closest point on the mesh that is valid for that radius.
QueryCollision(Vector2 point, float radius) → Tells whether or not that point collides with something.
QueryVisibility(Vector2 pointA, Vector2 pointB, float radius) → Tells wheter or not the pointB can be seen from the point A keeping radius distance from obstacles.
QueryRandomPoint() → Returns a random point of the mesh. (excludes points over obstacles)
QueryPath(Vector2 A, Vector2 B, float radius) → Returns a path from A to B keeping distance radius from obstacles.
Pathfinding features :
-Path contains rounded corners around obstacles (you actualy dont have to worry about dealing with this on your code, the Path has a method that returns the next velocity the agent must take, just ask for it)
-If the starting point of the path is not on a valid point for the agent, a path will be found from the closest valid point to the start to the goal.
-If the goal cannot be reached, a path will be found to the closest reachable point to the goal.
The image above shows a path whose goal could not be reached.
Other than that, there are two or three advanced settings that can be changed :
-Max Iterations → Maximum number of paths to look for before exiting the A* search loop.
-Length Ratio → Allows the A* to quit the loop if it knows there is no more possible paths shorter than the best one found so far multiplied by this value
-Heuristic → Two options here, a greedy heuristic, that finds the first path faster, or a normal heuristic wich finds the optimal path faster.
These advanced settings dont really have to be changed, i ran tests to find out some average optimal values, but they’re there just in case someone wants to mess around with them.
There is not really a whole lot of things to show other than these, i just wanted to show you guys what i’ve been working on and ask for possible suggestions.
I already plan on adding the Agent script and easy to use methods with this, where the user would just ask for the agent to go somethere and the code would take care of it.
I might also add some Agents behaviour, such as follow other agents, chase agents and stop at distance with visibility, patrolling, maybe some mix up some AI for cahse and move behaviours.
Oh, and one last thing, i am probably adding some type of RVO for collision avoidance, i already have it pretty much coded, but its not integrated with the pathfinding and the mest just yet, i’ll have to work on that.
I’d love to receive some suggestions if you guys have any!
Post got longer than i expected, i guess i’ll just make a video next time!
Thank you for your attention!
TL : DR
-Very very fast and easy to use pathfinding code.
-Asking for suggestions!



