I want to optimise pathfinding, so my question is
Do I have each NPC run their own pathfind / ComputeAsync
or
Have a master script that runs one ComputeAsync for every NPC (let’s say with a certain tag)
I want to optimise pathfinding, so my question is
Do I have each NPC run their own pathfind / ComputeAsync
or
Have a master script that runs one ComputeAsync for every NPC (let’s say with a certain tag)
The second option is good if you have lots of NPCs in clusters, like zombies. You can add code to re-use paths when the start and end are similar, or just tell the NPC to follow a nearby NPC that already has a similar path.
I agree, the second option seems optimal, but I struggle with understanding how to implement it.
If you could provide an example, I’d appreciate it.