FilipeTessaro - Herdcraft: Wildlife and Crowd AI on Mass - Herds, Predators, Birds, Fish, Hordes

Herdcraft fills your world with animals that live on their own, by the thousand. The animal kits on Fab give rich behaviour to dozens of actors; the crowd frameworks give scale to soldiers and zombies. Herdcraft is wildlife at crowd scale: deer that drink at dusk and sleep at night, wolves that hunt them, birds and fish, tens of thousands at once, in multiplayer.

Far away, numbers. Close up, actors. Every animal is a MassEntity entity drawn as one instance, playing its walk, graze or run from a baked vertex animation. Near a player it thinks more often; close enough to touch, a pawn with collision and an animated skeletal mesh stands in for it, so shots, traces and your own AI work on it. When the players leave, it goes back to being numbers.

They move like animals. Each one walks forward along its body and turns into its new heading at its own pace. It sees a neighbour coming and steps aside early, keeps its personal space in a packed herd, overtakes the one holding it up, and its close up animation fades from one loop to the next. A scared herd runs clear of the other herds and their runs instead of through them, and a member caught away from its herd runs on its own and finds it again after.

Herds and packs with a shape. Each member has its own place in the group: loose, tight or in a line. A pack goes for one prey together. Leaders, patrols over a territory and migrations along a route.

Prey and predators, each its own way. Set per species:

  • How prey answers a threat: flee together, scatter, freeze, or stand its ground and charge.

  • How a predator hunts: pursue, ambush from cover, encircle the herd, or charge.

  • Kill at once or bite down over time, then eat there, carry the kill to its den, or hunt again.

  • Stamina that runs out, a cone of sight, worse eyes at night, and noise you can make anywhere to draw carnivores.

An example night hunter shows how far a species can be from a wolf with the same data.

Behaviour as data. Each species is a data asset:

  • Needs (hunger, thirst, fatigue) and a list of activities in order of priority: graze, drink at a water source, rest, sleep on a clock, patrol a territory, migrate along a route, follow a leader.

  • Relations to every other species: hunts it, flees from it at a distance, keeps an eye on it, ignores it.

  • Up to four states of its own (a howl, a dig, a pose) with their animations, near and far.

  • Birds that fly to far goals and land near ones, fish that live in the water and never leave it, carnivores that hunt the players and bite through the engine's damage.

Multiplayer from the start. The server runs every brain; clients get 7 bytes per animal and walk their copy the way the server does, so they stay close between corrections. Animals near a player and animals that just changed their mind go first. It does not use the engine's Mass replication, so it works on a listen server and the 5.8 changes to Mass replication did not touch it. Hosting and joining is in the demo.

Your own brain when you want it. A Blueprint brain decides for the animals near the players and hands the rest back to the built-in one; a C++ brain runs on every worker thread for all of them. Or let your own AI Controller drive the close up actor, and the herd follows it.

They go round things. Rocks, walls and trunks with collision are found by themselves as the animals come near; add circles for what has no collision. A running animal goes round the side instead of turning back into the ones behind it. The same on the server and every client. World Partition maps work.

Blueprint first. Spawners with densities and respawn out of sight, and commands and queries for everything: scare, make a noise, herd a group somewhere, send one animal, damage, kill, remove, needs and activities, nearest agent, agents in a radius, events for deaths, kills, alarms, bites and hunts.

Bring your animals. Set a skeletal mesh and its animations on a species and press Bake Far Animation: the plugin makes the far mesh, the vertex animation texture and the materials for it (with the engine's AnimToTexture plugin, in the editor only).

Two demos inside. A meadow with deer, stags, wild horses, wolves, foxes, eagles and fish, a day in 12 minutes, and a horde of wolves after the player. Walk, fly, shoot, roar, herd, switch from 2,000 to 50,000 animals, and read the costs on the screen. A Windows demo build to try before buying is linked below.

What it is not. No MassGameplay, no navmesh, no ZoneGraph: Herdcraft runs its own processors on the engine's MassEntity, so it does not depend on experimental plugins. Animals move on the ground (or in the air and the water) over any static geometry; they do not path through mazes.

Unreal Engine 5.6, 5.7 and 5.8. Windows. C++ with full Blueprint access. Demo animals, trees and grass by Quaternius (CC0).

PS: Feature requests are accepted