Climb On Up and Talk With Me, in The Dialogue Tree!
First things first. Though this blog used to be known as The Metro City Reform Committee, it has been rechristened as “The Dialogue Tree” for reasons that should be obvious: I often leaf behind the roots of my topics and branch out into fruitful discussions that stump those who bough to convention . . . aaaannd I’ll stop with the puns before I get murdered by an angry mob.
Besides, it just sounds nicer doesn’t it? Hopefully it’s more memorable too. I was tired of people saying “Metro Committee? Like some sort of politics thing? Or do you work for the MTA? Both? What’s the best route to get from Landover to Braddock?”
So without further ado . . .
LAST TIME I started delving into (as one reader pointed out) matters of the mind, albeit the player’s mind, and how the space of a game world could be used to affect it. This time we’re going to delve into the minds of the NPCs that inhabit our game worlds with us. Or really, into the system we call AI, which really isn’t the same thing as a mind.
At least not yet. But according to every other science fiction story it’s an eventual guarantee that we get machines to think freely.
Like that one episode of The Next Generation where Worf drew in a billion Enterprises from all over the quantum universes, there are so many possibilities with this topic! AI is one of the most complicated subjects in human-cyborg relations other than figuring out how to make sex-bots socially acceptable. It’s also one of the core aspects of electronic entertainment. Something that no complex game, and certainly none with NPCs, would be the same without.
But like the more pessimistic Sci-fi stories that deal with Skynet running amok and killing all of humanity, and as the eponymous TVTropes page suggests, AI is a crapshoot. In the video game industry, this is about as close to literal as a metaphor gets. The quality of AI in video games is probably the least consistent aspect of the medium and is completely different from one game to the next.
For every game that does AI “right”, or at least as well as it can given the time it comes out in, there’s one (if not six) that do it poorly. For every moment of brilliance exhibited by an NPC teammate, there’s an escortee screaming at the player while they jump into a cyberdemon’s firing solution. For every group of enemies that use genuinely brilliant tactics and techniques to outsmart you, there’s an idiotic AI rigging the rules, because like most wives know, sometimes it’s just easier to fake it.
So with the wildly disparate quality level of AI from one game to the next, and considering how narrowly defined it can be to fit the specific conditions of any particular game’s ruleset, and the fact that AI in games isn’t really any form of reasoning that could constitute intelligence in the traditional sense, and that the price of tea in China is currently 2 Yuan per pound, can anyone say objectively what qualifies as “good” AI?
Is it a lack of bugs? Is it the complexity of the system? Is it the ability of the AI to generate emergent behavior?
What really matters when it comes to making an NPC feel like they’re lacking that “N”?
What is the Measure of the Mechanical Man’s Mind?
Actually, I don’t think the answer to this question is all that hard to figure out. The most important thing for NPC AI for the average player is that it fulfills the functions of an NPC’s role while – and this here’s the important part – not calling attention to itself. That it doesn’t make me realize that the character Gorle Fitzpatrician isn’t a Drulluvian emissary here to convince the Conine Concord to open their borders, but just a simple Finite State Machine responding lifelessly to the piddling number of actions it’s capable of recognizing.
The game’s AI needs to con me like a Nigerian prince after my social security number in order to facilitate a more noble cause that’s just as illusory: immersion. Immersion, or losing the sense of observing a game from without, really is one of the best things in gaming aside from all of the jet-packs and laser beams. But AI-controlled NPCs are everywhere in most games with a strong single player component, and are even likely to appear in a lot of multiplayer modes these days. Whenever you can see that the AI is obviously buggy or cheating, it breaks the sense of immersion faster than a Kardashian can file for divorce.
So making an NPC’s AI indivisible and invisible is important to making it seem alive, that’s clear. But as long as you don’t see the princess you’re protecting run into walls as often as a crash test dummy, and the enemies keep shooting or sending their armies at you, would you really notice?
In all likelihood . . . probably not. The average player doesn’t really expect much out of a game’s AI other than to not break, as most of the AI and NPCs a player encounters are probably enemies killed within six to sixty seconds of meeting them. As long as they die properly and have some sort of rudimentary ability to attack, it doesn’t really matter if the Nazi zombie has digital dreams.
“It works well enough” seems to be the motto of AI designers and players worldwide, because it’s already difficult enough to get there. If you want proof, look for notable AI developments in gaming over the last few years; aside from Left 4 Dead‘s AI Director in 2008, there haven’t been any huge leaps in the field, and that’s related less to actual NPC AI but more for a metagame system! If you’re looking for notable NPC AI, you might have to go back to F.E.A.R. in 2006 to find a game that went, even slightly, beyond the norm of “GOTO PLAYER. KILL”.
So is it just about the elimination of bugs that should factor into the quality of the AI then? I mean, as long as the difference engine subroutine I’m calling AI doesn’t break or cheat, it should remain like I said above: inconspicuous and intangible. If it doesn’t matter that it does anything new for most, this should be enough.
Except, it isn’t.
If you Open the role, You need to Open the mind.
You see, one of the reasons I think people are OK with the limited nature of AI in most games (say Call of Duty‘s enemy soldiers) is that the roles the NPCs are performing are themselves quite limited (shoot at the player, attempt to not die occasionally). While the quality of the AI is still a critical issue that can make or break any game that features NPCs, if the roles are narrowly defined or assigned to very simple concepts, the AI doesn’t need to follow suit.
This “simple role/simple AI” mentality is what’s at play in Dark Souls. Most of the enemies the player runs into exhibit absolutely no life or intelligence. Until the player enters their range of perception, the enemies in Dark Souls act like Jeff “The Dude” Lebowski and just sort of hang around doing absolutely nothing with their friends that also hang around doing nothing. If they do catch a glimpse of your character, then the beast or knight or statue or whatever charges forward blindly and tries to do to you what time will do to the cast of Jersey Shore and leave you as a corpse that resembles beef jerky.
It’s a very simple system that based upon pathfinding and territory triggers. If you move to a location that an enemy can’t reach they might resort to ranged attacks if they have them, and some might give chase for a while, but if you move far enough away all foes will eventually turn around and re-enter their original “kickin’ it” spot like a borg drone given a sleep command. And this simplicity bordering on brainlessness doesn’t just affect the enemies, for (with a couple exceptions) the friendly NPCs also hang around and won’t move from the spots on the ground they’re apparently nailed to, even when you encounter them in monster filled caves and could probably use their help.
Functionally, the AI system in Dark Souls most resembles Alan Grant’s understanding of the T. Rex – if it moves, go forward and kill it; if you don’t want to be killed, don’t move.
As I was saying above though, this simple AI doesn’t hurt the experience of Dark Souls much because the roles of the NPCs work with the simplicity instead of against it. Though they’re fresher, most of the characters in the game are brainless zombies, or at least one form of undead or demon. Since the developers are actively going for lifelessness, it ends up justified, if not actively helping the themes of the game. Fundamentally, the AI complexity is matching the complexity of the roles defined for the NPCs, roles which are themselves defined by the story and setting.
However, not every game gets to use this type of zombie justification. Some games want to do more, perhaps because the story and the setting demand it, or maybe because the developers just feel like they want to prove themselves. This is risky, for when the intent of the NPC roles isn’t just “stand around”, but “mimic life”, it raises the standard of quality, or rather, the expectations on the standard quality of the AI; which of course means that it’s all the easier to get disappointed if they don’t meet them.
One of these games is of course, Skyrim, where unlike Dark Souls, Bethesda attempts to create complex NPCs that aid in the illusion of a flowing, living world: Skyrim itself. Even though it has a few undead enemies who wander around, the majority of the hundreds of NPC’s in Skyrim fit into a rather wide variety of societal roles. Plus, each NPC is much more complex than even fitting into a single defined role; one woman can be a mother, merchant, and wife all at the same time!
Crafting such an illusion of life is a much more complex and nuanced con than making a dead world. It would take a master artist of either AI design and/or pulling one over on a crowd to create a convincing simulation of life like that! Unfortunately, neither a Noonian Soong nor Harold Hill is Todd Howard or the rest of Bethesda.
That is to say, the NPC AI of Skyrim, while being vastly superior to that of Dark Souls from a standpoint of depth and complexity, doesn’t really live up to the expectations that either the developers promised or that the audience should expect from it. Primarily because it’s trying to do so much more, it crashes into the uncanny valley like a lead-lined bus full of Realdolls. I’m not exaggerating that much either; stuff like the bucket trick, which technically isn’t a bug but an exploit, just shouldn’t happen in a game shooting for a sense of naturalism.
However, this isn’t to say that nothing is gained from the AI in Skyrim, for it’s led to a realization of what must be one of the most valuable lessons in AI development for the future . . .
For the AI of a Lifetime, Recall, Recall, Recallll.
Bethesda, like many folks in the U.S., is in love with “The Procedural”. However the type of procedural they love isn’t one where after discovering a body David Caruso pulls a pun upon putting on prescription peeper protectors, but procedural generation that allows them to do less work overall. The most relevant case in point: their Radiant AI system that has governed the last two Elder Scrolls games.
Radiant AI is supposed to be an overarching mechanic that allows Bethesda to govern all of the NPCs in Nirn more efficiently. Basically, it attempts to create a generalized system of AI behavior that mimics a hierarchy of needs, so that on a macro level, the devs just plug in a few specifics about an individual character and at a micro level (that is, what the player sees) the NPC will do things you’d expect them to, like going to work during the day, sleeping at night, eating meals et cetera. Additionally, if you commit actions counter to the NPC’s needs, they will react and adapt in sensible ways that realistically portray how people would in any given situation.
It doesn’t exactly work out as planned:
[youtube width=”560″ height=”315″]http://www.youtube.com/watch?v=LST3TqZqfPc&feature=related[/youtube]
That clip shows off the AI system at both it’s best and it’s worst. In it, several townsfolk are shocked by a dead body in a public square, so they freak out and crowd around, and then the local constabulary comes up to disperse them and investigate the crime. From the Macro level, that’s roughly what should happen.
It’s at the detailed level of what’s going on in real-time, the micro level, where it breaks down. The townsfolk react to the corpse (which is stripped of its clothing) rather slowly, considering the description says it took 20 minutes for them to realize there was a corpse in the middle of their open air market. But worse is probably the “investigation” from the town guards, who ask exactly two questions to the PC. The same PC walking around with both their sword drawn and currently carrying the corpse like it was Weekend at Bernie’s 2!
Obviously, my point is that what works at a macro level doesn’t necessarily work in the micro. It’s one of my primary beefs with procedural generation in general.
Yet in my eyes, this isn’t even the worst problem with propelling the illusion that the little computer people are reasonably intelligent in Skyrim. The inability of NPCs to recognize very specific conditions like this really comes down to development time and planning. If the AI designers at Bethesda had more time or prioritized it more, awkward behavior like this could be eliminated by adding new reaction scripts for the system.
No, to me, the far greater issue is what’s being addressed in this strip from the webcomic Virtual Shackles. Or what I brought up in my review that reader Chris commented on. Or the following clip (especially after the 0:22 mark):
[youtube width=”560″ height=”315″]http://www.youtube.com/watch?v=9hLQHx8u2bM[/youtube]
To subvert a Blade Runner quote: Memory! I’m talking about memory! Most of the NPCs in Skyrim, simply don’t have it.
Playing through Skyrim‘s many dungeons you will encounter two distinct forms of missing memory. The first is “Guy Pearce Syndrome” which, as in the above video, is the lack of short-term memory – where guards think an arrow to the head must’ve been their “imagination”. Next is the “Rodney Dangerfield Syndrome” where the fact that no one seems to remember or respect your deeds as you travel throughout the land implies that there’s little in the way of long-term memory.
I find the latter issue to be particularly frustrating, as the game actually does track many of your actions for its Radiant Story mechanic. This results in occasional moments where the game does bring up something from the past, but without a general reputation system working in conjunction, still results in NPCs treating you like garbage; even after you’ve saved their life from a dragon multiple times, and/or are a war hero fighting for their side. It’s especially ridiculous when you consider that Fallout: New Vegas, a game published by Bethesda and using essentially the same engine, used just such a mechanic!
Perhaps it was this obvious oversight, or maybe it was the 113th enemy that forgot an intruder was nearby after walking by a dead companion, but it eventually dawned upon me: memory, or at least the illusion of memory, is the most important part of selling an NPC to the player. For if the characters in a game can’t remember what’s happened days, hours, minutes, or even seconds before the present, then an NPC with a million unique reactions to what the player does will still come off about as intelligent as Dory from Finding Nemo.
Now, again, I’m not going to say that Skyrim‘s AI is the worst thing ever. It’s not. It’s definitely not the best, and doesn’t live up to the reality the rest of the game world presents, but there are plenty of worse examples. Hell, there are some games where the POINT is to deal with idiotic AI.
But it does seem clear to me now, that not figuring out some way of including memory, even if it’s faked or limited, is probably what’s holding back major AI development in the industry. Especially since it’s not impossible to implement as other games have done it before. Heck, the concept is key to the “Digital pet” or “Life Simulation” games like Black & White, Wonder Project J, and Nintendogs.
Which brings me to my conclusion, which might be a solution to the problem. A “Conlution” if you will.
“Facts, not memories. That’s how you investigate.”
– Leonard Shelby
Unfortunately, even if you had the time to figure out a methodology to make AIs recognize events in a timeline, you probably still can’t allow them use it. Aside from the fact that NPCs that learn too much would eventually become unbeatable and thus frustrating in a different direction, memory usage limitations (of the software variety, not the theoretical) are probably going to keep the concept in check for quite some time. Especially if the complexity of AI gets back on track and starts keeping pace with graphics development in games.
When I mentioned “Guy Pearce Syndrome” above, I was referring to the 2000 film, Memento; a film where Mr. Pearce runs around southern California (I think) trying to solve his wife’s murder. While having anterograde amnesia. That is, he can’t create new memories.
Which is the exact problem that most of Skyrim’s (and many other games) NPC’s seem to have! It’s a rather tough condition to be in, but fortunately for us, Guy Pearce and the screenwriters figured out some clever little solutions.
Namely, photographs – a way of creating facts of the moment.
To create the illusion of short term memory, give the average NPC a limited number of “memory slots” that act like Pearce’s Pictures. When something happens to an NPC that they should remember for a while – say, I dunno, maybe they think they saw an intruder, or they see the dead body of an ally, or their captain gives them a new order – the NPC gets a “snapshot” of the event that can influence or alter behavior. These snapshots can trigger different actions at certain thresholds, like going to find help if too many “fear” or “suspicion” snapshots accumulate, and they fade over time (like the Polaroid in the intro of Memento) so that in actual gameplay this system doesn’t use up all available RAM.
As in the film, the NPC can prioritize certain snapshots over others – say, seeing an ally’s body overrides going to sleep – and if the game features some method of communication between NPCs, then AI can have unique reactions when two of them compare notes about what’s going on. If used cleverly, it could allow for far more complex emergent “reasoning” to develop, like having an NPC in the role of investigator collecting statements from other AI to track the player down. If nothing else, such a system could easily be used to make it so that guards in stealth game recognize when their fellow patrolmen are no longer on their rounds with them.
As for the long-term memory issue? Well, Memento had a solution for that as well:
Of course, Shelby’s Solution is just one idea. Something thought up late at night with only a rudimentary understanding of how AI mechanics work. For a problem that doesn’t seem to bother most folks. Though I can’t tell if that’s because they don’t see it, or if the half-decade of stagnation in this area has just made the average gamer give up hope for progress.
But after playing through iteration after iteration of games that utilize more complex NPC roles (stealth games and RPGs probably being the two biggest genres), where the AI never gets noticeably better, I have to try to be proactive here! So if you have any ideas on how developers can create the illusion of memory in a game, why not toss them down below in the comments? Or if you just think I’m off my rocker and this isn’t a problem worth analyzing, well it’s a free space for that as well!
The point is, I’d like to live up to my new title, and get a dialogue going.
So, until next time! When I’ll either conclude, or build up to a conclusion, this now massive series with a discussion of the opposite of the mind, that beautiful thing we call: The Body!