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