🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Simplify A* path

Started by
2 comments, last by Angus Hollands 9 years ago

Hello,

I'm trying to implement pathfinding in my game, I'm using navmesh with triangles.

I'm able to find a path but I want to simplify the path. This is what I have right now :

Green quad is start position and blue quad is the destination, the path taken by my character is in white.

wireframe

Node 1 and Node 2 are in differents triangles, I want to delete Node2 and go from Node1 to final destination.

How can I simplify this path ?

I know about Funnel algorithm, but honestly, I don't understand anything and I can't see how it's going to work in my case.

Thank you.

Advertisement
There is a simple method that would work for your situation: You can skip a node if you have direct line of sight to the node after that one.

In general, try to find the furthest point point on the path in sight of the unit (not just nodes, but on the lines also) and move in this direction, that will make the unit move more naturally and better than a simple simplification would do.

Hello,

I'm trying to implement pathfinding in my game, I'm using navmesh with triangles.

I'm able to find a path but I want to simplify the path. This is what I have right now :

Green quad is start position and blue quad is the destination, the path taken by my character is in white.

wireframe

Node 1 and Node 2 are in differents triangles, I want to delete Node2 and go from Node1 to final destination.

How can I simplify this path ?

I know about Funnel algorithm, but honestly, I don't understand anything and I can't see how it's going to work in my case.

Thank you.

The funnel algorithm essentially traces the view of the agent as it attempts to follow the A* path. I have an example implementation here if you care to look at it.
The example on Mikko Mononen's blog may also be useful.

This topic is closed to new replies.

Advertisement