Navigation mesh

Over the last few weeks I’ve been trying my hand at rigging up a basic navigation mesh for path finding. Using a navigation mesh should allow a more natural feel and responsiveness to character movement while moving through the map.

The general theory is quite straight forward, polygons are created on the walkable areas of the map and are linked together if they’re direct neighbors. The pathfinder then uses the edges of each polygon to navigate through the mesh.

The initial implementation of this is quite basic and only uses the centre points of each edge so the paths used still look like they’re on rails but I plan to update it so the whole area of the polygon is used.

The red lines in the examples below are the paths generated from the start to the end points, not elegant but a good start

Basic Navigation Mesh

Shadow Bug

Well it turns out that there was a major issue with the new shadows where they didn’t¬†maintain the correct positions if the parent was moved. It was visible in the previous video as the parent was situated at 0,0.

A little annoying but glad it reared it’s ugly head sooner rather than later.

Onwards with pathfinding, currently working on a navigation mesh for path finding.