D
DirectOrder
Guest
The built-in pathfinding is nice, but very limited (can't move through diagonally blocked paths, can't weight movement, etc). So I'll just write my own implementation of A*, right? Well I did. And it works. But it's sloooow. So I figured maybe these new structs that I used to track nodes are super slow, so I went online to find other people's implementations. I found a tutorial on-line (here) that is much more optimized than mine (and uses maps instead of structs) so I tried that one out. Good news: It's like 4-5x faster than mine. Yay! Bad news: It's still like 15-20x slower than the built-in pathfinding from my calculations. Maybe even slower.
I don't know how YoYo has implemented their pathfinding, but it is FAST! Of course it's also strangely limited. Here's a post from someone else running into the same problem as me: link
I see this thrown around a lot here: "Well if the built-in pathfinding isn't working for you, just write your own!" I'd love to. And I did. But I've tried several different implementations of A*, and they don't even hold a candle to the built-in pathfinding (performance-wise). And I need that performance. With the algorithm I wrote, my player character takes 3-4 real-time seconds to calculate some longer paths. And I have 70-100 enemies that need to do the same. The built-in pathfinding does ALL of that in less than a second.
Does anybody have a FAST implementation of A* they wouldn't mind sharing? Or has anybody else run into this and figured out why their A* implementations were so slow? I might just be missing something here. Please tell me I'm just missing something here lol
Thank you very much for any help you can provide!
I don't know how YoYo has implemented their pathfinding, but it is FAST! Of course it's also strangely limited. Here's a post from someone else running into the same problem as me: link
I see this thrown around a lot here: "Well if the built-in pathfinding isn't working for you, just write your own!" I'd love to. And I did. But I've tried several different implementations of A*, and they don't even hold a candle to the built-in pathfinding (performance-wise). And I need that performance. With the algorithm I wrote, my player character takes 3-4 real-time seconds to calculate some longer paths. And I have 70-100 enemies that need to do the same. The built-in pathfinding does ALL of that in less than a second.
Does anybody have a FAST implementation of A* they wouldn't mind sharing? Or has anybody else run into this and figured out why their A* implementations were so slow? I might just be missing something here. Please tell me I'm just missing something here lol
Thank you very much for any help you can provide!