A* Pathfinding Project

RandomPath hugs the Penalty zones edge


#1

Hi

I am trying to make a group of human npc’s walk forward between two penalty areas (a muddy path on the ground). They are using randompaths,rvo, gridgraph. I want them to walk beside each other in a “clump” all the randompaths are calculated hugging the penalty zone so they walk in single file, how could I fix this - is there a way to offset the paths?


#2

Hi

The RandomPath will still be the shortest path to the point it ends up at, so it will hug those areas if that is the shortest way.

For group behaviors I would recommend that you calculate a single path for the group and let all units follow that at an offset. This is not something that is currently included in this package, however if you want to read more about it I strongly recommend that article “Company of Heroes Squad Formations Explained” in the book “AI Game Programming Wisdom 4”. I think it’s available freely online.


#3

Thank you very much for your quick reply :D, I will check that out, could I not use floodpath with an offset?, if i had one path for the group it would not really need to be random anymore


#4

I have fixed the problem myself, thanks for your help i just set the ai destination of the followers in the group to a leader and he has a path while the followers just follow him, cheers man