SirLich,
@SirLich@mastodon.gamedev.place avatar

So, the Navigation Server in Godot is not returning shortest paths :(

As far as I can tell, it seems to be calculating the shortest path to ENTER a polygon, which can provide some very unreasonable results.

Does anyone know of a way to somehow alleviate this issue? Or do I need to write my own pathfinding?

jannem,
@jannem@fosstodon.org avatar

@SirLich
I kind of understand the reasoning that can lead to this issue.

As a workaround you could try add a polygon (disk) at your destination and path to that. I guess that might make it find the correct solution.

Edit: probably not. It'll still route through the large blue polygon first. If you split the polygon vertically into two it will likely work.

SirLich,
@SirLich@mastodon.gamedev.place avatar

@jannem Yeah this "splitting" idea is nice. I didn't find any way to augment the navigation baking, or any settings related to max cell size.

I suppose I can manually change the data in the NavigationArea2D after baking? I don't actually know if those fields are even exposed to GDScript. Probably they are.

SirLich,
@SirLich@mastodon.gamedev.place avatar

If you focus on the polygon where the path ends (top right), you can indeed see that to ENTER this polygon, the shortest path is on the left.

But to reach the actual terminus, it would be shorter to go straight, not make a curve around the obstacle.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • godot
  • DreamBathrooms
  • magazineikmin
  • ethstaker
  • khanakhh
  • rosin
  • Youngstown
  • everett
  • slotface
  • ngwrru68w68
  • mdbf
  • GTA5RPClips
  • kavyap
  • thenastyranch
  • cisconetworking
  • JUstTest
  • cubers
  • Leos
  • InstantRegret
  • Durango
  • tacticalgear
  • tester
  • osvaldo12
  • normalnudes
  • anitta
  • modclub
  • megavids
  • provamag3
  • lostlight
  • All magazines