What does this mean for me? You will always be able to play your favorite games on Kongregate. However, certain site features may suddenly stop working and leave you with a severely degraded experience.
What should I do? We strongly urge all our users to upgrade to modern browsers for a better experience and improved security.
We suggest you install the latest version of one of these browsers:
Kongregate is a community-driven browser games portal with an open platform for all web games.
Get your games in front of thousands of users while monetizing through ads and virtual goods.
Learn more »
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.
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.
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.
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.