Building Hunted’s AI: Some Fundamental Elements

So Jim has been going on about how dynamic AI combat is the heart of Sir, You Are Being Hunted – let’s look at what that means from the perspective of the development work we are actually doing. I’ve illustrated this with a few shots from the AI testscenes build, which shows some of the “scene view” elements of Unity’s editor. Obviously the scenery and so forth is placeholdery and not actually intended to be seen as the sort of scale or density we’re expecting for a final game.


One of the key features we wanted in Hunted, was the ability for enemy AI to behave as autonomously as possible. Rather than groups of AI being introduced at scripted intervals and exisiting only to provide staged skirmishes for the player, we wanted to see them wandering about the landscape with their own objectives. This adds a significant level of complexity to any AI design.

The enemy NPCs in hunted come in several varieties. The main class are the mobile hunters – the red visored chaps you’ve seen in the first few screenshots – these guys patrol from one location in the world to another, and on arrival will rest, interact with one another and perhaps search the local area for tresspassers or loot. To facilitate this I designed a procedural generation system that places detailed areas of interest (hubs) across the world, connected by trails across the intervening terrain. The hunters move in squads of different factions and travel along these pathways between the hubs. Navigation is done via a nodebased a* network, which is created and stored at the same time as the world is generated. Hubs contain a much higher level of detail in terms of obstacles and waypoints. Hubs generally attract both the player and NPCs as they are generally the location of valuable resources and cover/safety. The wandering hunters have several states of behaviour, governed by a simple Finite State Machine manager. The states are:


Wander: NPCs move between hub locations based on various internal reasoning algorithmns, sometimes they will stop for a while and rest, or even loiter on roads outside of the settlements.

Alert/Search: If an NPC hears a nearby sound, or sees either the player or another NPC from a rival faction, they will switch into this state. In this state the hunter approaches locations close to the last heard sound or last sighting, their viewcone detection increases and they will continue exploring nearby areas until they encounter an enemy or eventually get bored and return to wandering.

Combat: If a hunter sees a target and can approach to within combat range (dependent on the range of their weapon etc), they will do so. In this state NPCs will reload and move to keep in range of their target and when losing sight of the target they will attempt to round appropriate corners to track them down.

Cover: Every time an NPC is injured they have a chance of switching to a cover-seeking state (more likely as they become more heavily wounded). When in this state they abandon all combat and run to the nearest cover location (essentially calculated from a list of locations that are out of sight of the enemy that is pursuing them). Once in cover they will constantly look around themselves to spot any chasing enemy. If found and attacked they will run on to another potential safe spot. If safe for long enough they will regain their courage and return to either a combat or search state.


When two opposing squads meet at a hub they react to each other in the same way as they would to the player, a skirmish occurs and one side will usually end up wiped out (though occasionally they may pass safely by each other or a few stragglers may escape to wander onwards). Debugging this sort of AI is a tricky task, as the character models don’t (currently) easily indicate what state they are in. To remedy this I draw a number of helpful indicators in the scene window. Icons above NPCs show their states, their HP and their faction. Viewcones, target lines, shot lines and sound lines are also available. The system is going to require Jim and James to spend a lot of time working on balancing, as we have to deal with situations where other players and NPCs also enter the fray (at the moment hunters that are infighting will only switch to the player if they are significantly closer and not already engaged).


Right now the framework for all this behaviour is in place, and we now need to start making it function as games usually do – with visual feedback that can understood in the context of the game, and the appropriate behaviours for a player to work out what is happening, and successfully interact with the AI. We’re hoping to have a “test village” up soon, and from there we’ll be able to show off some of the behaviour in motion – complete with some more tech bells and whistles that will make the factional battles believable and compelling.

In future we’ll talk in a bit more detail about combat behaviours, and also the way in which we intend to enable to hunters to actually track down the player.

Poachers, TweedPunk, And Clever Materials


Click images for full size!

Sir, You Are Being Hunted is focused on dynamic AI combat across an open world. We want encounters to occur naturally rather than being scripted. The heart of the project is therefore based around our robot enemies hunting you, and each other. That means developing some interesting global and local AI behaviour, which Tom will be talking more about later this week.

What you can see in today’s screenshots is our second AI character, called The Poacher. These are stealthy, ambush-based baddies, who lay in wait for you across the landscape. The Hunters, which we’ve posted a few screenshots of previously, are much more active, and pursue you across the landscape, heading to where there has been player activity, to seek you out and take a scalp.


Of course when robots from different factions meet, there’s likely to be a fight. The Poachers happily take down tresspassing Hunters if they encroach on their territory. Poachers tend to carry and use traps, which can render their opponents wounded and immobile – dangerous for an exposed Hunter, or the unwary player. Cunning Hunted players will be able to re-purpose these traps for their own devices. Some Poachers will even carry dynamite – you know, for fishing and stuff.


You might notice that some of the objects in these new scenes have different levels of shader detail. This is because we’re experimenting with some essential tools for world-creation, such as substance textures. You can see that on the wall that the Poacher is shooting over. Rather than creating a final texture, we are able to play with variables and generate vastly different-looking walls by using a single material. This is a technology we’re hoping to apply to a number of procedural features in our sinister countryside, such as hedgerows and walls.

Finally, we’ve had a few comments on the “Steampunk” nature of our world – we’re not entirely happy with that. It is, perhaps, in some ways steampunky, but certainly not Victoriana. There are elements of high modernity – the laser visors on the Hunters, wind turbines, and so on. If such labels must be applied, we’d like to appeal for you to use “TweedPunk”, “ToffPunk”, or “UncannyChapPunk”. Thanks!

More soon.

Sir, You Are Being Hunted

Yes, Big Robot is going to make a game featuring robots. It’s called Sir, You Are Being Hunted, and it taps into a rich seam of tweed-loving British science fiction to conjure a sinister reality where artificial gentlemen hunt humans for sport.

From a development point of view, Hunted is a stepping stone to what we want to do with our procedural-world generation project, Lodestone. The world-building tech for Lodestone is well developed, but actually we wanted to do so much with it that breaking down some of the tasks into entire spin-off games made sense. Hunted, therefore, is an experiment in the kind of intelligence required for robots to hunt each other – and you – in a dynamic open world.

Hunted is set in a recognisably British landscape. Its inhabitants are a mockery of the aristocratic country gent and his ecosystem. Robots that ape tea-drinking, poachers that lurk in reed-beds, and red-eyed hounds that patrol the moor: these are the things you will be dealing with as you fight for survival. The game gathers up elements of my favourite things: exploration, AI interaction, survival, robots, hot drinks, and blends them into a rich pixelly pulp. (A “British indie S.T.A.L.K.E.R.” might have been something we said in the design meetings…)

So that’s Hunted. You can expect tonnes of detailed information on this – videos, details about the release of it, and so on – in the coming days. We’re also going to update this blog with a load of details about how we’re making this game. Regular development diaries will become a feature, and we hope to give everyone an insight into the process we’re going through to get this lo-fi indie open-world shooter made.

More soon! But while you wait, have a browse of these pieces of concept art by the wonderfully talented Christophe Canon from Frogames.