Video link: https://youtu.be/UgXWceqaVdw
We got the bigger, better elk herding behaviors in good shape last fall, but that was only for adult elk. Now we are adding calves, which complicates things. By autumn, elk calves (whether male or female) look like small versions of adult cows, but they’re not always as cool under pressure. When a calf has a wolf on its tail, it’s much more likely than an adult to veer off away from the herd. Sometimes the mother will stay with it to protect it, but not always.
So Tommi dug back into the Elk AI to set up these new behaviors. Here’s how he tackled it:
We’re very excited about the ways that calves will make elk hunts so much more interesting and excited — not only during the chase, but after the calf stops running and (sometimes) the mother comes to defend it from attacking wolves. Those calves look like easy kills….but they aren’t always.The whole elk stinking feature has been a pretty interesting challenge from the start. In the fall, I spent some considerable time tweaking the Boids system to produce this natural, dynamic chase behavior. And now it was time to add new behavior — calves, with mothers protecting the calves, and the veering off behavior – on top of that.
The first problem was that the mothers and calves now wanted to run next to each other, instead of simply concentrating on staying with the herd. This often meant that they'd run slower than they'd otherwise run (in order to wait for the other), which could create "traffic jams," which would split the herd into faster and slower groups. And when I introduced veering off, suddenly many other elk would decide to follow the one that veered off instead of the main herd. So I had to add a special rule that veering off elk are not considered part of the herd.
The veering off behavior caused another problem as well: If an elk suddenly changes direction in the middle of a running herd, it can cause another "traffic jam" situation, where suddenly the orderly chase turns into chaos, with everyone running in different directions. How did I resolve all of this? Tweaking a lot of numbers and testing it over and over. And over again. (And then some more.)