for group path finding (such as many zombies chasing a player)

Subscribe to for group path finding (such as many zombies chasing a player) 6 posts

avatar for qwerber qwerber 4717 posts
Flag Post

ever thought of generating a flow field? How would i generate the flow field in a cheap way?

 
avatar for UnknownGuardian UnknownGuardian 8144 posts
Flag Post

http://www.gamasutra.com/blogs/TylerGlaiel/20121007/178966/Some_experiments_in_pathfinding__AI.php
That type should be a once per frame cost, generate distance based flow field one time only and all zombies use that grid to know where to move.

My own pathfinding is sight based. If zombies see the player, they move towards him. I’ve implemented a repulsion equation, as well, to keep the zombies spread out a bit and vary the paths each take.

 
avatar for Ace_Blue Ace_Blue 1094 posts
Flag Post

Thanks for the link, that was a great article.

 
avatar for DrYoshiyahu DrYoshiyahu 678 posts
Flag Post

Yeah that article is fantastic! Much better that my original idea for AI which was a set route determined for each mob each frame.

UG: How do you do repulsion anyway. My game has big 50×50 tiles so it’ll look awful if the mobs aren’t spread out a little.

 
avatar for UnknownGuardian UnknownGuardian 8144 posts
Flag Post

Loop through and check distances. If they are too close, shove the other one a bit away by giving it a speed vector. Add up all the speed vectors each zombie is given before it moves and then you’ll have the real speeds/velocities/whatever-you-want-to-call-its the zombie should go. Add that final speed vector to the x/y coords for the actual movement.

 
avatar for Draco18s Draco18s 6860 posts
Flag Post

I saw the thread title and thought “Know what would be hilarious for this? Using boids.”

Just think. One zombie sees the player and finds a path, and all the other zombies go, “food?” and follow the first zombie.