Can I use MultiTargetPath with multiple AIPaths?

  • A* version: [5.4.5]
  • Unity version: [6000.2.13f1]

In our game there’re lots of enemies that follow player. At first I think using the enemies’ positions as startPoints of MultiTargetPath can be much faster than using ABPath per enemy. But after I saw the documents, I think it isn’t possible to use the calculated paths of MultiTargetPaths with multiple AIPaths and it seems not intended to be. Is it right? or is there any way to use MultiTargetPahts result with multiple AIPaths?

How many are we talking here? Enough to warrant them not having their own individual paths?

It sounds like you want to use the MultiTargetPath “backwards” towards the player, correct? That’s not impossible but I’m thinking you’d need some custom movement for that. I’m looking into it now, but can you explain a bit more about your use case so I can see what options are a good fit here?

It sounds like you want FloodPath - A* Pathfinding Project

Typically, I wouldn’t recommend it, as it’s more complex, and the normal pathfinding is usually more than fast enough. But it’s definitely an option if you want to.

You’re right. I will use MultiTargetPath “backwards”, with multiple startPoints and single targetPoint. There would be 20~30 enemies per stage in game. I think if I use MultiTargetPath for my case, I have to create ABPath instances with each path of results in MultiTargetPath. And I think it would be pretty complex and not intended.

There would be 20~30 enemies in one stage. What do you think about it? Just using ABPath per enemy is faster than using one MultiTargetPath?

20-30 enemies will not have any problems with one path per agent. It’s too much complexity to use MultiTargetPath/FloodPath compared to what you win from it, in this case.

1 Like

Okay, Thank you! :grinning_face: