Artificial intelligence has played many integral roles in gaming experiences for as long as the medium has existed, and perhaps the one that's most visible are non-player characters (NPCs). Rival competitors in a sports game, patrolling enemy guards you have to evade and outsmart, and believable characters you become emotionally invested in for a gripping story-driven experience are all fundamentally powered by AI.
The technologies used for NPCs have also existed for around the last three decades. AI consultant Tommy Thompson of AI & Games tells us, "The same tech that we use to power enemy AI in Doom is the same core stack that's used in The Last of Us."
Essentially, the AI that players have been used to are following symbolic rule-based systems, whether that is finite state machines, behaviour trees, or planning systems, with preset goals and possibilities. For example, in a stealth game, an enemy has a goal to detect and hunt down the player, be alerted to noise, sweep the area, or alert backup.
Generative AI, however, has become a hot topic that can potentially shake up the games industry as well as other sectors. While deep machine learning has already had applications, such as super-sampling techniques used to increase the resolution of a game without having to draw on a hardware's raw power, there are other experiments exploring how this technology can transform game experiences for players. One of the exciting use case is for a new generation of NPCs who can behave and interact with the player without a script.
Recent demos – such Nvidia's Kairos demo using Convai or Ubisoft's Neo NPC prototype using Inworld's Large Language Model (LLM) – have the player using their own voice to converse with an NPC via microphone. Instead of predetermined answers, these NPCs are able to respond naturally and unscripted with improvised dialogue, which means you'll get a different response each time and depending on who they're speaking to. In other words, an actual conversation.
Tommy Thompson
Having attended these demos, Thompson can understand the intent and appeal behind them. "What they're trying to do there is enrich the interaction between player and NPC," he says. "Historically, your interactions are based solely around some sort of transaction, like, 'Go kill six big rats, come back and here's some XP'. What these tools are offering is a much richer mode of interaction where you can ask them how their day's been, you can ask them things relevant to the context of the game world and have them respond to you. It's showing a level of conversational acuity that we've historically never really seen in games before."
There has been controversy around generative AI as fears that a technology that can create new content by itself means the loss of jobs – does a writer need to write dialogue if NPCs can come up with their own responses? Quite the opposite, as it turns out. Narrative designers may not need to write individual lines of dialogue but they are still building a character's backstory and all other kinds of information pulled from the world's lore that goes into a model.
"You have to be sure that it's going to stay in the context of the narrative," Thompson explains. "What's the data that you use to train the model and allow it to understand the world that it exists within? Then critically, you have to tweak that model over time, so that it knows never to bring up certain things. So, if you were to do a sci-fi scenario, I wouldn't be able to ask, 'how did Arsenal score at the weekend?' and it has a response to it."
While these demos seem like examples of levelling up NPCs, Meaning Machine's co-founder and creative lead Thomas Keane is more sceptical when they're applied to what already exists, such as a typical questgiver NPC.
Thomas Keane
"AI for AI NPC's sake is a dead end," he says. "One of the key things is you have to build games that fundamentally value open conversation. There's no point in adding open conversation to Call of Duty because I just want to shoot the baddies. We're exclusively interested in using this technology to open up new creative frontiers led by creative people. It's more about broadening and opening up the horizon rather than making a more efficient meal of the current horizon."
The studio has already spent its initial years creating different types of games with conversational AI at its core, such as Battle Banter where NPCs give backchat, and Praise Be, where players write prayers to the gods in hopes of being rewarded with valuable resources. Its upcoming and first feature-length release, Dead Meat, is a murder mystery interrogation game where the player is free to ask the suspect anything with their own words with the goal of trying to get a confession out of them. Likening it to Dungeons & Dragons, except you get to be a detective and the director of the game, Keane says, "You bring whatever agenda you have to that suspect and you can essentially drill into them and understand what makes them tick."
An added twist is that suspects will not only respond naturally but the player can also read their minds and get their internal monologue, providing more threads to pull on and get closer to cracking them. Keane clarifies that the whole process, with the final game containing 20 suspects, has also relied on a team of writers to create the content.
"Generative AI experiences are only good when writers are at the centre of that experience," he adds. "Fundamentally, all of our work is dependent on our own writing team creating content that is of a high quality first, and AI is just a way of bringing that to life."
Ben Ackland, the studio's co-founder and technical lead adds: "Generative AI is almost a delivery mechanism, it's a way to allow us to deliver a deeper or broader experience for the player. The reality is that not only do our writing team write the character, the backstory, the timelines, a lot of history, a lot of lore around what's happening in this world that we've created, but they're also continuing to write lots of example dialogue for different scenarios in lots of different styles to help deliver a consistent and enjoyable experience. What AI is allowing us to do is then deal with the unknown and different scenarios."
Ben Ackland
The freedom of how players can interact with NPCs makes generative AI very tantalising, but at the end of the day, it's also considering how to best use it. After all, in story-driven cinematic blockbusters, is it necessarily a beneficial for key characters to be improvising during a major sequence where the designers are working towards curated emotional beats?
"You'll arguably see [developers] falling back more on traditional approaches for characters that exist solely in the fiction for a purpose, because having a conversation with Darth Vader seems a little inappropriate," Thompson suggests. "I think it's going to be interesting to see where this is applied and how it's applied particularly in the kind of games where the overall narrative direction is still really tight and really focused."
In the case of Dead Meat, where the developers are promising to give players freedom in how they approach the game, and would expect there to be players attempting to break it, it's important to apply guard rails to ensure conversations stay on topic.
"Our characters are almost conscious as to what's going on in the game," says Ackland. "You might be in a conversation with Lucia, the first character you interrogate, and if you take the topic off in a different direction, she can handle that. We've built a system that steers the conversation, that keeps track of the topics being discussed. It's important for us that the responses from the characters feel human-like and feel in character but also keep the game going in the right direction towards the overall objectives of the game."
There also have to be hard guard rails to ensure player safety and that AI models don't say something offensive, even if prompted by toxic behaviour on the player's part. "We're still trying to figure out how to make an LLM have a lot of flavour," says Thompson. "Villainous characters are inherently mean and can say really nasty things, but there's a tipping point between a character that's being nasty in context of the narrative to where you end up suddenly violating age ratings."
If considering other forms of enemy AI, it may also be that enemy behaviour doesn't need to be generative to be more advanced. Traditional rule-based AI, as seen in The Last of Us Part II, where enemies actively communicate with each other to track you down or cry out a comrade's name when they've been killed, can already achieve remarkable results but a more intelligent AI might also make the same scenario overwhelmingly difficult, as designers already intentionally dumb down AI behaviours.
One application Thompson thinks has potential is for commentary in sports games. "Instead of Gary Lineker or whoever saying the same 20 canned lines or saying the wrong thing based on the game state, you could pump into an LLM the transcripts of a specific pundit's commentary for the last 10 years, then it has the capacity to generate lines evocative of how that person speaks, put through an AI voice synthesiser."
Based on the current demos showcasing generative AI, Thompson still says they're a work in progress. "I've yet to see any of these interactions where I think, 'This is something I actually want to play.' They're technically interesting, but we're going to have to see more trial and error in figuring out how to elevate this into something that's really good and we need to recognise the role of narrative designers, generative AI isn't actually going to replace a narrative designer but support and supplement them."
But instead of just trying to think how generative AI can fit into the existing mould of games, Keane concludes that the focus needs to be on experimenting on new gameplay formats and possibilities for it to be truly worthwhile.
"Only with generative AI can you have Dead Meat, a game where you can really ask this suspect absolutely anything and dig into any part of that character's world. I think it's about a paradigm shift that we need to be aware of. This isn't a plug-and-play thing. Not every game should have AI NPCs. Every game needs to consider their value and either integrate them or shift to a new space where they become valuable."