Need Help with 2D Platformer Pathfinding

TL;DR:
I’m using Godot 4.4.1 to implement pathfinding for AI enemies in a 2D platformer. Navigation works using a TileSet-based navigation layer, but pathfinding fails at edges where jumps or falls are needed. Manually adding NavLink2D nodes between edges works, but it’s tedious. Levels are static. Is there a way to automate the placement of NavLink2D nodes? And is this the correct approach for intelligent platformer pathfinding?

Godot Version

4.4.1 Stable

Issue

I know the idea on how to implement pathfinding in Godot, and have already made one work with top-down 2D games. HOWEVER, I have an issue with it when it comes to 2D Platformers.
To optimize the pathfinding and reduce the unnecessary navmeshes, I created a Navigation Layer in my TileSet, which looks like this:


I put it on all tiles where characters can walk. These are enemy characters which can jump, run and fall, and have a simple AI to chase the player when in their range. The NavAgent2D creates a path towards the Player in this Nav Layer and it actually works, except for edges where characters can fall or jump. The path breaks and doesn’t continue. EXCEPT, by putting a NavLink2D to connect the edge and the next tile above/below it, the Navigation continues and works perfect. However, I need to do this for ALL edges to have a smooth pathfinding for each character. The levels I currently have are static and not procedurally generated.

Questions

  • Is there any way to automate this?
  • Is my approach incorrect? If it is, what should I do instead?

I know I can just RayCast the checking for ledges and jump edges but I want the enemies to be a little bit intelligent, hence the pathfinding. Feel free to comment any suggestions or opinions about this issue I have.

Im running into the same problem have you found a solution

Check out this thread