• Image
  • Image
  • Image
  • Image
  • Image
  • Image
  • Current Version: 1.5: 2022-07-20T10:53:25Z
  • First Published: 2020-10-27T19:22:12Z
  • Size: 500512
  • Supported Unity Versions: 2019.2.3
tools behavior-ai

NavTiles: 2D Pathfinding

(5 Votes)
$- $-

Extend your 2D toolkit with NavTiles! This asset includes automatic pathfinding and agent management to simplify your 2D development cycle. Adjust pathfinding settings with our multithreaded algorithm options, and tweak your agents with our custom inspectors, designed to simplify your workflow.


Tiles


NavTiles provides an easy way to paint on Unity's Tilemap with Tiles which bake into a traversable grid for your NavTileAgents. Simply select the area type of your Tile, add it to your palette and start painting!


Already started with your project and have lots of default Tiles? Using our Tile to NavTile converter, all data is transferred to the new objects. Existing levels will now point to the new assets as well, so you can continue working with the added benefit of traversability for your agents.


For special or custom Tiles, we created NavLinks. These are intermediate assets, where you can link to a Tile asset, and apply any NavTile related information on top of it. NavLinks are baked just like normal NavTiles, so any asset which inherits from the Tile object is compatible!


NavTiles supports any Grid type from Unity's Tilemap, including Square, Isometric and Hexagonal!


NavTiles Settings


The NavTiles Settings window has all your project-wide settings to control pathfinding for your agents. This includes a list of (custom) areas with associated costs and different types of agents. We also offer three different pathfinding algorithms, varying in speed and flexibility:


  • A*. This algorithm is widely used, fast and very flexible. If you have a game which utilizes a changing grid, this is the one you'll use.
  • Jump Point Search. This algorithm is faster than A* in most cases, but constraints the Grid to only use uniform costs. 
  • Jump Point Search+. This algorithm is an optimization to JPS, but comes with even more constraints. The JPS+ documentation page has more details on what these constraints are.

After a path has been calculated using your preferred algorithm, Smoothing Algorithms can be applied. NavTiles includes Line of Sight Smoothing. Implementing the INavTilePathModifier interface enables you to implement your own smoothing algorithms with ease as well!


NavTileAgent


The NavTileAgent component has various options to tweak the behavior of your agent. This includes which areas it's allowed to walk on, the agent's speed per area type, whether it's allowed to walk diagonally across tiles and if it's allowed to cut corners.


Conflict Handling can have varying requirements depending on the game you are building. That's why NavTiles comes with a variety of solutions:


  • No Conflict Handling. Agents will simply walk over eachother.
  • Abort On Obstruction. When an agent wants to enter a Tile which is already occupied, the path is aborted.
  • Wait On Traversing Agent. When an agent wants to enter a Tile which has a moving agent as the occupant, it will wait until it's clear, and will continue it's path. If the occupying agent is not moving, the path is aborted.
  • Wait on Waiting Agent. When an agent want to enter a Tile which has a waiting agent as the occupant, this agent will wait to. If the occupying agent has no path, and is simply standing still, the agent will abort instead. 

More information about Conflict Handling can be found in our documentation.


The NavTileAgent component also has various Animation Settings. We support setting a Speed, Horizontal and Vertical parameter to control your movement animations. There's also an option to activate an animation trigger when the agent traverses to a different area type.


On top of all this built in functionality, we also expose various Unity Events which you can subscribe to, in order to have full flexibility. These include:


  • OnAreaChange()
  • OnPathNotFound()
  • OnPathAborted()
  • OnPathFinished()

NavTileAgentController


The asset includes a simple script to add points for your agents to traverse between. 


Note that this is not a behavior asset, and we do not offer any decision logic on where to walk other than this script.


Add to cart
This site contains affiliate links, which means that we can receive a commission if you click on a link and buy something that we have recommended.
Although clicking on these links will not cost you anything, they will help us finance our development projects while recommending good products!