Monday, October 8, 2007

On Zombies Swarms...

Todays six million dollar question is: How do we model a crowd of Zombies marching towards a target? Our first consideration should be that our Zombies have no brains - so we can't just shove some simple minded implementation of the A* algorithm and expect to come out on top - last I checked brainless creatures don't come equipped with automated GPS - my former employer not withstanding :) .

So how am I going to solve this latest problem? My best candidate for a solution is a kind of random walk - except in this random walk the probability of moving in a given direction is supplied by heuristic. This heuristic should be such that if we take the HIGHEST probability and set it to one and all other to zero that our algorithm will provide the same path as the A* algorithm. Luckily - my game map has no obstructions (yet) - so creating such a Heuristic is easy - simply divide up the probabilty amongst the different directions. As an added touch (inspired by a response I got from XNA's forums) - when the Zombie reaches some fuzzy threshold switch from the random walk heuristic to the A* itself.

I'll be posting on how good the results of this approach are once I get them implemented into the game.

No comments: