How fast are MultiTargetPath and FloodPath?

I’m considering using pathfinding to determine whether the characters in my game hear noises. When a noise is made, I want to create a path between the character and the noise-- and I want this path to be blocked by doors, so that characters can’t hear noises through doors.

The way my game works, this would happen a lot-- like, every time a gun is fired, it causes a noise to be created, which finds a path from the gun’s position to at least several characters. Unfortunately, StartPath doesn’t handle this very well.

I’m considering purchasing the Pro version for a couple of functions that appear to handle this sort of thing. Could I expect MultiTargetPath and FloodPath to work a lot better in this scenario, or would the game logic need to be changed in order to get good results? What sort of speed might I expect from these two functions?

Maybe there’s a better solution to this problem that doesn’t even involve pathfinding? Some other sort of flood algorithm? The game is 2D top-down tile-based, so come to think of it that might actually be a good bet to look into…

Hi

You really don’t want to do that every time a gun is fired, that would be really slow.
The speed of a multi target path and flood path is roughly proportional to the number of nodes they visit. In rough values maybe 1 or 2 milliseconds per 1000 nodes. You can see the nodes they visit by using the path debug options (see A* Inspector -> Settings -> Debug).

I can recommend the book Game AI Pro which has a chapter on the noise detection system used in Crysis.