Dishonored 2's AI form crews as Lonely Hearts for guards
Artificial investigations
One of the talks I went to at GDC was about AI in Dishonored 2 [official site]. I'm not sure what I was expecting because my encounters with the AI are mostly terrifying. As someone who doesn't play much stealth gaming and isn't great at combat from a first person perspective the AI is primed to deal with strategies I'm nowhere near perfecting and thus it tends to rule the roost. I think I was hoping that attending a talk might open up the AI in a way that meant I understood how to bludgeon it into submission, or at least do something other than kill a guard, drag them back to my safe spot and repeat until I'd cleared a path to an objective. That didn't happen, but I did learn that the AI has a crew system that sounded like a kind of maths-based Lonely Hearts column.
The crew stuff was because Arkane wanted the AI to exhibit group behaviour as well as individual behaviour. If it's not clear what that means, imagine a bar fight with three people each angry with you about a different thing. They're operating as individuals, not co-operating and not taking advantage of each other's skillsets while they try to bash you in the face. Then imagine you're in a bar fight with a pack of lions. Some are chasing you, others are lying in ambush, one has a sniper rifle and might pick you off from a distant hillock… They're working as a group and taking account of each other's roles within the fight.
The second version not only feels more sensible given how you'd expect guards in the real world to behave (otherwise why bother going to the trouble of training them or having captains or different weapon sets at all?) but it also helps add structure and bite to the world. Without group behaviour, larger fights can be a real mess with far more friendly fire sustained.
The broad strokes of what the system does is it collects information, then assigns roles, then gives directions. So when more than one NPC is trying to achieve the same outcome they start to work together. The individual behaviour still exists because it's what the unit uses to achieve those shared aims, it just prioritises and structures that differently to take account of the group knowledge and what role it has at a given point.
The idea is that you get a fluid system where a single unit can merge with a group while its aims align and then wander off when the group activity conditions are satisfied or no longer necessary. It also lets level designers intervene and create or script crew requests if necessary for a particular mission so it's flexibility is a strength.
The devs (AI programmer, Xavier Sadoulet and gameplay programmer, Laurent Couvidou) mentioned earlier GDC talks, such as one from 2013 about Hitman Absolution AI so I'm not saying this was of approaching AI is entirely the domain of Dishonored 2 but this is the talk where I encountered the ideas being explained in a form that was useful to me. I think the Hitman talk is this one if you have GDC Vault access.
For corpses you'd have something along the lines of:
The guards gather up, then they split up to search for the perpetrator, then they gather again for a debrief if they don't find anyone.
That reads far better to the player as a set of actions a group of trained guards might take if they found a body on the streets of Karnaca and I can see how I'd be more inclined to read it as human, as well as being a more interesting challenge for a player.
You can get it to do other things, too, so if you had a group of guards who spot the player and the player then warps to a different bit of the map, the AI will figure out that more than one NPC is seeking the player and send some of the assembled group to see whether there's a viable pathway to the target while those with ranged weapons fire from the original location or shout at you rather than everyone charging off.
This is where the Lonely Hearts comparison came in for me, because it sounds like all these NPCs are sending out little requests via the group AI systems. I thus spent the remainder of the talk drafting these in my notebook:
"Guard, 28, WLTM similar for corpse investigation. Must have own pistol."
"Guard, 45, heard a noise down a dark corridor – fancy investigating with me?"
"Guards, 30 and 29, willing to share investigation of abandoned building and maybe more…"
"Guard, 36, in hot pursuit. Fancy making it hotter?"
"Guard, 33, NSOH, looking for NSA investigation hook up. No time-wasters."