This is The Mechanic, where Alex Wiltshire invites developers to discuss the difficult journeys they’ve taken to make their games. This time, theHunter: Call of the Wild [official site].

You’ve been tracking the herd for fifteen minutes, and now, finally, you’re close enough to see your first deer. You raise your binoculars and edge closer, but a branch scrapes your jacket. The deer’s ear twitches and it turns and trots away. You freeze. The deer stops and turns its head to look back in your direction. You crouch but the deer barks, alerting the rest of the herd, and moves on again, disappearing into the undergrowth. The hunt continues.

TheHunter: Call of the Wild is a hunting simulation that goes far beyond anything in a Far Cry or Tomb Raider. Here, you’re alone in large expanses of wilderness, following wild animals which live out lives and react to your presence in many complex ways. They’re the result of countless hours of AI design and animation that closely model the behaviour of wild beasts, but they’re also part of a game, a fact that lends Call of the Wild a fascinating relationship with the natural world.

Hunting games don’t work like most games. Designer Dan Peake, who worked on games like Mad Max before he joined Expansive Worlds to help make Call of the Wild, had think about design in very different ways.

“I had this rule that if something happens and the player doesn’t see it, it doesn’t happen,” he tells me. “Anything in the world that the player is not experiencing is kind of wasted.” But it’s not in a good hunting game. “That’s something I had to understand and work through.“

Call of the Wild simulates the movement of 1500 animals across the world. In herds or alone, they sleep, eat and trek to new locations as days pass, following schedules that take them through their home ranges. “And the player doesn’t know about them and probably never even sees them because they’re five kilometres away and it’ll take three hours to get there,” says Peake.

Many players won’t have any idea that there’s a world of animals outside their ken as they stumble across the tracks they leave behind, but hunters, who have an understanding of how animals move and what they do at varying times of day, expect this kind of detail, and they can understand it when they see it.

“We’re interested in making a living and believable world, and that’s really one thing that’s important for players,” says fellow designer Björn Öjlert. “I know there are some who want to walk around and look at things, and they don’t want to shoot the animals, they just want to experience nature.”

Actually making something this detailed and credible, well, that’s been a journey. Call of the Wild could lean on the years of development that went into theHunter Classic, which was originally launched back in 2009 and is still being supported with new content. But creating the behaviour of its animals is still down to a vast amount of work.

Making them realistic, that’s one thing. I’m kind of surprised that neither Peake nor Öjlert hunt themselves, but Peake says all the research Öjlert has put into hunting over his time working on both Classic and Call of the Wild means that he’s become an expert, at least on a theoretical level. And he needs to be, since about 60% of Classic’s players are actual hunters, and they have high expectations of realism.

But Expansive Worlds also wanted to make a game that’s good to play. Even hunters don’t want to play the exact hunting experience on their PCs. “Instead of sitting in a tree waiting for three days maybe you wait 10 minutes, which is still a very long time in a videogame, but it gets across a similar feeling without it being too annoying,” says Öjlert.

Similarly, hunters watch animals way more than they shoot them. They learn to understand the way each different species signals its intentions, and that means Call of the Wild’s deer, wildebeest, moose, bears, bison and coyotes have to also signal to players.

But beyond hunters, they wanted Call of the Wild to appeal to non-hunters, who know little about the animals they encounter so the game had to do a lot to tell them. And so a great deal of making this game was, for Peake, all about getting the animals to communicate with players.

“We had a lot of problems trying to get an understandable communication that this animal is in this state and is going to do this,” says Peake. One possible way to do this was through UI floating about the animals’ heads, but that would never do in such a naturalistic world. So they communicate everything about the animal’s internal state through animation. “Because that’s the best way.”

The result is hundreds of different animations, which are an amalgam of the real movements the species would perform and movements that a broad range of players can read and recognise.

“So that deer there has just put its head up, it’s slightly nervous and it must have heard me so I should back off and let it settle down a bit,” says Peake. “Balancing how and when we play those animations and how they act in real life was very tricky.”

In general, Call of the Wild’s animations are slightly exaggerated. A real deer might merely raise its head and twist its ear when it hears something out of the ordinary, but in the game it would glance in the direction of the noise, giving the player a better idea of what it’s reacting to.

The animal behaviour underneath these tells is all down to trees. And fear. And a massive spreadsheet that Öjlert made. “It’s ridiculously complex,” he says.

“It’s a magic soup of all of the senses, all of the events that are happening: hearing the player, hearing gunshots, seeing the player, smelling the player,” says Peake.

These events feed into each animal’s internal fear level, making it more afraid. And as its fear level crosses certain thresholds, it switches into new behavioural states.

“Where they change state depends on the species,” explains Peake. “So a certain kind of deer could be really skittish, so as soon as they hear or see anything, a tiny bit of fear, they run away. Moose couldn’t care less if you’re walking nearby, so their fear needs to go all the way up the bar before they start to change behaviour.”

These behavioural states are a sort of escalating DEFCON-like set of levels that go from calm to attentive to alert to alarmed and then to defensive, which is when they’ll run. And each state is governed by a complex tree of different actions that mix together randomised and prescriptive actions as the animal plays it out.

All these different states mean that Call of the Wild’s animals perform a lot of behaviours, each of which had to be animated for each species so players would recognise it. And there also had to be transitions between each state where the animal might have a chance of barking a warning, or playing another specific animation.

And then there are the animals’ other behaviours, which govern sleeping, feeding and traversing the world. These trees are pretty small, and generally only took Peake and his team a few days to create for each species. But any behaviours which are based on interaction with the player are far larger, such as the ones which govern the player using a lure to attract an animal close, and for when an animal is alert.

Peake can’t begin to estimate how long these player-facing states took to put together. “You want to get that behaviour perfect, the communication right, the movement right,” he says. “So it’s not just standing there playing an animation, it’s heard something over there, so it trots away in the other direction, stops, looks around, moves away a little more because it’s still nervous. Another species is maybe the opposite, facing towards the noise and not moving, eyeballing it to make sure there’s nothing there. Getting that detail and readability, that’s a real time sink. You can go endlessly, just keeping adding stuff and modifying behaviours.”

In some ways, then, the real stars of Call of the Wild are its animators, who breathe such life into these digital constructs. “It’s so cool when they get it right,” says Öjlert. “One of the things we introduced in Wild is the ability for animal to stop mid-step, with one leg up, and when you see it, it’s how it should be.”

And to know all this is all so persistent across the world, that the herd you tracked hasn’t just been spawned there, that it has a history of trekking across the world and that there’s meaning to you meeting it right here and now, that’s magic.

“One of the things that’s cool with the hunting games we made is the simulation, and that’s so different to other open-world games which just simulate around the player,” says Öjlert. “In this game, there’s an actual world, and that makes it so much more interesting to explore.”