A* Pathfinding Project

Managing a lot of targets


#1

In working in a top-down 2d game. And I want my village to feel alive. This requires all my NPCs to move around the village. I was wondering how you would approach this? I.e if you had 15 NPCs, how would you manage 15x20 destination-targets? Is the only way to swarm my scene with empty gameobjects (targets) and get their transform?

Just wanted to check if there was some smart way of approaching this before I began.

Thanks!


#2

Hi

You could check out this tutorial https://arongranberg.com/astar/docs/wander.html


#3

Looks promising, thanks!!


#4

Is there any way to make them follow roads or is it completely random? :slight_smile:


#5

You can set a higher penalty for non-road regions.
See for example https://arongranberg.com/astar/docs/tags.html


#6

Perfect, thats amazing