Tag Archives: A* search algorithm

Pathfinding IV — Call it a day, period!

The demo video is here:

Added multi-movement types functionality and portal connectivity. The multi-movement types is sort of self-explanatory. For the portal, do the A* as usual, but besides checking all geometrically connected polygons, also need to check the ones connected via portal. And if two polygons are connected via portal, the estimation of their mutual distance is 0. And then a list of polygons are returned from A*, in the case that portals were used in the path, then the list of polygons are not continuous, say, 1,2,3,7,8,9,12,13,14. Meaning 3 has a portal and we arrive at 7 directly, then we move to a portal on 9 and reach 12 directly. So I run funnel algorithm three times over each continuous segment, 1~3, then 4~6 then 12~14, then add their path together.

So by now I think I got a pretty good understanding of A* and navmesh how they work together. Could even do some beyond-basic tricks over it. The project still has lots of room to optimize. During the past three weeks, or maybe four, I lost count, I’ve been working on it from time to time during weekend, and some workday nights. So probably about 30 hours haven been spent, again lost count. I think now it’s a good time to refresh my mind a little bit and unplug from it for a while. For the potential improvements, I might switch back to this project in the future and work on them.

Haven’t determined what’s the next thing I wanna work on, I will use this week to come up with something interesting. Maybe it’s time to learn some WebGL, or maybe dig deeper into Procedural City Generation (I’ve done some work related to it before, when I was a student, in a class project, but since time was limited, I didn’t implement it very well), or maybe try some other game technology. There are so much I need to learn, ah…

Now it’s Monday morning, let wish this upcoming week is a good one! 🙂