Pathfinding Perfomance?

Ok so I was just messing around with Aron Granberg’s a* pathfinding (never done anything like it before, its really cool). And I was gonna use it with my next game, but I was wondering, would it be fine to have like 10 enemies max using it at the same time?

We have a lot more than 10. I’ve seen his demos with hundreds. We are still performance testing, but you can probably do (just about) anything you want with 10 enemies and still be OK.

Ok cool, there will be more enemies so I’ll mess around and do some testing, but good to know. Thanks.

It’s important to note that the resource-heavy part is event based, and is the actual finding of the path. This means that you can have monstrous amounts of pathing going on, and will primarily notice framerate issues if they all start to move on the same frame. This can easily be offset by limiting the amount of people that can find a path per frame, and if too many have to move the remainder will check in the next frame.

Just read docs, it can manage 10,000 of them on ios at 60fps. It does this by capping how long it can take in calculations per frame, there’s a value somewhere that lets you specify how many ms it should use in calculating, so it can in theory do a couple on one frame and lots more on another frame. Of course this can lead to inconsistent ai on different ios devices, so watch how you use it.