Hey everyone, just wanted to post a small update on our progress. While we've been working on a bunch of components from UI to weapons and traps, one of the interesting features I want to talk about - interesting from a developer perspective anyway - is finding a way to integrate mob/heard mentality into the mobs of zombies.
In the majority of zombie lore, the undead tend to form heards or flocks when in larger numbers. To recreate this behaviour we needed an algorithm for it and in doing research on this, I discovered exactly that. Boids, by Craig Reynolds, is an algorithm he created in the 80's to mimic the behaviour of flocks of birds and school of fish. Through this algorithm, a boid within a flock tracks three main parametres - distance from other boids, average heading/direction, and cohesiveness with the flock of boids.
Excited to use this algorithm, I began to implement it into the project with controls to set the weight of each parameter and also combine it with our pathfinding and target scanning system. Average direction, avoidance, cohesiveness all have a directional velocity that is combined. In addition, the pathfinding has a directional velocity that also is combined. Even more, it gets to be tricky in tight spaces where you have averages but need to suddenly narrow in to pass through a small opening. Thus, it is important to set the weighting of importance for directional velocity when considering each behaviour.
In the end, we have created heards of zombies that are quite fun to shoot at, blow up, and mame. They will form into mobs when close together, so for players it would be wise to take care and not let the mobs trample you!